aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-02-22 08:02:50 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-02-22 08:02:50 +0100
commit7cad84929907c4294f07377453aa77887911b486 (patch)
treea364b2912656b00dac9e397f767d6df1fd91e821 /src/init.cpp
parentaa09ccbb74ea9febd83ce3362238ac5339069909 (diff)
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.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index cf265180ff..6409e92ebc 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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;
}