[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: IBAN parser skips BIC part.
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: IBAN parser skips BIC part. |
Date: |
Wed, 10 Jun 2020 17:57:18 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 1039a1c2 IBAN parser skips BIC part.
1039a1c2 is described below
commit 1039a1c2f472155c88fca3d69a7a226c6c4a8d1c
Author: MS <ms@taler.net>
AuthorDate: Wed Jun 10 17:56:58 2020 +0200
IBAN parser skips BIC part.
---
src/json/json_wire.c | 3 ++-
src/json/test_json_wire.c | 9 ++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/json/json_wire.c b/src/json/json_wire.c
index fc3d67a8..7d3453e1 100644
--- a/src/json/json_wire.c
+++ b/src/json/json_wire.c
@@ -343,7 +343,8 @@ validate_payto_iban (const char *account_url)
IBAN_PREFIX,
strlen (IBAN_PREFIX)))
return GNUNET_NO;
- iban = &account_url[strlen (IBAN_PREFIX)];
+
+ iban = strrchr (account_url, '/') + 1;
#undef IBAN_PREFIX
q = strchr (iban,
'?');
diff --git a/src/json/test_json_wire.c b/src/json/test_json_wire.c
index 27de0691..75208c40 100644
--- a/src/json/test_json_wire.c
+++ b/src/json/test_json_wire.c
@@ -33,7 +33,7 @@ main (int argc,
json_t *wire_xtalerbank;
json_t *wire_iban;
const char *payto_xtalerbank = "payto://x-taler-bank/42";
- const char *payto_iban = "payto://iban/DE89370400440532013000";
+ const char *payto_iban =
"payto://iban/BIC-TO-BE-SKIPPED/DE89370400440532013000";
char *p_xtalerbank;
char *p_iban;
@@ -49,6 +49,13 @@ main (int argc,
&master_priv);
wire_iban = TALER_JSON_exchange_wire_signature_make (payto_iban,
&master_priv);
+ if (NULL == wire_iban)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Could not parse payto/IBAN (%s) into 'wire object'\n",
+ payto_iban);
+ return 1;
+ }
p_xtalerbank = TALER_JSON_wire_to_payto (wire_xtalerbank);
p_iban = TALER_JSON_wire_to_payto (wire_iban);
GNUNET_assert (0 == strcmp (p_xtalerbank, payto_xtalerbank));
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: IBAN parser skips BIC part.,
gnunet <=