From 4ac34b74bdc4f04478101d4317954a868c60defd Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Fri, 1 Jun 2018 09:24:28 +1000 Subject: [PATCH] Fix test to work with configurations not including AES-GCM --- scripts/psk.test | 15 +++++++++++++++ tests/suites.c | 20 +++++++++++--------- tests/test-psk.conf | 10 +--------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/scripts/psk.test b/scripts/psk.test index d8a0c3d07..0d21443f2 100755 --- a/scripts/psk.test +++ b/scripts/psk.test @@ -103,6 +103,21 @@ if [ $? -ne 0 ]; then fi echo "" + # psk server with non psk client + port=0 + ./examples/server/server -j -R $ready_file -p $port & + server_pid=$! + create_port + ./examples/client/client -p $port + RESULT=$? + remove_ready_file + if [ $RESULT -ne 0 ]; then + echo -e "\n\nClient connection failed" + do_cleanup + exit 1 + fi + echo "" + # check fail if no auth, psk server with non psk client echo "Checking fail when not sending peer cert" port=0 diff --git a/tests/suites.c b/tests/suites.c index bf25430e8..16bf850ce 100644 --- a/tests/suites.c +++ b/tests/suites.c @@ -703,15 +703,17 @@ int SuiteTest(void) #endif #ifndef NO_PSK #ifndef WOLFSSL_NO_TLS12 - /* add psk cipher suites */ - strcpy(argv0[1], "tests/test-psk.conf"); - printf("starting psk cipher suite tests\n"); - test_harness(&args); - if (args.return_code != 0) { - printf("error from script %d\n", args.return_code); - args.return_code = EXIT_FAILURE; - goto exit; - } + #if !defined(NO_RSA) || defined(HAVE_ECC) + /* add psk cipher suites */ + strcpy(argv0[1], "tests/test-psk.conf"); + printf("starting psk cipher suite tests\n"); + test_harness(&args); + if (args.return_code != 0) { + printf("error from script %d\n", args.return_code); + args.return_code = EXIT_FAILURE; + goto exit; + } + #endif #endif #ifdef WOLFSSL_TLS13 /* add psk extra suites */ diff --git a/tests/test-psk.conf b/tests/test-psk.conf index 4086b3e93..f4f11b298 100644 --- a/tests/test-psk.conf +++ b/tests/test-psk.conf @@ -1,15 +1,7 @@ -# server - standard PSK +# server - PSK plus certificates -j -l PSK-CHACHA20-POLY1305 # client- standard PSK -s -l PSK-CHACHA20-POLY1305 - -# server --j --l ECDHE-RSA-AES256-GCM-SHA384:PSK-CHACHA20-POLY1305 - -# client --l ECDHE-RSA-AES256-GCM-SHA384:PSK-CHACHA20-POLY1305 -