summaryrefslogtreecommitdiff
path: root/crypto/asn1/i2d_evp.c
diff options
context:
space:
mode:
authorzhaozg <zhaozg@gmail.com>2022-01-01 22:45:12 +0800
committerTomas Mraz <tomas@openssl.org>2022-01-05 10:07:48 +0100
commit8582dccc4dd1f1667b0e91a098e2cc78c7146dd7 (patch)
tree88f39bc69c79be0ab9a11703b136375f011828a4 /crypto/asn1/i2d_evp.c
parentea4d16bc60dee53feb71997c1e78379eeb69b7ac (diff)
downloadopenssl-new-8582dccc4dd1f1667b0e91a098e2cc78c7146dd7.tar.gz
sm2: fix {i2d,d2i}_PublicKey EC_KEY is EVP_PKEY_SM2
CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17389)
Diffstat (limited to 'crypto/asn1/i2d_evp.c')
-rw-r--r--crypto/asn1/i2d_evp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/asn1/i2d_evp.c b/crypto/asn1/i2d_evp.c
index 8b36388263..070ac83376 100644
--- a/crypto/asn1/i2d_evp.c
+++ b/crypto/asn1/i2d_evp.c
@@ -131,7 +131,7 @@ int i2d_PublicKey(const EVP_PKEY *a, unsigned char **pp)
return i2d_provided(a, EVP_PKEY_PUBLIC_KEY, output_info, pp);
}
- switch (EVP_PKEY_get_id(a)) {
+ switch (EVP_PKEY_get_base_id(a)) {
case EVP_PKEY_RSA:
return i2d_RSAPublicKey(EVP_PKEY_get0_RSA(a), pp);
#ifndef OPENSSL_NO_DSA