From 8b4a8fa92fb498520f92135683a923f02aa267d3 Mon Sep 17 00:00:00 2001 From: Michael Baentsch <57787676+baentsch@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:29:55 +0200 Subject: [PATCH] fix file location error in P12 test (#546) * fix file location error in P12 test Signed-off-by: Michael Baentsch <57787676+baentsch@users.noreply.github.com> * exit test on bad config Signed-off-by: Michael Baentsch <57787676+baentsch@users.noreply.github.com> * Update scripts/oqsprovider-pkcs12gen.sh Co-authored-by: Spencer Wilson Signed-off-by: Michael Baentsch <57787676+baentsch@users.noreply.github.com> --------- Signed-off-by: Michael Baentsch <57787676+baentsch@users.noreply.github.com> Co-authored-by: Spencer Wilson --- scripts/oqsprovider-pkcs12gen.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/oqsprovider-pkcs12gen.sh b/scripts/oqsprovider-pkcs12gen.sh index 734397fc..77701660 100755 --- a/scripts/oqsprovider-pkcs12gen.sh +++ b/scripts/oqsprovider-pkcs12gen.sh @@ -23,6 +23,11 @@ if [ -z "$OPENSSL_MODULES" ]; then echo "Warning: OPENSSL_MODULES env var not set." fi +if [ -z "$OPENSSL_CONF" ]; then + echo "OPENSSL_CONF env var not set. Exiting." + exit 1 +fi + # Set OSX DYLD_LIBRARY_PATH if not already externally set if [ -z "$DYLD_LIBRARY_PATH" ]; then export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH @@ -47,7 +52,7 @@ if [ $? -ne 0 ] || [ ! -f tmp/$1_srv_1.p12 ]; then fi # Generate config file with oqsprovider disabled -sed -e 's/^oqsprovider/# oqsprovider/' "$(pwd)/scripts/openssl-ca.cnf" > tmp/openssl-ca-no-oqsprovider.cnf +sed -e 's/^oqsprovider/# oqsprovider/' "$OPENSSL_CONF" > tmp/openssl-ca-no-oqsprovider.cnf # This print an error but OpenSSL returns 0 and .p12 file is generated correctly OPENSSL_CONF=tmp/openssl-ca-no-oqsprovider.cnf $OPENSSL_APP pkcs12 -provider default -provider oqsprovider -export -in tmp/$1_srv.crt -inkey tmp/$1_srv.key -passout pass: -out tmp/$1_srv_2.p12