aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-tools
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-05-18 18:05:32 +0200
committerChristian Grothoff <christian@grothoff.org>2022-05-18 18:05:32 +0200
commit344c53c51dac9d5bb09c261c36f3e4d58de1a321 (patch)
treebe65f9f78ca8d39add84a5fc31098e8f806c9555 /src/exchange-tools
parent492d501570106cb2eefa684820d0c64966c153f9 (diff)
enforce valid payto:// URI in exchange /wire response
Diffstat (limited to 'src/exchange-tools')
-rw-r--r--src/exchange-tools/taler-exchange-offline.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/exchange-tools/taler-exchange-offline.c b/src/exchange-tools/taler-exchange-offline.c
index 687ef5682..8d8c4c62b 100644
--- a/src/exchange-tools/taler-exchange-offline.c
+++ b/src/exchange-tools/taler-exchange-offline.c
@@ -1395,6 +1395,20 @@ upload_wire_add (const char *exchange_url,
}
GNUNET_free (wire_method);
}
+ {
+ char *msg = TALER_payto_validate (payto_uri);
+
+ if (NULL != msg)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "payto URI is malformed: %s\n",
+ msg);
+ GNUNET_free (msg);
+ test_shutdown ();
+ global_ret = EXIT_INVALIDARGUMENT;
+ return;
+ }
+ }
war = GNUNET_new (struct WireAddRequest);
war->idx = idx;
war->h =
@@ -2460,6 +2474,20 @@ do_add_wire (char *const *args)
if (GNUNET_OK !=
load_offline_key (GNUNET_NO))
return;
+ {
+ char *msg = TALER_payto_validate (args[0]);
+
+ if (NULL != msg)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "payto URI is malformed: %s\n",
+ msg);
+ GNUNET_free (msg);
+ test_shutdown ();
+ global_ret = EXIT_INVALIDARGUMENT;
+ return;
+ }
+ }
now = GNUNET_TIME_timestamp_get ();
{
char *wire_method;