fc7474aac307dac6af0877edbdc026d9b451c90c |
|
27-Jun-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: rand - force reseeding with known seed from environment
Use DOVECOT_SRAND=12345 as an environmental variable to force seeding
to that number.
The logic behind the logging is that the subsequent calls will almost
certainly be from random_fill_weak() which expects to have been seeded
from a CSPRNG - not a constant! Having this environmental variable set
in a production system that expects CSPRNG seeding should be flagging
diagnostics.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |
1b139ee4de2833fbf0d51ee6f19eb4515d4e8942 |
|
27-Jun-2014 |
Phil Carmody <phil@dovecot.fi> |
lib: add rand helper library
Initially, just wrap srand() so that we can find out what the last-used
seed was. In situations where srand() is called only once (via this helper)
this lets us reproduce exactly the same stream of random data again in
order to reproduce rare crashes.
Signed-off-by: Phil Carmody <phil@dovecot.fi> |