X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=test%2Fclienthellotest.c;h=10e3b1b1b172408e7fffcbb893d5c4453cc3d44d;hp=32103d0c352aa75c323d10b0bb35cecafabdf492;hb=1bf4cb0fe3b00e1c501a04ace4e3e3145314cb20;hpb=c423ecaa7f6d0cc77c4f121c6de7d585439bca8f diff --git a/test/clienthellotest.c b/test/clienthellotest.c index 32103d0c35..10e3b1b1b1 100644 --- a/test/clienthellotest.c +++ b/test/clienthellotest.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -78,6 +78,8 @@ static int test_client_hello(int currtest) ctx = SSL_CTX_new(TLS_method()); if (!TEST_ptr(ctx)) goto end; + if (!TEST_true(SSL_CTX_set_max_proto_version(ctx, TLS_MAX_VERSION))) + goto end; switch(currtest) { case TEST_SET_SESSION_TICK_DATA_VER_NEG: @@ -97,8 +99,7 @@ static int test_client_hello(int currtest) * 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"))) + if (!TEST_true(SSL_CTX_set_cipher_list(ctx, ""))) goto end; /* Fall through */ case TEST_ADD_PADDING: @@ -111,12 +112,21 @@ static int test_client_hello(int currtest) * F5_WORKAROUND_MIN_MSG_LEN bytes long - meaning padding will be * needed. */ - if (currtest == TEST_ADD_PADDING - && (!TEST_false(SSL_CTX_set_alpn_protos(ctx, + if (currtest == TEST_ADD_PADDING) { + if (!TEST_false(SSL_CTX_set_alpn_protos(ctx, (unsigned char *)alpn_prots, - sizeof(alpn_prots) - 1)))) + sizeof(alpn_prots) - 1))) + goto end; + /* + * Otherwise we need to make sure we have a small enough message to + * not need padding. + */ + } else if (!TEST_true(SSL_CTX_set_cipher_list(ctx, + "AES128-SHA")) + || !TEST_true(SSL_CTX_set_ciphersuites(ctx, + "TLS_AES_128_GCM_SHA256"))) { goto end; - + } break; default: