aboutsummaryrefslogtreecommitdiff
path: root/src/base58.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/base58.h')
-rw-r--r--src/base58.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/base58.h b/src/base58.h
index 9dfea86ff5..309d35f5d9 100644
--- a/src/base58.h
+++ b/src/base58.h
@@ -17,6 +17,8 @@
#include <string>
#include <vector>
+#include <openssl/crypto.h> // for OPENSSL_cleanse()
+
#include "bignum.h"
#include "key.h"
#include "script.h"
@@ -190,7 +192,7 @@ protected:
{
// zero the memory, as it may contain sensitive data
if (!vchData.empty())
- memset(&vchData[0], 0, vchData.size());
+ OPENSSL_cleanse(&vchData[0], vchData.size());
}
void SetData(int nVersionIn, const void* pdata, size_t nSize)
@@ -221,7 +223,7 @@ public:
vchData.resize(vchTemp.size() - 1);
if (!vchData.empty())
memcpy(&vchData[0], &vchTemp[1], vchData.size());
- memset(&vchTemp[0], 0, vchTemp.size());
+ OPENSSL_cleanse(&vchTemp[0], vchData.size());
return true;
}