summaryrefslogtreecommitdiffstats
path: root/test/handshake_helper.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-02-03 11:21:07 +0000
committerMatt Caswell <matt@openssl.org>2017-02-16 09:39:05 +0000
commit9c5a691d578a4debfd6ecacc030a85900906bf0d (patch)
tree5f87c146078aa84fb1cc8d41c4410093062447f9 /test/handshake_helper.c
parent3bdc1dc8fcc97a8945ddbc2748e7059207ea3914 (diff)
Provide a test for the Encrypt-Then-Mac renegotiation crash
Changing the ciphersuite during a renegotiation can result in a crash leading to a DoS attack. ETM has not been implemented in 1.1.0 for DTLS so this is TLS only. This commit provides a test for the issue. CVE-2017-3733 Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test/handshake_helper.c')
-rw-r--r--test/handshake_helper.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/handshake_helper.c b/test/handshake_helper.c
index 0a421b1597..7ef015f8a4 100644
--- a/test/handshake_helper.c
+++ b/test/handshake_helper.c
@@ -607,10 +607,20 @@ static void do_reneg_setup_step(const SSL_TEST_CTX *test_ctx, PEER *peer)
* session. The server may or may not resume dependant on the
* setting of SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
*/
- if (SSL_is_server(peer->ssl))
+ if (SSL_is_server(peer->ssl)) {
ret = SSL_renegotiate(peer->ssl);
- else
- ret = SSL_renegotiate_abbreviated(peer->ssl);
+ } else {
+ if (test_ctx->extra.client.reneg_ciphers != NULL) {
+ if (!SSL_set_cipher_list(peer->ssl,
+ test_ctx->extra.client.reneg_ciphers)) {
+ peer->status = PEER_ERROR;
+ return;
+ }
+ ret = SSL_renegotiate(peer->ssl);
+ } else {
+ ret = SSL_renegotiate_abbreviated(peer->ssl);
+ }
+ }
if (!ret) {
peer->status = PEER_ERROR;
return;