aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-04 11:07:32 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-04 11:07:32 +0200
commita1e3670b33c2671f5b6f233c8373fc529ffb96f2 (patch)
tree527a87a14ea681b0f554e7ea0c86ac6a66928d96
parentMerge pull request #2845 (diff)
downloadmonero-a1e3670b33c2671f5b6f233c8373fc529ffb96f2.tar.xz
catch wallet decrypt false positive
-rw-r--r--src/wallet/wallet2.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 181bb1852..3333ee2d4 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -2289,7 +2289,7 @@ bool wallet2::load_keys(const std::string& keys_file_name, const std::string& pa
m_confirm_backlog = true;
m_confirm_backlog_threshold = 0;
}
- else
+ else if(json.IsObject())
{
if (!json.HasMember("key_data"))
{
@@ -2368,6 +2368,11 @@ bool wallet2::load_keys(const std::string& keys_file_name, const std::string& pa
// 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);