summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/d2i_pu.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2002-02-13 18:21:51 +0000
committerBodo Möller <bodo@openssl.org>2002-02-13 18:21:51 +0000
commit4d94ae00d5614d64d4dd065860c4b00161a81f82 (patch)
treee993aa323ea753b3c0782439eb78f4f8c896a67e /crypto/asn1/d2i_pu.c
parent60d8bae30d1040a4f955e3247443b2dd4c674cde (diff)
ECDSA support
Submitted by: Nils Larsch <nla@trustcenter.de>
Diffstat (limited to 'crypto/asn1/d2i_pu.c')
-rw-r--r--crypto/asn1/d2i_pu.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c
index 71f2eb361b..81b5d0f820 100644
--- a/crypto/asn1/d2i_pu.c
+++ b/crypto/asn1/d2i_pu.c
@@ -68,6 +68,9 @@
#ifndef OPENSSL_NO_DSA
#include <openssl/dsa.h>
#endif
+#ifndef OPENSSL_NO_ECDSA
+#include <openssl/ecdsa.h>
+#endif
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
long length)
@@ -100,7 +103,7 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
#endif
#ifndef OPENSSL_NO_DSA
case EVP_PKEY_DSA:
- if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL,
+ if ((ret->pkey.dsa=d2i_DSAPublicKey(&(ret->pkey.dsa),
(const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
{
ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
@@ -108,6 +111,16 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
}
break;
#endif
+#ifndef OPENSSL_NO_ECDSA
+ case EVP_PKEY_ECDSA:
+ if ((ret->pkey.ecdsa = d2i_ECDSAPublicKey(&(ret->pkey.ecdsa),
+ (const unsigned char **)pp, length)) == NULL)
+ {
+ ASN1err(ASN1_F_D2I_PUBLICKEY, ERR_R_ASN1_LIB);
+ goto err;
+ }
+ break;
+#endif
default:
ASN1err(ASN1_F_D2I_PUBLICKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
goto err;