diff options
author | zhaozg <zhaozg@gmail.com> | 2021-11-12 23:12:46 +0800 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-11-17 08:51:55 +1000 |
commit | c28bcc507be1b035237892181bbbb28383c3f2be (patch) | |
tree | 8d7ccddadaa5e89b5741a5f679211b3c65a986b6 /crypto | |
parent | 4204cd6429b8d25e2d96b38b264ef7fa1b67d7be (diff) |
evp: fix EVP_PKEY_get0_EC_KEY when EC_KEY is SM2
EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2) will change pkey->type to EVP_PKEY_SM2
CLA: trivial
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17015)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/evp/p_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 7e262c573b..eb3e117b52 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -525,7 +525,7 @@ int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) { - if (pkey->type != EVP_PKEY_EC) { + if (EVP_PKEY_base_id(pkey) != EVP_PKEY_EC) { EVPerr(EVP_F_EVP_PKEY_GET0_EC_KEY, EVP_R_EXPECTING_A_EC_KEY); return NULL; } |