mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
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)
This commit is contained in:
parent
ea4d16bc60
commit
8582dccc4d
@ -54,7 +54,7 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
|
||||
goto err;
|
||||
}
|
||||
|
||||
switch (EVP_PKEY_get_id(ret)) {
|
||||
switch (EVP_PKEY_get_base_id(ret)) {
|
||||
case EVP_PKEY_RSA:
|
||||
if ((ret->pkey.rsa = d2i_RSAPublicKey(NULL, pp, length)) == NULL) {
|
||||
ERR_raise(ERR_LIB_ASN1, ERR_R_ASN1_LIB);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user