From: Richard Levitte Date: Wed, 25 Sep 2019 07:15:42 +0000 (+0200) Subject: Make EVP_CIPHER_is_a() work with legacy cipher implementations too X-Git-Tag: openssl-3.0.0-alpha1~1239 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=776cb8358ebaea254d0537cf57cbafe65ac6f5cf;p=thirdparty%2Fopenssl.git Make EVP_CIPHER_is_a() work with legacy cipher implementations too Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/10008) --- diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 5c935075dcc..3abea33d196 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -504,6 +504,13 @@ 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); }