wallet2: reject standalone short payment IDs in monero: URI API

This commit is contained in:
moneromooo-monero
2019-05-01 18:41:39 +00:00
parent 581994b61c
commit 1c44e65863
2 changed files with 3 additions and 7 deletions
+2 -4
View File
@@ -12610,8 +12610,7 @@ std::string wallet2::make_uri(const std::string &address, const std::string &pay
if (!payment_id.empty())
{
crypto::hash pid32;
crypto::hash8 pid8;
if (!wallet2::parse_long_payment_id(payment_id, pid32) && !wallet2::parse_short_payment_id(payment_id, pid8))
if (!wallet2::parse_long_payment_id(payment_id, pid32))
{
error = "Invalid payment id";
return std::string();
@@ -12705,8 +12704,7 @@ bool wallet2::parse_uri(const std::string &uri, std::string &address, std::strin
return false;
}
crypto::hash hash;
crypto::hash8 hash8;
if (!wallet2::parse_long_payment_id(kv[1], hash) && !wallet2::parse_short_payment_id(kv[1], hash8))
if (!wallet2::parse_long_payment_id(kv[1], hash))
{
error = "Invalid payment id: " + kv[1];
return false;