summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/pem/pem_info.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/pem/pem_info.c')
-rw-r--r--crypto/openssl/crypto/pem/pem_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/openssl/crypto/pem/pem_info.c b/crypto/openssl/crypto/pem/pem_info.c
index f1694f1..ef02599 100644
--- a/crypto/openssl/crypto/pem/pem_info.c
+++ b/crypto/openssl/crypto/pem/pem_info.c
@@ -326,7 +326,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
/* create the right magic header stuff */
buf[0]='\0';
PEM_proc_type(buf,PEM_TYPE_ENCRYPTED);
- PEM_dek_info(buf,objstr,8,(char *)iv);
+ PEM_dek_info(buf,objstr,enc->iv_len,(char *)iv);
/* use the normal code to write things out */
i=PEM_write_bio(bp,PEM_STRING_RSA,buf,data,i);
@@ -346,7 +346,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
}
/* if we have a certificate then write it out now */
- if ((xi->x509 != NULL) || (PEM_write_bio_X509(bp,xi->x509) <= 0))
+ if ((xi->x509 != NULL) && (PEM_write_bio_X509(bp,xi->x509) <= 0))
goto err;
/* we are ignoring anything else that is loaded into the X509_INFO
OpenPOWER on IntegriCloud