aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/cryptonote_format_utils.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-16 23:19:27 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-16 23:19:27 +0200
commit6c0953b15a27a49403c6ec2a48c1b0dcefa1eda5 (patch)
tree90c341b746beeb252953081f75bef7f315704068 /src/cryptonote_basic/cryptonote_format_utils.cpp
parentce951ef560da63c813c5ea67338d512dc925eb4e (diff)
parent3dffe71b72c3b5dd1246ed74ee4cd1ad89aaccfa (diff)
downloadmonzero-core-6c0953b15a27a49403c6ec2a48c1b0dcefa1eda5.tar.gz
monzero-core-6c0953b15a27a49403c6ec2a48c1b0dcefa1eda5.tar.xz
monzero-core-6c0953b15a27a49403c6ec2a48c1b0dcefa1eda5.zip
Merge pull request #2860
3dffe71b new wipeable_string class to replace std::string passphrases (moneromooo-monero) 7a2a5741 utils: initialize easylogging++ in on_startup (moneromooo-monero) 54950829 use memwipe in a few relevant places (moneromooo-monero) 000666ff add a memwipe function (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic/cryptonote_format_utils.cpp')
-rw-r--r--src/cryptonote_basic/cryptonote_format_utils.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp
index 3c760493f..6759f1826 100644
--- a/src/cryptonote_basic/cryptonote_format_utils.cpp
+++ b/src/cryptonote_basic/cryptonote_format_utils.cpp
@@ -32,6 +32,7 @@
using namespace epee;
#include <atomic>
+#include "wipeable_string.h"
#include "cryptonote_format_utils.h"
#include "cryptonote_config.h"
#include "crypto/crypto.h"
@@ -994,7 +995,7 @@ namespace cryptonote
block_hashes_cached = block_hashes_cached_count;
}
//---------------------------------------------------------------
- crypto::secret_key encrypt_key(crypto::secret_key key, const std::string &passphrase)
+ crypto::secret_key encrypt_key(crypto::secret_key key, const epee::wipeable_string &passphrase)
{
crypto::hash hash;
crypto::cn_slow_hash(passphrase.data(), passphrase.size(), hash);
@@ -1002,7 +1003,7 @@ namespace cryptonote
return key;
}
//---------------------------------------------------------------
- crypto::secret_key decrypt_key(crypto::secret_key key, const std::string &passphrase)
+ crypto::secret_key decrypt_key(crypto::secret_key key, const epee::wipeable_string &passphrase)
{
crypto::hash hash;
crypto::cn_slow_hash(passphrase.data(), passphrase.size(), hash);