diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/d2i_pu.c')
-rw-r--r-- | src/lib/libcrypto/asn1/d2i_pu.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/d2i_pu.c b/src/lib/libcrypto/asn1/d2i_pu.c index 3694f51a8c..c8f39ceb03 100644 --- a/src/lib/libcrypto/asn1/d2i_pu.c +++ b/src/lib/libcrypto/asn1/d2i_pu.c | |||
@@ -87,9 +87,13 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, | |||
87 | } | 87 | } |
88 | else ret= *a; | 88 | else ret= *a; |
89 | 89 | ||
90 | ret->save_type=type; | 90 | if (!EVP_PKEY_set_type(ret, type)) |
91 | ret->type=EVP_PKEY_type(type); | 91 | { |
92 | switch (ret->type) | 92 | ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB); |
93 | goto err; | ||
94 | } | ||
95 | |||
96 | switch (EVP_PKEY_id(ret)) | ||
93 | { | 97 | { |
94 | #ifndef OPENSSL_NO_RSA | 98 | #ifndef OPENSSL_NO_RSA |
95 | case EVP_PKEY_RSA: | 99 | case EVP_PKEY_RSA: |