Skip to content

Commit

Permalink
check if RSA is supported for test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Dec 28, 2024
1 parent 589f20f commit 2322ee2
Showing 1 changed file with 35 additions and 30 deletions.
65 changes: 35 additions & 30 deletions scripts/openssl.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2322ee2

Please sign in to comment.