summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pem/pem_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/pem/pem_info.c')
-rw-r--r--src/lib/libcrypto/pem/pem_info.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/pem/pem_info.c b/src/lib/libcrypto/pem/pem_info.c
index f1694f1125..9a6dffb45c 100644
--- a/src/lib/libcrypto/pem/pem_info.c
+++ b/src/lib/libcrypto/pem/pem_info.c
@@ -64,7 +64,7 @@
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65#include <openssl/pem.h> 65#include <openssl/pem.h>
66 66
67#ifndef NO_FP_API 67#ifndef OPENSSL_NO_FP_API
68STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u) 68STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u)
69 { 69 {
70 BIO *b; 70 BIO *b;
@@ -111,7 +111,7 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pe
111 i=PEM_read_bio(bp,&name,&header,&data,&len); 111 i=PEM_read_bio(bp,&name,&header,&data,&len);
112 if (i == 0) 112 if (i == 0)
113 { 113 {
114 error=ERR_GET_REASON(ERR_peek_error()); 114 error=ERR_GET_REASON(ERR_peek_last_error());
115 if (error == PEM_R_NO_START_LINE) 115 if (error == PEM_R_NO_START_LINE)
116 { 116 {
117 ERR_clear_error(); 117 ERR_clear_error();
@@ -155,7 +155,7 @@ start:
155 pp=(char **)&(xi->crl); 155 pp=(char **)&(xi->crl);
156 } 156 }
157 else 157 else
158#ifndef NO_RSA 158#ifndef OPENSSL_NO_RSA
159 if (strcmp(name,PEM_STRING_RSA) == 0) 159 if (strcmp(name,PEM_STRING_RSA) == 0)
160 { 160 {
161 d2i=(char *(*)())d2i_RSAPrivateKey; 161 d2i=(char *(*)())d2i_RSAPrivateKey;
@@ -179,7 +179,7 @@ start:
179 } 179 }
180 else 180 else
181#endif 181#endif
182#ifndef NO_DSA 182#ifndef OPENSSL_NO_DSA
183 if (strcmp(name,PEM_STRING_DSA) == 0) 183 if (strcmp(name,PEM_STRING_DSA) == 0)
184 { 184 {
185 d2i=(char *(*)())d2i_DSAPrivateKey; 185 d2i=(char *(*)())d2i_DSAPrivateKey;
@@ -326,7 +326,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
326 /* create the right magic header stuff */ 326 /* create the right magic header stuff */
327 buf[0]='\0'; 327 buf[0]='\0';
328 PEM_proc_type(buf,PEM_TYPE_ENCRYPTED); 328 PEM_proc_type(buf,PEM_TYPE_ENCRYPTED);
329 PEM_dek_info(buf,objstr,8,(char *)iv); 329 PEM_dek_info(buf,objstr,enc->iv_len,(char *)iv);
330 330
331 /* use the normal code to write things out */ 331 /* use the normal code to write things out */
332 i=PEM_write_bio(bp,PEM_STRING_RSA,buf,data,i); 332 i=PEM_write_bio(bp,PEM_STRING_RSA,buf,data,i);
@@ -335,7 +335,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
335 else 335 else
336 { 336 {
337 /* Add DSA/DH */ 337 /* Add DSA/DH */
338#ifndef NO_RSA 338#ifndef OPENSSL_NO_RSA
339 /* normal optionally encrypted stuff */ 339 /* normal optionally encrypted stuff */
340 if (PEM_write_bio_RSAPrivateKey(bp, 340 if (PEM_write_bio_RSAPrivateKey(bp,
341 xi->x_pkey->dec_pkey->pkey.rsa, 341 xi->x_pkey->dec_pkey->pkey.rsa,
@@ -346,7 +346,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
346 } 346 }
347 347
348 /* if we have a certificate then write it out now */ 348 /* if we have a certificate then write it out now */
349 if ((xi->x509 != NULL) || (PEM_write_bio_X509(bp,xi->x509) <= 0)) 349 if ((xi->x509 != NULL) && (PEM_write_bio_X509(bp,xi->x509) <= 0))
350 goto err; 350 goto err;
351 351
352 /* we are ignoring anything else that is loaded into the X509_INFO 352 /* we are ignoring anything else that is loaded into the X509_INFO