diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2014-06-24 14:41:26 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2014-06-26 11:04:31 +0200 |
commit | cf04d83624e2ca66d094b6026e48bdf86693d7de (patch) | |
tree | 31b319aa81c7a728b04983c4063222528c4ca9f4 /src/util.cpp | |
parent | 343feecf562a39e7d898ece2fd745fcb9d4c90e9 (diff) |
add OpenSSL RAND_cleanup() on OpenSSL shutdown
- to securely erase the memory used by the PNRG
- also rework 2 comments in OpenSSL init
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util.cpp b/src/util.cpp index 7a0e2cc800..5c1ed23b73 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++) |