commit e4f7102c2ab178322f8d6f81746139f0d2230921
parent 8fc8be0d00a68091204d4fcc12430a297baf3df0
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 17 Jul 2025 20:52:20 +0200
fix #10196: do not return KYC status for untrusted exchanges
Diffstat:
3 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c
@@ -258,6 +258,18 @@ lookup_exchange (const char *exchange_url)
}
+bool
+TMH_EXCHANGES_check_trusted (
+ const char *exchange_url)
+{
+ struct TMH_Exchange *exchange = lookup_exchange (exchange_url);
+
+ if (NULL == exchange)
+ return false;
+ return exchange->trusted;
+}
+
+
/**
* Check if we have any remaining pending requests for the
* given @a exchange, and if we have the required data, call
diff --git a/src/backend/taler-merchant-httpd_exchanges.h b/src/backend/taler-merchant-httpd_exchanges.h
@@ -76,6 +76,18 @@ struct TMH_EXCHANGES_KeysOperation;
/**
+ * Check if we trust the exchange at @a exchange_url.
+ *
+ * @param exchange_url exchange base url to check
+ * @return true if we trust that exchange (assuming the master
+ * public key matches)
+ */
+bool
+TMH_EXCHANGES_check_trusted (
+ const char *exchange_url);
+
+
+/**
* Get /keys of the given @a exchange.
*
* @param exchange URL of the exchange we would like to talk to
diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
@@ -911,6 +911,13 @@ kyc_status_cb (
struct KycContext *kc = cls;
struct ExchangeKycRequest *ekr;
+ if (! TMH_EXCHANGES_check_trusted (exchange_url))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Skipping exchange `%s': not trusted\n",
+ exchange_url);
+ return;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"KYC status for `%s' at `%s' is %u/%s/%s/%s\n",
payto_uri.full_payto,