提交 a2e623c0 编写于 作者: D Dr. Stephen Henson

Update from 0.9.7-stable.

上级 aa79dd68
...@@ -1524,6 +1524,10 @@ ...@@ -1524,6 +1524,10 @@
Changes between 0.9.7l and 0.9.7m [xx XXX xxxx] Changes between 0.9.7l and 0.9.7m [xx XXX xxxx]
*) Cleanse PEM buffers before freeing them since they may contain
sensitive data.
[Benjamin Bennett <ben@psc.edu>]
*) Include "!eNULL" in SSL_DEFAULT_CIPHER_LIST to make sure that *) Include "!eNULL" in SSL_DEFAULT_CIPHER_LIST to make sure that
a ciphersuite string such as "DEFAULT:RSA" cannot enable a ciphersuite string such as "DEFAULT:RSA" cannot enable
authentication-only ciphersuites. authentication-only ciphersuites.
......
...@@ -619,6 +619,7 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data, ...@@ -619,6 +619,7 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
} }
EVP_EncodeFinal(&ctx,buf,&outl); EVP_EncodeFinal(&ctx,buf,&outl);
if ((outl > 0) && (BIO_write(bp,(char *)buf,outl) != outl)) goto err; if ((outl > 0) && (BIO_write(bp,(char *)buf,outl) != outl)) goto err;
OPENSSL_cleanse(buf, PEM_BUFSIZE*8);
OPENSSL_free(buf); OPENSSL_free(buf);
buf = NULL; buf = NULL;
if ( (BIO_write(bp,"-----END ",9) != 9) || if ( (BIO_write(bp,"-----END ",9) != 9) ||
...@@ -627,8 +628,10 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data, ...@@ -627,8 +628,10 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
goto err; goto err;
return(i+outl); return(i+outl);
err: err:
if (buf) if (buf) {
OPENSSL_cleanse(buf, PEM_BUFSIZE*8);
OPENSSL_free(buf); OPENSSL_free(buf);
}
PEMerr(PEM_F_PEM_WRITE_BIO,reason); PEMerr(PEM_F_PEM_WRITE_BIO,reason);
return(0); return(0);
} }
......
...@@ -132,6 +132,7 @@ p8err: ...@@ -132,6 +132,7 @@ p8err:
PEMerr(PEM_F_PEM_READ_BIO_PRIVATEKEY,ERR_R_ASN1_LIB); PEMerr(PEM_F_PEM_READ_BIO_PRIVATEKEY,ERR_R_ASN1_LIB);
err: err:
OPENSSL_free(nm); OPENSSL_free(nm);
OPENSSL_cleanse(data, len);
OPENSSL_free(data); OPENSSL_free(data);
return(ret); return(ret);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册