diff options
author | Matt Caswell <matt@openssl.org> | 2015-02-26 16:28:59 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-25 12:41:28 +0000 |
commit | 8f8e4e4f5253085ab673bb74094c3e492c56af44 (patch) | |
tree | 1fb6e32d1f10e7ca77521df3a25f887bf083f7a8 /crypto/bio | |
parent | a20718fa2c0a45e6acb975cf6c0438c3ebd45b13 (diff) |
Fix RAND_(pseudo_)?_bytes returns
Ensure all calls to RAND_bytes and RAND_pseudo_bytes have their return
value checked correctly
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bf_nbio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c index da88a8a1bf..44d1029f28 100644 --- a/crypto/bio/bf_nbio.c +++ b/crypto/bio/bf_nbio.c @@ -139,7 +139,8 @@ static int nbiof_read(BIO *b, char *out, int outl) BIO_clear_retry_flags(b); #if 1 - RAND_pseudo_bytes(&n, 1); + if(RAND_pseudo_bytes(&n, 1) < 0) + return -1; num = (n & 0x07); if (outl > num) @@ -178,7 +179,8 @@ static int nbiof_write(BIO *b, const char *in, int inl) num = nt->lwn; nt->lwn = 0; } else { - RAND_pseudo_bytes(&n, 1); + if(RAND_pseudo_bytes(&n, 1) < 0) + return -1; num = (n & 7); } |