projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reformat/tidy some of the ASN1 code.
[openssl.git]
/
crypto
/
asn1
/
d2i_pu.c
diff --git
a/crypto/asn1/d2i_pu.c
b/crypto/asn1/d2i_pu.c
index 9eedde3de4168fa84e07e3c84de3bc4d532c50d2..8a05810edabd9a9ee7e73c0408976ea935464147 100644
(file)
--- a/
crypto/asn1/d2i_pu.c
+++ b/
crypto/asn1/d2i_pu.c
@@
-62,8
+62,17
@@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/asn1.h>
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/asn1.h>
+#ifndef OPENSSL_NO_RSA
+#include <openssl/rsa.h>
+#endif
+#ifndef OPENSSL_NO_DSA
+#include <openssl/dsa.h>
+#endif
+#ifndef OPENSSL_NO_EC
+#include <openssl/ec.h>
+#endif
-EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
+EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a,
const
unsigned char **pp,
long length)
{
EVP_PKEY *ret;
long length)
{
EVP_PKEY *ret;
@@
-82,7
+91,7
@@
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
ret->type=EVP_PKEY_type(type);
switch (ret->type)
{
ret->type=EVP_PKEY_type(type);
switch (ret->type)
{
-#ifndef NO_RSA
+#ifndef
OPENSSL_
NO_RSA
case EVP_PKEY_RSA:
if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,
(const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
case EVP_PKEY_RSA:
if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,
(const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
@@
-92,15
+101,25
@@
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
}
break;
#endif
}
break;
#endif
-#ifndef NO_DSA
+#ifndef
OPENSSL_
NO_DSA
case EVP_PKEY_DSA:
case EVP_PKEY_DSA:
- if (
(ret->pkey.dsa=d2i_DSAPublicKey(NULL
,
- (const unsigned char **)pp,length))
== NULL)
/* TMP UGLY CAST */
+ if (
!d2i_DSAPublicKey(&(ret->pkey.dsa)
,
+ (const unsigned char **)pp,length)) /* TMP UGLY CAST */
{
ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
goto err;
}
break;
{
ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
goto err;
}
break;
+#endif
+#ifndef OPENSSL_NO_EC
+ case EVP_PKEY_EC:
+ if (!o2i_ECPublicKey(&(ret->pkey.eckey),
+ (const unsigned char **)pp, length))
+ {
+ 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);
#endif
default:
ASN1err(ASN1_F_D2I_PUBLICKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);