diff options
author | Alon Bar-Lev <[email protected]> | 2016-12-01 21:55:17 +0200 |
---|---|---|
committer | Alon Bar-Lev <[email protected]> | 2016-12-01 22:06:45 +0200 |
commit | 620f0807f1acfe241760bdd0152a7597641364de (patch) | |
tree | 93b620d01135dd5452ef6e6d4d19b95d54ee6ce5 /src | |
parent | f85cbb9fe7896dd078da539e4b5f1553be10bebc (diff) |
system_rng: workaround read only urandom
botan_rng_reseed: System_RNG write failed error 9
FFI ran 252 tests 1 FAILED
Failure 1: FFI botan_rng_reseed unexpectedly failed with error code -1
Signed-off-by: Alon Bar-Lev <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/rng/system_rng/system_rng.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp index eaba38241..12b087661 100644 --- a/src/lib/rng/system_rng/system_rng.cpp +++ b/src/lib/rng/system_rng/system_rng.cpp @@ -135,8 +135,11 @@ void System_RNG_Impl::add_entropy(const uint8_t input[], size_t len) * by the OS or sysadmin that additional entropy is not wanted * in the system pool, so we accept that and return here, * since there is no corrective action possible. + * + * In Linux EBADF or EPERM is returned if m_fd is not opened for + * writing. */ - if(errno == EPERM) + if(errno == EPERM || errno == EBADF) return; // maybe just ignore any failure here and return? |