Skip to content

Commit 4eedf4f

Browse files
author
Philip Kaufmann
committed
make RandAddSeed() use OPENSSL_cleanse()
- removes the cstring include and is also used in RandAddSeedPerfmon()
1 parent 6354935 commit 4eedf4f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/random.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndef WIN32
1414
#include <sys/time.h>
1515
#endif
16-
#include <cstring> // for memset()
1716

1817
#include <openssl/crypto.h>
1918
#include <openssl/err.h>
@@ -37,7 +36,7 @@ void RandAddSeed()
3736
// Seed with CPU performance counter
3837
int64_t nCounter = GetPerformanceCounter();
3938
RAND_add(&nCounter, sizeof(nCounter), 1.5);
40-
memset(&nCounter, 0, sizeof(nCounter));
39+
OPENSSL_cleanse((void*)&nCounter, sizeof(nCounter));
4140
}
4241

4342
void RandAddSeedPerfmon()

0 commit comments

Comments
 (0)