diff options
author | Richard Levitte <levitte@openssl.org> | 2019-09-25 09:15:42 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-10-01 22:51:00 +0200 |
commit | 776cb8358ebaea254d0537cf57cbafe65ac6f5cf (patch) | |
tree | dfeb6d1d249a342c8f9de032d520f4aa6eceafa9 /crypto/evp/evp_lib.c | |
parent | Remove EVP_CIPH_FLAG_DEFAULT_ASN1 from all provided implementations (diff) | |
download | openssl-776cb8358ebaea254d0537cf57cbafe65ac6f5cf.tar.xz openssl-776cb8358ebaea254d0537cf57cbafe65ac6f5cf.zip |
Make EVP_CIPHER_is_a() work with legacy cipher implementations too
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10008)
Diffstat (limited to 'crypto/evp/evp_lib.c')
-rw-r--r-- | crypto/evp/evp_lib.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 5c935075dc..3abea33d19 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); } |