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.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/lib/libssl/src/crypto/asn1/d2i_pu.c b/src/lib/libssl/src/crypto/asn1/d2i_pu.c
index 5d6192f1e5..71f2eb361b 100644
--- a/src/lib/libssl/src/crypto/asn1/d2i_pu.c
+++ b/src/lib/libssl/src/crypto/asn1/d2i_pu.c
@@ -58,16 +58,19 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include "bn.h" 61#include <openssl/bn.h>
62#include "evp.h" 62#include <openssl/evp.h>
63#include "objects.h" 63#include <openssl/objects.h>
64#include "x509.h" 64#include <openssl/asn1.h>
65#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h>
67#endif
68#ifndef OPENSSL_NO_DSA
69#include <openssl/dsa.h>
70#endif
65 71
66EVP_PKEY *d2i_PublicKey(type,a,pp,length) 72EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp,
67int type; 73 long length)
68EVP_PKEY **a;
69unsigned char **pp;
70long length;
71 { 74 {
72 EVP_PKEY *ret; 75 EVP_PKEY *ret;
73 76
@@ -85,18 +88,20 @@ long length;
85 ret->type=EVP_PKEY_type(type); 88 ret->type=EVP_PKEY_type(type);
86 switch (ret->type) 89 switch (ret->type)
87 { 90 {
88#ifndef NO_RSA 91#ifndef OPENSSL_NO_RSA
89 case EVP_PKEY_RSA: 92 case EVP_PKEY_RSA:
90 if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,pp,length)) == NULL) 93 if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,
94 (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
91 { 95 {
92 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); 96 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
93 goto err; 97 goto err;
94 } 98 }
95 break; 99 break;
96#endif 100#endif
97#ifndef NO_DSA 101#ifndef OPENSSL_NO_DSA
98 case EVP_PKEY_DSA: 102 case EVP_PKEY_DSA:
99 if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL,pp,length)) == NULL) 103 if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL,
104 (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
100 { 105 {
101 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); 106 ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB);
102 goto err; 107 goto err;
@@ -106,7 +111,7 @@ long length;
106 default: 111 default:
107 ASN1err(ASN1_F_D2I_PUBLICKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE); 112 ASN1err(ASN1_F_D2I_PUBLICKEY,ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE);
108 goto err; 113 goto err;
109 break; 114 /* break; */
110 } 115 }
111 if (a != NULL) (*a)=ret; 116 if (a != NULL) (*a)=ret;
112 return(ret); 117 return(ret);