sanity: Move OS random to sanity check function

Move the OS random test to a sanity check function that is called every
time bitcoind is initialized.

Keep `src/test/random_tests.cpp` for the case that later random tests
are added, and keep a rudimentary test that just calls the sanity check.
This commit is contained in:
Wladimir J. van der Laan
2017-02-22 08:02:50 +01:00
parent aa09ccbb74
commit 7cad849299
4 changed files with 42 additions and 28 deletions

View File

@@ -687,9 +687,15 @@ bool InitSanityCheck(void)
InitError("Elliptic curve cryptography sanity check failure. Aborting.");
return false;
}
if (!glibc_sanity_test() || !glibcxx_sanity_test())
return false;
if (!Random_SanityCheck()) {
InitError("OS cryptographic RNG sanity check failure. Aborting.");
return false;
}
return true;
}