From f94707eb8cfd15600d95f852f12517b80f9eea0b Mon Sep 17 00:00:00 2001 From: SergiySW Date: Tue, 11 Sep 2018 19:59:12 +0300 Subject: [PATCH] Check for invalid private keys in wallet_decrypt_unsafe (#1128) --- rai/node/cli.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rai/node/cli.cpp b/rai/node/cli.cpp index 783c0ca2..59ddeb83 100644 --- a/rai/node/cli.cpp +++ b/rai/node/cli.cpp @@ -453,6 +453,10 @@ std::error_code rai::handle_node_options (boost::program_options::variables_map auto error (existing->second->store.fetch (transaction, account, key)); assert (!error); std::cout << boost::str (boost::format ("Pub: %1% Prv: %2%\n") % account.to_account () % key.data.to_string ()); + if (rai::pub_key (key.data) != account) + { + std::cerr << boost::str (boost::format ("Invalid private key %1%\n") % key.data.to_string ()); + } } } else