Don't use ciphersuites for inflating the ClientHello in clienthellotest
[openssl.git] / test / clienthellotest.c
index dc58694c7d4de391e79b4a6b33e73fcef97dc3a8..ee2d0ba2745db3131bd411067429df10e2a95a16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2017 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
@@ -90,16 +90,14 @@ static int test_client_hello(int currtest)
     case TEST_PADDING_NOT_NEEDED:
         SSL_CTX_set_options(ctx, SSL_OP_TLSEXT_PADDING);
         /*
-         * Add lots of ciphersuites so that the ClientHello is at least
+         * Add some dummy ALPN protocols so that the ClientHello is at least
          * F5_WORKAROUND_MIN_MSG_LEN bytes long - meaning padding will be
-         * needed. Also add some dummy ALPN protocols in case we still don't
-         * have enough.
+         * needed.
          */
         if (currtest == TEST_ADD_PADDING
-                && (!TEST_true(SSL_CTX_set_cipher_list(ctx, "ALL"))
-                    || !TEST_false(SSL_CTX_set_alpn_protos(ctx,
-                                               (unsigned char *)alpn_prots,
-                                               sizeof(alpn_prots) - 1))))
+                && (!TEST_false(SSL_CTX_set_alpn_protos(ctx,
+                                    (unsigned char *)alpn_prots,
+                                    sizeof(alpn_prots) - 1))))
             goto end;
 
         break;
@@ -215,14 +213,11 @@ end:
     return testresult;
 }
 
-int test_main(int argc, char *argv[])
+int setup_tests(void)
 {
-    if (argc != 2)
-        return EXIT_FAILURE;
-
-    sessionfile = argv[1];
+    if (!TEST_ptr(sessionfile = test_get_argument(0)))
+        return 0;
 
     ADD_ALL_TESTS(test_client_hello, TOTAL_NUM_TESTS);
-
-    return run_tests(argv[0]);
+    return 1;
 }