diff options
author | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2017-11-24 14:59:58 +0100 |
---|---|---|
committer | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2017-12-17 23:12:10 +0100 |
commit | a93ba405b0327db9106f8f224112a2b64fb264e7 (patch) | |
tree | d7185e4703fa29127c97315150cc0e3b18a5c8f3 /include | |
parent | 56d362881eb9173d74f89aa8c4c4b42bc3397a17 (diff) |
Add master DRBG for reseeding
A third shared DRBG is added, the so called master DRBG. Its sole purpose
is to reseed the two other shared DRBGs, the public and the private DRBG.
The randomness for the master DRBG is either pulled from the os entropy
sources, or added by the application using the RAND_add() call.
The master DRBG reseeds itself automatically after a given number of generate
requests, but can also be reseeded using RAND_seed() or RAND_add().
A reseeding of the master DRBG is automatically propagated to the public
and private DRBG. This construction fixes the problem, that up to now
the randomness provided by RAND_add() was added only to the public and
not to the private DRBG.
Signed-off-by: Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/4402)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/rand.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/internal/rand.h b/include/internal/rand.h index feda9beaa1..26d6c38f45 100644 --- a/include/internal/rand.h +++ b/include/internal/rand.h @@ -42,9 +42,11 @@ int RAND_DRBG_reseed(RAND_DRBG *drbg, int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen, int prediction_resistance, const unsigned char *adin, size_t adinlen); -int RAND_DRBG_set_reseed_interval(RAND_DRBG *drbg, int interval); -RAND_DRBG *RAND_DRBG_get0_global(void); -RAND_DRBG *RAND_DRBG_get0_priv_global(void); +int RAND_DRBG_set_reseed_interval(RAND_DRBG *drbg, unsigned int interval); + +RAND_DRBG *RAND_DRBG_get0_master(void); +RAND_DRBG *RAND_DRBG_get0_public(void); +RAND_DRBG *RAND_DRBG_get0_private(void); /* * EXDATA |