From: Pauli Date: Fri, 30 Aug 2024 01:43:29 +0000 (+1000) Subject: endecode_test.c: Fix !fips v3.0.0 check X-Git-Tag: openssl-3.0.15~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9aae56395aa8e77c44a9df83fd395a644d016635;p=thirdparty%2Fopenssl.git endecode_test.c: Fix !fips v3.0.0 check The fips_provider_version_* functions return true if the FIPS provider isn't loaded. This is somewhat counterintuitive and the fix in #25327 neglected this nuance resulting in not running the SM2 tests when the FIPS provider wasn't being loaded. Reviewed-by: Viktor Dukhovni Reviewed-by: Tom Cosgrove Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/25331) (cherry picked from commit c6c6af18ea5f8dd7aa2bd54b63fcb813ee6c2394) --- diff --git a/test/endecode_test.c b/test/endecode_test.c index b5cc5d38516..c8c33e9facc 100644 --- a/test/endecode_test.c +++ b/test/endecode_test.c @@ -1337,9 +1337,7 @@ int setup_tests(void) } /* FIPS(3.0.0): provider imports explicit params but they won't work #17998 */ - is_fips_3_0_0 = fips_provider_version_eq(testctx, 3, 0, 0); - if (is_fips_3_0_0 < 0) - return 0; + is_fips_3_0_0 = is_fips && fips_provider_version_eq(testctx, 3, 0, 0); /* Separate provider/ctx for generating the test data */ if (!TEST_ptr(keyctx = OSSL_LIB_CTX_new()))