summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_sess.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-08-03 10:24:03 -0400
committerRich Salz <rsalz@openssl.org>2017-08-03 10:24:03 -0400
commitae3947de09522206d61c0206a733517b10a910f8 (patch)
tree7044411af55af40f9f5f5adad685ccc70d155998 /ssl/ssl_sess.c
parent75e2c877650444fb829547bdb58d46eb1297bc1a (diff)
Add a DRBG to each SSL object
Give each SSL object it's own DRBG, chained to the parent global DRBG which is used only as a source of randomness into the per-SSL DRBG. This is used for all session, ticket, and pre-master secret keys. It is NOT used for ECDH key generation which use only the global DRBG. (Doing that without changing the API is tricky, if not impossible.) Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4050)
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r--ssl/ssl_sess.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 805a3d75f4..8cd4355cc6 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -277,12 +277,12 @@ unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s)
*/
#define MAX_SESS_ID_ATTEMPTS 10
-static int def_generate_session_id(const SSL *ssl, unsigned char *id,
+static int def_generate_session_id(SSL *ssl, unsigned char *id,
unsigned int *id_len)
{
unsigned int retry = 0;
do
- if (RAND_bytes(id, *id_len) <= 0)
+ if (ssl_randbytes(ssl, id, *id_len) <= 0)
return 0;
while (SSL_has_matching_session_id(ssl, id, *id_len) &&
(++retry < MAX_SESS_ID_ATTEMPTS)) ;