summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/d2i_pu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/d2i_pu.c')
-rw-r--r--src/lib/libcrypto/asn1/d2i_pu.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/libcrypto/asn1/d2i_pu.c b/src/lib/libcrypto/asn1/d2i_pu.c
index f04d230d70..ccd03c066f 100644
--- a/src/lib/libcrypto/asn1/d2i_pu.c
+++ b/src/lib/libcrypto/asn1/d2i_pu.c
@@ -77,24 +77,20 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
77{ 77{
78 EVP_PKEY *ret; 78 EVP_PKEY *ret;
79 79
80 if ((a == NULL) || (*a == NULL)) 80 if ((a == NULL) || (*a == NULL)) {
81 { 81 if ((ret=EVP_PKEY_new()) == NULL) {
82 if ((ret=EVP_PKEY_new()) == NULL)
83 {
84 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB); 82 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB);
85 return(NULL); 83 return(NULL);
86 } 84 }
87 } 85 }
88 else ret= *a; 86 else ret= *a;
89 87
90 if (!EVP_PKEY_set_type(ret, type)) 88 if (!EVP_PKEY_set_type(ret, type)) {
91 {
92 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB); 89 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_EVP_LIB);
93 goto err; 90 goto err;
94 } 91 }
95 92
96 switch (EVP_PKEY_id(ret)) 93 switch (EVP_PKEY_id(ret)) {
97 {
98#ifndef OPENSSL_NO_RSA 94#ifndef OPENSSL_NO_RSA
99 case EVP_PKEY_RSA: 95 case EVP_PKEY_RSA:
100 if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL, 96 if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,