aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-09-14 13:04:39 +0200
committerRiccardo Spagni <ric@spagni.net>2018-09-14 13:04:40 +0200
commit7addabce8fc3cb07dbb49629e1024acc157fa258 (patch)
treeb65488aa6fd0e10189032cb8da9043363823401e /src/cryptonote_basic
parentMerge pull request #4329 (diff)
parentcryptonote_format_utils: do not early out on invalid tx pubkeys (diff)
downloadmonero-7addabce8fc3cb07dbb49629e1024acc157fa258.tar.xz
Merge pull request #4330
93e7627d cryptonote_format_utils: do not early out on invalid tx pubkeys (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic')
-rw-r--r--src/cryptonote_basic/cryptonote_format_utils.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp
index 7ea4718d2..5fcfa33f6 100644
--- a/src/cryptonote_basic/cryptonote_format_utils.cpp
+++ b/src/cryptonote_basic/cryptonote_format_utils.cpp
@@ -219,15 +219,25 @@ namespace cryptonote
{
crypto::key_derivation recv_derivation = AUTO_VAL_INIT(recv_derivation);
bool r = hwdev.generate_key_derivation(tx_public_key, ack.m_view_secret_key, recv_derivation);
- CHECK_AND_ASSERT_MES(r, false, "key image helper: failed to generate_key_derivation(" << tx_public_key << ", " << ack.m_view_secret_key << ")");
+ if (!r)
+ {
+ MWARNING("key image helper: failed to generate_key_derivation(" << tx_public_key << ", " << ack.m_view_secret_key << ")");
+ memcpy(&recv_derivation, rct::identity().bytes, sizeof(recv_derivation));
+ }
std::vector<crypto::key_derivation> additional_recv_derivations;
for (size_t i = 0; i < additional_tx_public_keys.size(); ++i)
{
crypto::key_derivation additional_recv_derivation = AUTO_VAL_INIT(additional_recv_derivation);
r = hwdev.generate_key_derivation(additional_tx_public_keys[i], ack.m_view_secret_key, additional_recv_derivation);
- CHECK_AND_ASSERT_MES(r, false, "key image helper: failed to generate_key_derivation(" << additional_tx_public_keys[i] << ", " << ack.m_view_secret_key << ")");
- additional_recv_derivations.push_back(additional_recv_derivation);
+ if (!r)
+ {
+ MWARNING("key image helper: failed to generate_key_derivation(" << additional_tx_public_keys[i] << ", " << ack.m_view_secret_key << ")");
+ }
+ else
+ {
+ additional_recv_derivations.push_back(additional_recv_derivation);
+ }
}
boost::optional<subaddress_receive_info> subaddr_recv_info = is_out_to_acc_precomp(subaddresses, out_key, recv_derivation, additional_recv_derivations, real_output_index,hwdev);