- Fix seed for random backup code to use explicit zero when wiped.

git-svn-id: file:///svn/unbound/trunk@4895 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2018-09-13 07:49:51 +00:00
parent 87c8dd5434
commit 225a6d9c6e
2 changed files with 5 additions and 2 deletions

View file

@ -1671,14 +1671,14 @@ worker_create(struct daemon* daemon, int id, int* ports, int n)
(((unsigned int)worker->thread_num)<<17); (((unsigned int)worker->thread_num)<<17);
/* shift thread_num so it does not match out pid bits */ /* shift thread_num so it does not match out pid bits */
if(!(worker->rndstate = ub_initstate(seed, daemon->rand))) { if(!(worker->rndstate = ub_initstate(seed, daemon->rand))) {
seed = 0; explicit_bzero(&seed, sizeof(seed));
log_err("could not init random numbers."); log_err("could not init random numbers.");
tube_delete(worker->cmd); tube_delete(worker->cmd);
free(worker->ports); free(worker->ports);
free(worker); free(worker);
return NULL; return NULL;
} }
seed = 0; explicit_bzero(&seed, sizeof(seed));
#ifdef USE_DNSTAP #ifdef USE_DNSTAP
if(daemon->cfg->dnstap) { if(daemon->cfg->dnstap) {
log_assert(daemon->dtenv != NULL); log_assert(daemon->dtenv != NULL);

View file

@ -1,3 +1,6 @@
13 September 2018: Wouter
- Fix seed for random backup code to use explicit zero when wiped.
11 September 2018: Wouter 11 September 2018: Wouter
- Fixed unused return value warnings in contrib/fastrpz.patch for - Fixed unused return value warnings in contrib/fastrpz.patch for
asprintf. asprintf.