From efca5b8af903b98d80285a284e4024c90db929e2 Mon Sep 17 00:00:00 2001 From: Crypto City Date: Sat, 14 Nov 2020 03:27:45 +0000 Subject: wallet2: check imported multisig curve points are in main subgroup --- src/wallet/wallet2.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/wallet') diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 7cbb4a910..65411e392 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -13381,6 +13381,20 @@ size_t wallet2::import_multisig(std::vector blobs) loaded = true; } CHECK_AND_ASSERT_THROW_MES(loaded, "Failed to load output data"); + + for (const auto &e: i) + { + for (const auto &lr: e.m_LR) + { + CHECK_AND_ASSERT_THROW_MES(rct::isInMainSubgroup(lr.m_L), "Multisig value is not in the main subgroup"); + CHECK_AND_ASSERT_THROW_MES(rct::isInMainSubgroup(lr.m_R), "Multisig value is not in the main subgroup"); + } + for (const auto &ki: e.m_partial_key_images) + { + CHECK_AND_ASSERT_THROW_MES(rct::isInMainSubgroup(rct::ki2rct(ki)), "Multisig partial key image is not in the main subgroup"); + } + } + MINFO(boost::format("%u outputs found") % boost::lexical_cast(i.size())); info.push_back(std::move(i)); } -- cgit v1.2.3