summaryrefslogtreecommitdiff
path: root/src/exchange-tools
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-01-06 15:52:12 +0100
committerChristian Grothoff <christian@grothoff.org>2021-01-06 15:52:12 +0100
commit73a9fe56eb2fd9c7126eeffa396998815112e2e5 (patch)
tree01adc81864e1e12e75ce2b8ff198865af32b8e19 /src/exchange-tools
parent1f9121126395ac56bbccad4c1de60ca5c1c47983 (diff)
downloadexchange-73a9fe56eb2fd9c7126eeffa396998815112e2e5.tar.gz
exchange-73a9fe56eb2fd9c7126eeffa396998815112e2e5.tar.bz2
exchange-73a9fe56eb2fd9c7126eeffa396998815112e2e5.zip
add checks to ensure payto:// URI is well-formed to taler-exchange-offline, and taler-exchange-httpd where applicable (fixes #6675)
Diffstat (limited to 'src/exchange-tools')
-rw-r--r--src/exchange-tools/taler-exchange-offline.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/exchange-tools/taler-exchange-offline.c b/src/exchange-tools/taler-exchange-offline.c
index b6960df48..33aa50f4f 100644
--- a/src/exchange-tools/taler-exchange-offline.c
+++ b/src/exchange-tools/taler-exchange-offline.c
@@ -1236,6 +1236,21 @@ upload_wire_add (const char *exchange_url,
test_shutdown ();
return;
}
+ {
+ char *wire_method;
+
+ wire_method = TALER_payto_get_method (payto_uri);
+ if (NULL == wire_method)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "payto:// URI `%s' is malformed\n",
+ payto_uri);
+ global_ret = 7;
+ test_shutdown ();
+ return;
+ }
+ GNUNET_free (wire_method);
+ }
war = GNUNET_new (struct WireAddRequest);
war->idx = idx;
war->h =
@@ -2043,6 +2058,21 @@ do_add_wire (char *const *args)
now = GNUNET_TIME_absolute_get ();
(void) GNUNET_TIME_round_abs (&now);
+ {
+ char *wire_method;
+
+ wire_method = TALER_payto_get_method (args[0]);
+ if (NULL == wire_method)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "payto:// URI `%s' is malformed\n",
+ args[0]);
+ global_ret = 7;
+ test_shutdown ();
+ return;
+ }
+ GNUNET_free (wire_method);
+ }
TALER_exchange_offline_wire_add_sign (args[0],
now,
&master_priv,