aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/des
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/des
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/des')
-rw-r--r--crypto/des/enc_writ.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/des/enc_writ.c b/crypto/des/enc_writ.c
index b4eecc3812..55cc7fcb41 100644
--- a/crypto/des/enc_writ.c
+++ b/crypto/des/enc_writ.c
@@ -132,7 +132,8 @@ int DES_enc_write(int fd, const void *_buf, int len,
if (len < 8) {
cp = shortbuf;
memcpy(shortbuf, buf, len);
- RAND_pseudo_bytes(shortbuf + len, 8 - len);
+ if (RAND_bytes(shortbuf + len, 8 - len) <= 0)
+ return -1;
rnum = 8;
} else {
cp = buf;