summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/d2i_pr.c
diff options
context:
space:
mode:
authorbeck <>2002-05-15 02:29:21 +0000
committerbeck <>2002-05-15 02:29:21 +0000
commitb64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch)
treefa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/asn1/d2i_pr.c
parente471e1ea98d673597b182ea85f29e30c97cd08b5 (diff)
downloadopenbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz
openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2
openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/asn1/d2i_pr.c')
-rw-r--r--src/lib/libcrypto/asn1/d2i_pr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/libcrypto/asn1/d2i_pr.c b/src/lib/libcrypto/asn1/d2i_pr.c
index c92b8325d8..2e7d96af90 100644
--- a/src/lib/libcrypto/asn1/d2i_pr.c
+++ b/src/lib/libcrypto/asn1/d2i_pr.c
@@ -62,6 +62,12 @@
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/asn1.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_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp, 72EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp,
67 long length) 73 long length)
@@ -82,18 +88,20 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp,
82 ret->type=EVP_PKEY_type(type); 88 ret->type=EVP_PKEY_type(type);
83 switch (ret->type) 89 switch (ret->type)
84 { 90 {
85#ifndef NO_RSA 91#ifndef OPENSSL_NO_RSA
86 case EVP_PKEY_RSA: 92 case EVP_PKEY_RSA:
87 if ((ret->pkey.rsa=d2i_RSAPrivateKey(NULL,pp,length)) == NULL) 93 if ((ret->pkey.rsa=d2i_RSAPrivateKey(NULL,
94 (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
88 { 95 {
89 ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB); 96 ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB);
90 goto err; 97 goto err;
91 } 98 }
92 break; 99 break;
93#endif 100#endif
94#ifndef NO_DSA 101#ifndef OPENSSL_NO_DSA
95 case EVP_PKEY_DSA: 102 case EVP_PKEY_DSA:
96 if ((ret->pkey.dsa=d2i_DSAPrivateKey(NULL,pp,length)) == NULL) 103 if ((ret->pkey.dsa=d2i_DSAPrivateKey(NULL,
104 (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */
97 { 105 {
98 ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB); 106 ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB);
99 goto err; 107 goto err;