Make sure that GetRandomBytes never fails

We're using GetRandomBytes in several contexts where it's either
unwieldy to return an error, or an error would mean a fatal exception
anyhow.

@gmaxwell checked OpenSSL a while ago and discovered that it never
actually fails, but it can't hurt to be a bit paranoid here.
This commit is contained in:
Wladimir J. van der Laan
2014-11-07 13:42:52 +01:00
parent 9ea87f9e18
commit 65e3a1e762
3 changed files with 5 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ void RandAddSeedPerfmon();
/**
* Functions to gather random data via the OpenSSL PRNG
*/
bool GetRandBytes(unsigned char* buf, int num);
void GetRandBytes(unsigned char* buf, int num);
uint64_t GetRand(uint64_t nMax);
int GetRandInt(int nMax);
uint256 GetRandHash();