On 11/1/22 16:18, Mimi Zohar wrote:
Since the distros are now shipping with OpenSSL 3, no need
to build it. Limit the sm2/sm3 test to OpenSSL 3.
Signed-off-by: Mimi Zohar <zohar@xxxxxxxxxxxxx>
---
tests/sign_verify.test | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/sign_verify.test b/tests/sign_verify.test
index 3e9548e1aeb7..ed95f6955dc1 100755
--- a/tests/sign_verify.test
+++ b/tests/sign_verify.test
@@ -416,8 +416,8 @@ sign_verify prime256v1 sha384 0x030205:K:004[345678]
sign_verify prime256v1 sha512 0x030206:K:004[345678]
# If openssl 3.0 is installed, test the SM2/3 algorithm combination
-if [ -x /opt/openssl3/bin/openssl ]; then
- PATH=/opt/openssl3/bin:$PATH LD_LIBRARY_PATH=/opt/openssl3/lib \
+ssl_version=$(openssl version | sed -e 's/^OpenSSL //' | sed -e 's/ .*//')
This would give you the major number in one step by selecting all all characters after 'OpenSSL ' and before the first '.':
major=$(openssl version | sed -n 's/^OpenSSL \([^\.]\).*/\1/p')
+if test "${ssl_version::1}" = "3"; then
sign_verify sm2 sm3 0x030211:K:004[345678]
fi
Reviewed-by: Stefan Berger <stefanb@xxxxxxxxxxxxx>