From 2322ee2c7efdd0a65d7bf940f5abc1d68917a94b Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Fri, 27 Dec 2024 22:12:19 -0800 Subject: [PATCH] check if RSA is supported for test case --- scripts/openssl.test | 65 ++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/scripts/openssl.test b/scripts/openssl.test index 525e2d3134..2a0a2c8f3e 100755 --- a/scripts/openssl.test +++ b/scripts/openssl.test @@ -1233,37 +1233,42 @@ do done IFS="$OIFS" #restore separator -# Test for RSA-PSS certs interop -# was running into alert sent by openssl server with version 1.1.1 released in -# Sep 2018 - -$OPENSSL version | awk '{print $2}' | awk -F. '{if ($1 >= 3) exit 1; else exit 0;}' -RESULT=$? -if [ "$RESULT" = "0" ]; then - echo -e "Older version of openssl detected, skipping interop RSA-PSS test" -else - echo -e "Doing interop RSA-PSS test" - - key_file=${CERT_DIR}/rsapss/server-rsapss-priv.pem - cert_file=${CERT_DIR}/rsapss/server-rsapss.pem - ca_file=${CERT_DIR}/client-cert.pem - openssl_suite="RSAPSS" - start_openssl_server - - cert="${CERT_DIR}/client-cert.pem" - key="${CERT_DIR}/client-key.pem" - caCert="${CERT_DIR}/rsapss/ca-rsapss.pem" - crl="-C" - wolfSuite="ALL" - wolfssl_no_resume="yes" - version="4" - port=$server_port - do_wolfssl_client - - version="3" - do_wolfssl_client +# Skip RSA-PSS interop test when RSA is not supported +if [ "$wolf_rsa" != "" ] +then + # Test for RSA-PSS certs interop + # Was running into alert sent by openssl server with version 1.1.1 released + # in Sep 2018. To avoid this issue check that openssl version 3.0.0 or later + # is used. + + $OPENSSL version | awk '{print $2}' | \ + awk -F. '{if ($1 >= 3) exit 1; else exit 0;}' + RESULT=$? + if [ "$RESULT" = "0" ]; then + echo -e "Old version of openssl detected, skipping interop RSA-PSS test" + else + echo -e "Doing interop RSA-PSS test" + + key_file=${CERT_DIR}/rsapss/server-rsapss-priv.pem + cert_file=${CERT_DIR}/rsapss/server-rsapss.pem + ca_file=${CERT_DIR}/client-cert.pem + openssl_suite="RSAPSS" + start_openssl_server + + cert="${CERT_DIR}/client-cert.pem" + key="${CERT_DIR}/client-key.pem" + caCert="${CERT_DIR}/rsapss/ca-rsapss.pem" + crl="-C" + wolfSuite="ALL" + wolfssl_no_resume="yes" + version="4" + port=$server_port + do_wolfssl_client + + version="3" + do_wolfssl_client + fi fi - do_cleanup echo -e "wolfSSL total cases $wolf_cases_total"