diff options
Diffstat (limited to 'crypto/openssl/crypto/pem/pem_info.c')
-rw-r--r-- | crypto/openssl/crypto/pem/pem_info.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/openssl/crypto/pem/pem_info.c b/crypto/openssl/crypto/pem/pem_info.c index ef02599..9e4af29 100644 --- a/crypto/openssl/crypto/pem/pem_info.c +++ b/crypto/openssl/crypto/pem/pem_info.c @@ -64,7 +64,7 @@ #include <openssl/x509.h> #include <openssl/pem.h> -#ifndef NO_FP_API +#ifndef OPENSSL_NO_FP_API STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u) { BIO *b; @@ -111,7 +111,7 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pe i=PEM_read_bio(bp,&name,&header,&data,&len); if (i == 0) { - error=ERR_GET_REASON(ERR_peek_error()); + error=ERR_GET_REASON(ERR_peek_last_error()); if (error == PEM_R_NO_START_LINE) { ERR_clear_error(); @@ -155,7 +155,7 @@ start: pp=(char **)&(xi->crl); } else -#ifndef NO_RSA +#ifndef OPENSSL_NO_RSA if (strcmp(name,PEM_STRING_RSA) == 0) { d2i=(char *(*)())d2i_RSAPrivateKey; @@ -179,7 +179,7 @@ start: } else #endif -#ifndef NO_DSA +#ifndef OPENSSL_NO_DSA if (strcmp(name,PEM_STRING_DSA) == 0) { d2i=(char *(*)())d2i_DSAPrivateKey; @@ -324,6 +324,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, } /* create the right magic header stuff */ + OPENSSL_assert(strlen(objstr)+23+2*enc->iv_len+13 <= sizeof buf); buf[0]='\0'; PEM_proc_type(buf,PEM_TYPE_ENCRYPTED); PEM_dek_info(buf,objstr,enc->iv_len,(char *)iv); @@ -335,7 +336,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, else { /* Add DSA/DH */ -#ifndef NO_RSA +#ifndef OPENSSL_NO_RSA /* normal optionally encrypted stuff */ if (PEM_write_bio_RSAPrivateKey(bp, xi->x_pkey->dec_pkey->pkey.rsa, @@ -358,7 +359,7 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, ret=1; err: - memset((char *)&ctx,0,sizeof(ctx)); - memset(buf,0,PEM_BUFSIZE); + OPENSSL_cleanse((char *)&ctx,sizeof(ctx)); + OPENSSL_cleanse(buf,PEM_BUFSIZE); return(ret); } |