tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: question about /src/sys/kern/subr_cprng.c 1.15

On 25 March 2013 13:32, Joachim Kuebart <> 
> just read about this on the news and have a question about
> abovementioned diff: in the call to cprng_entropy_try from
> cprng_strong_create, shouldn't the parameter 'hard' be false unless
> CPRNG_INIT_ANY is specified? The original code as well as the call
> from cprng_strong would suggest that RNG_EXTRACT_ANY is only to be
> used when the corresponding _ANY flag is present.

d'oh, managed to confuse myself -- what I wrote is what the code
currently does, but I think 'hard' should be *true* unless
CPRNG_INIT_ANY is specified, i.e.

- r = cprng_entropy_try(key, sizeof(key), c->flags & CPRNG_INIT_ANY);
+ r = cprng_entropy_try(key, sizeof(key), !(c->flags & CPRNG_INIT_ANY));


Home | Main Index | Thread Index | Old Index