diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2017-11-17 15:00:35 +0100 |
---|---|---|
committer | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2018-01-29 12:42:06 +0100 |
commit | 20928ff635772182fe8696d618a19f9101a5370f (patch) | |
tree | 26305c173b7eddf05cbace4a2f4aa750d930c968 /ssl | |
parent | 1af66bb7241268f96554136387126d280efab75d (diff) |
Add RAND_DRBG_bytes
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/4752)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_lib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index f68031e571..270d4de593 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -5267,9 +5267,11 @@ int ssl_randbytes(SSL *s, unsigned char *rnd, size_t size) * serialization of SSL accesses for the needed concurrency protection * here. */ - return RAND_DRBG_generate(s->drbg, rnd, size, 0, NULL, 0); + return RAND_DRBG_bytes(s->drbg, rnd, size); } - return RAND_bytes(rnd, (int)size); + if (size > INT_MAX) + return 0; + return RAND_bytes(rnd, size); } __owur unsigned int ssl_get_max_send_fragment(const SSL *ssl) |