diff options
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c')
| -rw-r--r-- | Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c b/Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c index 1f05fee2..33542dd1 100644 --- a/Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c +++ b/Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c @@ -85,9 +85,12 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, } else ret = *a; - ret->save_type = type; - ret->type = EVP_PKEY_type(type); - switch (ret->type) { + if (!EVP_PKEY_set_type(ret, type)) { + ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_EVP_LIB); + goto err; + } + + switch (EVP_PKEY_id(ret)) { #ifndef OPENSSL_NO_RSA case EVP_PKEY_RSA: /* TMP UGLY CAST */ |
