aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-03-21 14:46:58 +0200
committerRiccardo Spagni <ric@spagni.net>2019-03-21 14:46:58 +0200
commit30e823e7cdaa0a568c8da8ebb83734ab592f5df3 (patch)
treef6853f8821e6f2472b8d7118c7830147692a7636 /src/wallet/wallet2.cpp
parentMerge pull request #5237 (diff)
parentwallet2: do not use invalid keys as fake outs in rings (diff)
downloadmonero-30e823e7cdaa0a568c8da8ebb83734ab592f5df3.tar.xz
Merge pull request #5248
3f6f90bb wallet2: do not use invalid keys as fake outs in rings (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index edfc72061..5e862df06 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -7060,6 +7060,17 @@ bool wallet2::tx_add_fake_output(std::vector<std::vector<tools::wallet2::get_out
CHECK_AND_ASSERT_MES(!outs.empty(), false, "internal error: outs is empty");
if (std::find(outs.back().begin(), outs.back().end(), item) != outs.back().end()) // don't add duplicates
return false;
+ // check the keys are valid
+ if (!rct::isInMainSubgroup(rct::pk2rct(output_public_key)))
+ {
+ MWARNING("Key " << output_public_key << " at index " << global_index << " is not in the main subgroup");
+ return false;
+ }
+ if (!rct::isInMainSubgroup(mask))
+ {
+ MWARNING("Commitment " << mask << " at index " << global_index << " is not in the main subgroup");
+ return false;
+ }
// if (is_output_blackballed(output_public_key)) // don't add blackballed outputs
// return false;
outs.back().push_back(item);