aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2014-07-07 10:32:24 +0200
committerWladimir J. van der Laan <[email protected]>2014-07-07 10:35:26 +0200
commit1132cdbff353838bd0f005dd6bf3967439afe8ed (patch)
treeb7274b95ce68004b8acf0f4a3273addff9acb8fd /src/util.cpp
parentMerge pull request #4399 (diff)
parentadd OpenSSL RAND_cleanup() on OpenSSL shutdown (diff)
downloaddiscoin-1132cdbff353838bd0f005dd6bf3967439afe8ed.tar.xz
discoin-1132cdbff353838bd0f005dd6bf3967439afe8ed.zip
Merge pull request #4401
cf04d83 add OpenSSL RAND_cleanup() on OpenSSL shutdown (Philip Kaufmann)
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 9adbbdec4..91ac8833d 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -121,15 +121,17 @@ public:
CRYPTO_set_locking_callback(locking_callback);
#ifdef WIN32
- // Seed random number generator with screen scrape and other hardware sources
+ // Seed OpenSSL PRNG with current contents of the screen
RAND_screen();
#endif
- // Seed random number generator with performance counter
+ // Seed OpenSSL PRNG with performance counter
RandAddSeed();
}
~CInit()
{
+ // Securely erase the memory used by the PRNG
+ RAND_cleanup();
// Shutdown OpenSSL library multithreading support
CRYPTO_set_locking_callback(NULL);
for (int i = 0; i < CRYPTO_num_locks(); i++)