mirror of
https://github.com/monero-project/monero.git
synced 2025-08-06 07:44:18 -04:00
Merge pull request #2036
89b2f306
tests: fix invalid key image test (moneromooo-monero)a374a522
wallet2: check key image validity domain in import_key_images (moneromooo-monero)
This commit is contained in:
commit
cd13bcb4d2
2 changed files with 14 additions and 2 deletions
|
@ -5277,6 +5277,10 @@ uint64_t wallet2::import_key_images(const std::vector<std::pair<crypto::key_imag
|
|||
|
||||
std::vector<const crypto::public_key*> pkeys;
|
||||
pkeys.push_back(&pkey);
|
||||
THROW_WALLET_EXCEPTION_IF(!(rct::scalarmultKey(rct::ki2rct(key_image), rct::curveOrder()) == rct::identity()),
|
||||
error::wallet_internal_error, "Key image out of validity domain: input " + boost::lexical_cast<std::string>(n) + "/"
|
||||
+ boost::lexical_cast<std::string>(signed_key_images.size()) + ", key image " + epee::string_tools::pod_to_hex(key_image));
|
||||
|
||||
THROW_WALLET_EXCEPTION_IF(!crypto::check_ring_signature((const crypto::hash&)key_image, key_image, pkeys, &signature),
|
||||
error::wallet_internal_error, "Signature check failed: input " + boost::lexical_cast<std::string>(n) + "/"
|
||||
+ boost::lexical_cast<std::string>(signed_key_images.size()) + ", key image " + epee::string_tools::pod_to_hex(key_image)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue