Skip to content

Commit cf04d83

Browse files
author
Philip Kaufmann
committed
add OpenSSL RAND_cleanup() on OpenSSL shutdown
- to securely erase the memory used by the PNRG - also rework 2 comments in OpenSSL init
1 parent 343feec commit cf04d83

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)