aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-05-07 17:34:16 +0200
committerRiccardo Spagni <ric@spagni.net>2019-05-07 17:34:16 +0200
commitc20221f2904b4e73a9b3c016420cd2cc8417f369 (patch)
treeeb1625243cfae871f7a0bf4cdf1bfd41bb0e002c /src
parentMerge pull request #5501 (diff)
parentwallet_rpc_server: reject standalone short payment id in address book (diff)
downloadmonero-c20221f2904b4e73a9b3c016420cd2cc8417f369.tar.xz
Merge pull request #5503
ccc1e311 wallet_rpc_server: reject standalone short payment id in address book (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet_rpc_server.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 22eaffa6f..a51057d0b 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -2814,20 +2814,20 @@ namespace tools
}
crypto::hash long_payment_id;
- crypto::hash8 short_payment_id;
if (!wallet2::parse_long_payment_id(req.payment_id, payment_id))
{
if (!wallet2::parse_short_payment_id(req.payment_id, info.payment_id))
{
er.code = WALLET_RPC_ERROR_CODE_WRONG_PAYMENT_ID;
- er.message = "Payment id has invalid format: \"" + req.payment_id + "\", expected 16 or 64 character string";
+ er.message = "Payment id has invalid format: \"" + req.payment_id + "\", expected 64 character string";
return false;
}
else
{
- memcpy(payment_id.data, info.payment_id.data, 8);
- memset(payment_id.data + 8, 0, 24);
+ er.code = WALLET_RPC_ERROR_CODE_WRONG_PAYMENT_ID;
+ er.message = "Payment id has invalid format: standalone short payment IDs are forbidden, they must be part of an integrated address";
+ return false;
}
}
}