aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2018-08-16 22:08:58 +0900
committerstoffu <stoffu@protonmail.ch>2018-08-16 22:26:30 +0900
commit1f2409e9e2c15e1b96c2bcb3d7bfd77091b2a504 (patch)
treeca3263416292ee39c8e1b236ac554b317c209c94 /src/wallet/wallet2.cpp
parentMerge pull request #4191 (diff)
downloadmonero-1f2409e9e2c15e1b96c2bcb3d7bfd77091b2a504.tar.xz
Do memwipe for critical secret keys copied to rct::key
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 9deaad09b..6b6e9865f 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -3217,6 +3217,7 @@ void wallet2::generate(const std::string& wallet_, const epee::wipeable_string&
for (const auto &msk: multisig_keys)
sc_add(skey.bytes, skey.bytes, rct::sk2rct(msk).bytes);
THROW_WALLET_EXCEPTION_IF(!(rct::rct2sk(skey) == spend_secret_key), error::invalid_multisig_seed);
+ memwipe(&skey, sizeof(rct::key));
m_account.make_multisig(view_secret_key, spend_secret_key, spend_public_key, multisig_keys);
m_account.finalize_multisig(spend_public_key);
@@ -3563,6 +3564,7 @@ std::string wallet2::make_multisig(const epee::wipeable_string &password,
MINFO("Creating multisig address...");
CHECK_AND_ASSERT_THROW_MES(m_account.make_multisig(view_skey, rct::rct2sk(spend_skey), rct::rct2pk(spend_pkey), multisig_keys),
"Failed to create multisig wallet due to bad keys");
+ memwipe(&spend_skey, sizeof(rct::key));
m_account_public_address = m_account.get_keys().m_account_address;
m_watch_only = false;