aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-30 17:30:38 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-30 21:07:37 +0000
commitccc1e311dc7a9bdf8c4739667d63ec9a088a413b (patch)
tree57973e6193c3e47d666c889cf8cc0b36d849776d /src/wallet
parentMerge pull request #5486 (diff)
downloadmonero-ccc1e311dc7a9bdf8c4739667d63ec9a088a413b.tar.xz
wallet_rpc_server: reject standalone short payment id in address book
Diffstat (limited to 'src/wallet')
-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 4076ae957..52bf5f773 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -2805,20 +2805,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;
}
}
}