EVP: Adapt EVP_PKEY_missing_parameters() for provider keys
[openssl.git] / crypto / evp / evp_lib.c
index 3c2083148ed63d925b23d3c2ddb9b519d7938a9c..2b5126717982c08af9f63cf342ee7a0b53da1400 100644 (file)
@@ -532,14 +532,9 @@ int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx)
 
 int EVP_CIPHER_is_a(const EVP_CIPHER *cipher, const char *name)
 {
-#ifndef FIPS_MODE
-    if (cipher->prov == NULL) {
-        int nid = EVP_CIPHER_nid(cipher);
-
-        return nid == OBJ_sn2nid(name) || nid == OBJ_ln2nid(name);
-    }
-#endif
-    return evp_is_a(cipher->prov, cipher->name_id, name);
+    if (cipher->prov != NULL)
+        return evp_is_a(cipher->prov, cipher->name_id, NULL, name);
+    return evp_is_a(NULL, 0, EVP_CIPHER_name(cipher), name);
 }
 
 int EVP_CIPHER_number(const EVP_CIPHER *cipher)
@@ -578,7 +573,9 @@ int EVP_CIPHER_mode(const EVP_CIPHER *cipher)
 
 int EVP_MD_is_a(const EVP_MD *md, const char *name)
 {
-    return evp_is_a(md->prov, md->name_id, name);
+    if (md->prov != NULL)
+        return evp_is_a(md->prov, md->name_id, NULL, name);
+    return evp_is_a(NULL, 0, EVP_MD_name(md), name);
 }
 
 int EVP_MD_number(const EVP_MD *md)