diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2017-11-03 20:59:16 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2018-04-02 22:22:43 +0200 |
commit | 4cffafe96786558f66e1900ac462f9ccba921132 (patch) | |
tree | f075edeb812b1ed574e6656a7f1bd312dbe5e02e /crypto/bio | |
parent | 1238caa725a1dfb5f9d7ef3ba3b014d2af4cab60 (diff) |
Use the private RNG for data that is not public
Reviewed-by: Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Fixes: #4641
GH: #4665
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bf_nbio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c index c41b5d58dc..1acb717743 100644 --- a/crypto/bio/bf_nbio.c +++ b/crypto/bio/bf_nbio.c @@ -89,7 +89,7 @@ static int nbiof_read(BIO *b, char *out, int outl) return 0; BIO_clear_retry_flags(b); - if (RAND_bytes(&n, 1) <= 0) + if (RAND_priv_bytes(&n, 1) <= 0) return -1; num = (n & 0x07); @@ -126,7 +126,7 @@ static int nbiof_write(BIO *b, const char *in, int inl) num = nt->lwn; nt->lwn = 0; } else { - if (RAND_bytes(&n, 1) <= 0) + if (RAND_priv_bytes(&n, 1) <= 0) return -1; num = (n & 7); } |