diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2018-03-07 19:25:55 +0100 |
---|---|---|
committer | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2018-03-19 15:04:40 +0100 |
commit | 7caf122e717e79afcb986fe217e77a630b67bf4c (patch) | |
tree | 5ced62615263082ab998c18c860b44c9b442ca39 /crypto/include | |
parent | 4e6647506331fc3b3ef5b23e5dbe188279ddd575 (diff) |
Make the public and private DRBG thread local
This avoids lock contention.
Reviewed-by: Tim Hudson <tjh@openssl.org>
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/5547)
Diffstat (limited to 'crypto/include')
-rw-r--r-- | crypto/include/internal/cryptlib_int.h | 2 | ||||
-rw-r--r-- | crypto/include/internal/rand_int.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/crypto/include/internal/cryptlib_int.h b/crypto/include/internal/cryptlib_int.h index 3dddf08200..633551762b 100644 --- a/crypto/include/internal/cryptlib_int.h +++ b/crypto/include/internal/cryptlib_int.h @@ -14,6 +14,7 @@ struct thread_local_inits_st { int async; int err_state; + int rand; }; int ossl_init_thread_start(uint64_t opts); @@ -28,5 +29,6 @@ int ossl_init_thread_start(uint64_t opts); /* OPENSSL_INIT_THREAD flags */ # define OPENSSL_INIT_THREAD_ASYNC 0x01 # define OPENSSL_INIT_THREAD_ERR_STATE 0x02 +# define OPENSSL_INIT_THREAD_RAND 0x04 void ossl_malloc_setup_failures(void); diff --git a/crypto/include/internal/rand_int.h b/crypto/include/internal/rand_int.h index 27ca703fcf..5db2425e10 100644 --- a/crypto/include/internal/rand_int.h +++ b/crypto/include/internal/rand_int.h @@ -25,6 +25,7 @@ typedef struct rand_pool_st RAND_POOL; void rand_cleanup_int(void); void rand_drbg_cleanup_int(void); +void drbg_delete_thread_state(void); void rand_fork(void); /* Hardware-based seeding functions. */ |