diff options
| author | Philip Kaufmann <[email protected]> | 2014-07-09 09:43:55 +0200 |
|---|---|---|
| committer | Philip Kaufmann <[email protected]> | 2014-07-09 09:43:55 +0200 |
| commit | 4eedf4ffeea6a3734f245f785a8d82d69634dccd (patch) | |
| tree | 0d603cac2ef5d06f54ba315932a1f4d67853f11a /src/random.cpp | |
| parent | move rand functions from util to new random.h/.cpp (diff) | |
| download | discoin-4eedf4ffeea6a3734f245f785a8d82d69634dccd.tar.xz discoin-4eedf4ffeea6a3734f245f785a8d82d69634dccd.zip | |
make RandAddSeed() use OPENSSL_cleanse()
- removes the cstring include and is also used in RandAddSeedPerfmon()
Diffstat (limited to 'src/random.cpp')
| -rw-r--r-- | src/random.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/random.cpp b/src/random.cpp index 4c7f150f7..0d20d205a 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -13,7 +13,6 @@ #ifndef WIN32 #include <sys/time.h> #endif -#include <cstring> // for memset() #include <openssl/crypto.h> #include <openssl/err.h> @@ -37,7 +36,7 @@ void RandAddSeed() // Seed with CPU performance counter int64_t nCounter = GetPerformanceCounter(); RAND_add(&nCounter, sizeof(nCounter), 1.5); - memset(&nCounter, 0, sizeof(nCounter)); + OPENSSL_cleanse((void*)&nCounter, sizeof(nCounter)); } void RandAddSeedPerfmon() |