X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fbase58.h;h=e512908235befd0d523add77db8c9de2bb46f33f;hp=8c0ced78d88b63c7177fbc90f2f92a1889f28c1a;hb=5d2c13255d186d64a8d1feae813085436bf298a5;hpb=9f0fb8008a1bef6b3ef6b6c0bbe0c065376f2dfa diff --git a/src/base58.h b/src/base58.h index 8c0ced7..e512908 100644 --- a/src/base58.h +++ b/src/base58.h @@ -17,6 +17,7 @@ #include #include +#include // for OPENSSL_cleanse() #include "bignum.h" #include "key.h" #include "script.h" @@ -190,7 +191,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 +222,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; }