summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/crypto/asn1/d2i_pu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/src/crypto/asn1/d2i_pu.c')
-rw-r--r--src/lib/libssl/src/crypto/asn1/d2i_pu.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/lib/libssl/src/crypto/asn1/d2i_pu.c b/src/lib/libssl/src/crypto/asn1/d2i_pu.c
index 71f2eb361b..3694f51a8c 100644
--- a/src/lib/libssl/src/crypto/asn1/d2i_pu.c
+++ b/src/lib/libssl/src/crypto/asn1/d2i_pu.c
@@ -68,8 +68,11 @@
68#ifndef OPENSSL_NO_DSA 68#ifndef OPENSSL_NO_DSA
69#include <openssl/dsa.h> 69#include <openssl/dsa.h>
70#endif 70#endif
71#ifndef OPENSSL_NO_EC
72#include <openssl/ec.h>
73#endif
71 74
72EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, 75EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
73 long length) 76 long length)
74 { 77 {
75 EVP_PKEY *ret; 78 EVP_PKEY *ret;
@@ -100,14 +103,24 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
100#endif 103#endif
101#ifndef OPENSSL_NO_DSA 104#ifndef OPENSSL_NO_DSA
102 case EVP_PKEY_DSA: 105 case EVP_PKEY_DSA:
103 if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL, 106 if (!d2i_DSAPublicKey(&(ret->pkey.dsa),
104 (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ 107 (const unsigned char **)pp,length)) /* TMP UGLY CAST */
105 { 108 {
106 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); 109 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
107 goto err; 110 goto err;
108 } 111 }
109 break; 112 break;
110#endif 113#endif
114#ifndef OPENSSL_NO_EC
115 case EVP_PKEY_EC:
116 if (!o2i_ECPublicKey(&(ret->pkey.ec),
117 (const unsigned char **)pp, length))
118 {
119 ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB);
120 goto err;
121 }
122 break;
123#endif
111 default: 124 default:
112 ASN1err(ASN1_F_D2I_PUBLICKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE); 125 ASN1err(ASN1_F_D2I_PUBLICKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
113 goto err; 126 goto err;