diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-12-16 23:24:16 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-12-16 23:24:16 +0200 |
commit | 87158dca689eacb4dfdd54099b6aa21ca694248b (patch) | |
tree | 27b05c9fb71bd43e09433f45e54c10eff3dc7c76 | |
parent | Merge pull request #2860 (diff) | |
parent | catch wallet decrypt false positive (diff) | |
download | monero-87158dca689eacb4dfdd54099b6aa21ca694248b.tar.xz |
Merge pull request #2885
a1e3670b catch wallet decrypt false positive (Riccardo Spagni)
-rw-r--r-- | src/wallet/wallet2.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index fba1ef534..59e759bfc 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2302,7 +2302,7 @@ bool wallet2::load_keys(const std::string& keys_file_name, const epee::wipeable_ m_confirm_backlog = true; m_confirm_backlog_threshold = 0; } - else + else if(json.IsObject()) { if (!json.HasMember("key_data")) { @@ -2381,6 +2381,11 @@ bool wallet2::load_keys(const std::string& keys_file_name, const epee::wipeable_ // Wallet is being opened without testnet flag but is saved as a testnet wallet. THROW_WALLET_EXCEPTION_IF(!m_testnet && field_testnet, error::wallet_internal_error, "Testnet wallet can not be opened as mainnet wallet"); } + else + { + THROW_WALLET_EXCEPTION(error::wallet_internal_error, "invalid password"); + return false; + } const cryptonote::account_keys& keys = m_account.get_keys(); r = epee::serialization::load_t_from_binary(m_account, account_data); |