Skip to content

Commit

Permalink
Fix clienthellotest with TLSv1.3
Browse files Browse the repository at this point in the history
If TLSv1.3 is enabled and combined with other options that extend the
size of the ClientHello, then the clienthello test can sometimes fail
because the ClientHello has grown too large. Part of the purpose of the
test is to check that the padding extension works properly. This requires
the ClientHello size to be kept within certain bounds.

By restricting the number of ciphersuites sent we can reduce the size of
the ClientHello.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from #5266)
  • Loading branch information
mattcaswell committed Feb 7, 2018
1 parent f518cef commit 0f41dc0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/clienthellotest.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ static int test_client_hello(int currtest)
break;

case TEST_ADD_PADDING_AND_PSK:
/*
* In this case we're doing TLSv1.3 and we're sending a PSK so the
* ClientHello is already going to be quite long. To avoid getting one
* that is too long for this test we use a restricted ciphersuite list
*/
if (!TEST_true(SSL_CTX_set_cipher_list(ctx,
"TLS13-AES-128-GCM-SHA256")))
goto end;
/* Fall through */
case TEST_ADD_PADDING:
case TEST_PADDING_NOT_NEEDED:
SSL_CTX_set_options(ctx, SSL_OP_TLSEXT_PADDING);
Expand Down

0 comments on commit 0f41dc0

Please sign in to comment.