Add EVP_MAC_provider()
[openssl.git] / test / evp_extra_test.c
index 6fca3a38f5500a9dd07e7db8ba9cd03cde55c666..fc3d6283ac1300dc5ac350825ce810f11284a0b8 100644 (file)
@@ -599,7 +599,7 @@ static int test_EVP_PKCS82PKEY(void)
 }
 #endif
 
-#ifndef OPENSSL_NO_SM2
+#if !defined(OPENSSL_NO_SM2) && !defined(FIPS_MODE)
 
 static int test_EVP_SM2_verify(void)
 {
@@ -1150,8 +1150,8 @@ static int test_EVP_MD_fetch(int tst)
             || !TEST_int_eq(EVP_MD_block_size(md), SHA256_CBLOCK))
         goto err;
 
-    /* Also test EVP_MD_upref() while we're doing this */
-    if (!TEST_true(EVP_MD_upref(md)))
+    /* Also test EVP_MD_up_ref() while we're doing this */
+    if (!TEST_true(EVP_MD_up_ref(md)))
         goto err;
     /* Ref count should now be 2. Release both */
     EVP_MD_meth_free(md);
@@ -1178,7 +1178,7 @@ static int test_EVP_MD_fetch(int tst)
     md = NULL;
 
     /*
-     * Explicitly asking for the default implementation should succeeed except
+     * Explicitly asking for the default implementation should succeed except
      * in test 4 where the default provider is not loaded.
      */
     md = EVP_MD_fetch(ctx, "SHA256", "default=yes");
@@ -1220,6 +1220,11 @@ static int test_EVP_MD_fetch(int tst)
     EVP_MD_meth_free(md);
     OSSL_PROVIDER_unload(defltprov);
     OSSL_PROVIDER_unload(fipsprov);
+    /* Not normally needed, but we would like to test that
+     * OPENSSL_thread_stop_ex() behaves as expected.
+     */
+    if (ctx != NULL)
+        OPENSSL_thread_stop_ex(ctx);
     OPENSSL_CTX_free(ctx);
     return ret;
 }
@@ -1233,7 +1238,7 @@ int setup_tests(void)
 #ifndef OPENSSL_NO_EC
     ADD_TEST(test_EVP_PKCS82PKEY);
 #endif
-#ifndef OPENSSL_NO_SM2
+#if !defined(OPENSSL_NO_SM2) && !defined(FIPS_MODE)
     ADD_TEST(test_EVP_SM2);
     ADD_TEST(test_EVP_SM2_verify);
 #endif