commit 026148b01efbfbf81269b8c136d8f6d45bb53982
parent 5fb88bbf6b16beb08ffb8b7610791fcd2b2535cf
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 3 Nov 2026 23:07:22 +0100
fix incomplete country table
Diffstat:
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/util/iban.c b/src/util/iban.c
@@ -41,12 +41,14 @@ struct CountryTableEntry
};
-/* Keep the following table in sync with gettext.
+/* Keep the following table in sync with gettext, plus the countries
+ of the IBAN registry that gettext does not list.
WARNING: the entries should stay sorted according to the code */
/**
* List of country codes.
*/
static const struct CountryTableEntry country_table[] = {
+ { "AD", "Andorra" },
{ "AE", "U.A.E." },
{ "AF", "Afghanistan" },
{ "AL", "Albania" },
@@ -77,6 +79,7 @@ static const struct CountryTableEntry country_table[] = {
{ "CO", "Colombia" },
{ "CR", "Costa Rica" },
{ "CS", "Serbia and Montenegro" },
+ { "CY", "Cyprus" },
{ "CZ", "Czech Republic" },
{ "DE", "Germany" },
{ "DK", "Denmark" },
@@ -94,6 +97,7 @@ static const struct CountryTableEntry country_table[] = {
{ "GB", "United Kingdom" },
{ "GD", "Caribbean" },
{ "GE", "Georgia" },
+ { "GI", "Gibraltar" },
{ "GL", "Greenland" },
{ "GR", "Greece" },
{ "GT", "Guatemala" },
@@ -168,6 +172,7 @@ static const struct CountryTableEntry country_table[] = {
{ "SG", "Singapore" },
{ "SI", "Slovenia" },
{ "SK", "Slovak" },
+ { "SM", "San Marino" },
{ "SN", "Senegal" },
{ "SO", "Somalia" },
{ "SR", "Suriname" },
diff --git a/src/util/test_payto.c b/src/util/test_payto.c
@@ -51,6 +51,15 @@ main (int argc,
TALER_iban_validate ("FR1420041010050500013M02606"));
GNUNET_assert (NULL ==
TALER_iban_validate ("DE89370400440532013000"));
+ /* SEPA members that are not in the gettext country list */
+ GNUNET_assert (NULL ==
+ TALER_iban_validate ("CY17002001280000001200527600"));
+ GNUNET_assert (NULL ==
+ TALER_iban_validate ("AD1200012030200359100100"));
+ GNUNET_assert (NULL ==
+ TALER_iban_validate ("GI75NWBK000000007099453"));
+ GNUNET_assert (NULL ==
+ TALER_iban_validate ("SM86U0322509800000000270100"));
r = TALER_payto_validate (
(struct TALER_FullPayto) {
(char *) "payto://x-taler-bank/hostname/username?receiver-name=foo"