X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=test%2Fclienthellotest.c;h=0afad6dbd609db9fe0d93eda4bddf631a99c8af0;hb=8e63900a71df38ff204871006ab0851c8ed73744;hp=45595d393ae8b005ff7053d2b2c9daecac46043f;hpb=f865b08143b453962ad4afccd69e698d13c60f77;p=openssl.git diff --git a/test/clienthellotest.c b/test/clienthellotest.c index 45595d393a..0afad6dbd6 100644 --- a/test/clienthellotest.c +++ b/test/clienthellotest.c @@ -1,7 +1,7 @@ /* * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * - * Licensed under the OpenSSL license (the "License"). You may not use + * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html @@ -58,7 +58,7 @@ static int test_client_hello(int currtest) BIO *wbio; long len; unsigned char *data; - PACKET pkt = {0}, pkt2 = {0}, pkt3 = {0}; + PACKET pkt, pkt2, pkt3; char *dummytick = "Hello World!"; unsigned int type = 0; int testresult = 0; @@ -71,6 +71,10 @@ static int test_client_hello(int currtest) return 1; #endif + memset(&pkt, 0, sizeof(pkt)); + memset(&pkt2, 0, sizeof(pkt2)); + memset(&pkt3, 0, sizeof(pkt3)); + /* * For each test set up an SSL_CTX and SSL and see what ClientHello gets * produced when we try to connect @@ -78,6 +82,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, 0))) + goto end; switch(currtest) { case TEST_SET_SESSION_TICK_DATA_VER_NEG: @@ -97,8 +103,9 @@ 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, ""))) + if (!TEST_false(SSL_CTX_set_cipher_list(ctx, ""))) goto end; + ERR_clear_error(); /* Fall through */ case TEST_ADD_PADDING: case TEST_PADDING_NOT_NEEDED: @@ -120,7 +127,9 @@ static int test_client_hello(int currtest) * not need padding. */ } else if (!TEST_true(SSL_CTX_set_cipher_list(ctx, - "AES128-SHA:TLS13-AES-128-GCM-SHA256"))) { + "AES128-SHA")) + || !TEST_true(SSL_CTX_set_ciphersuites(ctx, + "TLS_AES_128_GCM_SHA256"))) { goto end; } break; @@ -236,6 +245,8 @@ end: return testresult; } +OPT_TEST_DECLARE_USAGE("sessionfile\n") + int setup_tests(void) { if (!TEST_ptr(sessionfile = test_get_argument(0)))