diff options
Diffstat (limited to 'crypto/evp/p_lib.c')
-rw-r--r-- | crypto/evp/p_lib.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index aef63128f9..170cb89cb0 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -1039,11 +1039,10 @@ const char *evp_pkey_type2name(int type) int EVP_PKEY_is_a(const EVP_PKEY *pkey, const char *name) { - if (pkey->keymgmt == NULL) { - int type = evp_pkey_name2type(name); - - return pkey->type == type; - } + if (pkey == NULL) + return 0; + if (pkey->keymgmt == NULL) + return pkey->type == evp_pkey_name2type(name); return EVP_KEYMGMT_is_a(pkey->keymgmt, name); } |