Skip to content

Commit 1132cdb

Browse files
committed
Merge pull request #4401
cf04d83 add OpenSSL RAND_cleanup() on OpenSSL shutdown (Philip Kaufmann)
2 parents 642c8e7 + cf04d83 commit 1132cdb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/util.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,17 @@ class CInit
121121
CRYPTO_set_locking_callback(locking_callback);
122122

123123
#ifdef WIN32
124-
// Seed random number generator with screen scrape and other hardware sources
124+
// Seed OpenSSL PRNG with current contents of the screen
125125
RAND_screen();
126126
#endif
127127

128-
// Seed random number generator with performance counter
128+
// Seed OpenSSL PRNG with performance counter
129129
RandAddSeed();
130130
}
131131
~CInit()
132132
{
133+
// Securely erase the memory used by the PRNG
134+
RAND_cleanup();
133135
// Shutdown OpenSSL library multithreading support
134136
CRYPTO_set_locking_callback(NULL);
135137
for (int i = 0; i < CRYPTO_num_locks(); i++)

0 commit comments

Comments
 (0)