add GetRandBytes() as wrapper for RAND_bytes()

- add a small wrapper in util around RAND_bytes() and replace with
  GetRandBytes() in the code to log errors from calling RAND_bytes()
- remove OpenSSL header rand.h where no longer needed
This commit is contained in:
Philip Kaufmann
2014-06-24 14:27:32 +02:00
parent 2ee918d121
commit 001a53d742
8 changed files with 31 additions and 30 deletions

View File

@@ -16,8 +16,6 @@
#include <stdint.h>
#include <vector>
#include <openssl/rand.h>
/** Extended statistics about a CAddress */
class CAddrInfo : public CAddress
{
@@ -384,7 +382,7 @@ public:
CAddrMan() : vRandom(0), vvTried(ADDRMAN_TRIED_BUCKET_COUNT, std::vector<int>(0)), vvNew(ADDRMAN_NEW_BUCKET_COUNT, std::set<int>())
{
nKey.resize(32);
RAND_bytes(&nKey[0], 32);
GetRandBytes(&nKey[0], 32);
nIdCount = 0;
nTried = 0;