aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/asn_mime.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-02-26 11:57:37 +0000
committerMatt Caswell <matt@openssl.org>2015-03-25 12:38:07 +0000
commit266483d2f56b0764849797f31866bfd84f9c3aa8 (patch)
tree42323d0c8b8cea8da4aff3dfdd4bc2251e34a0db /crypto/asn1/asn_mime.c
parent8817e2e0c998757d3bd036d7f45fe8d0a49fbe2d (diff)
downloadopenssl-266483d2f56b0764849797f31866bfd84f9c3aa8.tar.gz
RAND_bytes updates
Ensure RAND_bytes return value is checked correctly, and that we no longer use RAND_pseudo_bytes. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/asn1/asn_mime.c')
-rw-r--r--crypto/asn1/asn_mime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c
index 28622f2815..e96fb02094 100644
--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -286,7 +286,8 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
if ((flags & SMIME_DETACHED) && data) {
/* We want multipart/signed */
/* Generate a random boundary */
- RAND_pseudo_bytes((unsigned char *)bound, 32);
+ if (RAND_bytes((unsigned char *)bound, 32) <= 0)
+ return 0;
for (i = 0; i < 32; i++) {
c = bound[i] & 0xf;
if (c < 10)