exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit b74e8c970e6617d4a5d9c6bdd69787cb4be715e9
parent bf816a8ff4f8185f13f99489e6bbcb04bb3b7056
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sat, 11 Jul 2026 17:43:04 +0200

-minor fixes

Diffstat:
Msrc/exchange/taler-exchange-httpd.c | 10+++++++---
Msrc/exchange/taler-exchange-httpd_common_kyc.c | 14++------------
Msrc/kyclogic/taler-exchange-kyc-tester.c | 19+++++++++++--------
Msrc/lib/exchange_api_post-reserves-RESERVE_PUB-open.c | 2+-
Msrc/lib/exchange_api_restrictions.c | 16+++++++++++++---
5 files changed, 34 insertions(+), 27 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c @@ -1538,12 +1538,16 @@ static enum MHD_Result toplevel_redirect (struct TEH_RequestContext *rc, const char *const args[]) { - const char *text = "Redirecting to /webui/"; + char *text; struct MHD_Response *response; + GNUNET_asprintf (&text, + "Redirecting to %s", + toplevel_redirect_url); response = MHD_create_response_from_buffer (strlen (text), - (void *) text, - MHD_RESPMEM_PERSISTENT); + text, + MHD_RESPMEM_MUST_COPY); + GNUNET_free (text); if (NULL == response) { GNUNET_break (0); diff --git a/src/exchange/taler-exchange-httpd_common_kyc.c b/src/exchange/taler-exchange-httpd_common_kyc.c @@ -172,7 +172,7 @@ fallback_result_cb (void *cls, /** - * Type of a callback that receives a JSON @a result. + * Handle the AML program result @a apr for the KYC measure in @a cls. * * @param cls closure of type `struct TEH_KycMeasureRunContext *` * @param apr AML program result @@ -488,7 +488,7 @@ TEH_kyc_run_measure_for_attributes ( * Helper task that asynchronously calls the result * callback and then cleans up. * - * @param[in] cls a `struct TEH_LegitimizationCheckHandle *` + * @param[in] cls a `struct TEH_KycMeasureRunContext *` */ static void async_return_measure_result (void *cls) @@ -989,11 +989,6 @@ struct TEH_LegitimizationCheckHandle void *ai_cls; /** - * Handle to AML program we are running, or NULL for none. - */ - struct TEH_KycMeasureRunContext *measure_run_ctx; - - /** * Hash of @e payto_uri. */ struct TALER_NormalizedPaytoHashP h_payto; @@ -1744,11 +1739,6 @@ TEH_legitimization_check_cancel ( TEH_kyc_run_measure_cancel (lch->kat); lch->kat = NULL; } - if (NULL != lch->measure_run_ctx) - { - TEH_kyc_run_measure_cancel (lch->measure_run_ctx); - lch->measure_run_ctx = NULL; - } if (NULL != lch->lcr.response) { MHD_destroy_response (lch->lcr.response); diff --git a/src/kyclogic/taler-exchange-kyc-tester.c b/src/kyclogic/taler-exchange-kyc-tester.c @@ -299,6 +299,12 @@ static int global_ret; static char *measure; /** + * Legitimization rule set parsed from the command-line, + * or NULL if none was given. + */ +static struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs; + +/** * Handle for ongoing initiation operation. */ static struct TALER_KYCLOGIC_InitiateHandle *ih; @@ -311,7 +317,7 @@ static struct TALER_KYCLOGIC_Plugin *ih_logic; /** * True if we started any daemon. */ -static bool have_daemons; uint16_t serve_port; +static bool have_daemons; /** * Context for all CURL operations (useful to the event loop) @@ -433,11 +439,7 @@ kyc_webhook_cleanup (void) /** - * Function called with the result of a webhook - * operation. - * - * Note that the "decref" for the @a response - * will be done by the plugin. + * Function called with the result of a webhook operation. * * @param cls closure * @param process_row legitimization process request the webhook was about @@ -471,8 +473,8 @@ webhook_finished_cb ( (void) expiration; (void) provider_section; + (void) is_wallet; kwh->wh = NULL; - GNUNET_break (is_wallet); if ( (NULL != account_id) && (0 != GNUNET_memcmp (account_id, &cmd_line_h_payto)) ) @@ -1353,6 +1355,8 @@ do_shutdown (void *cls) ih = NULL; } kyc_webhook_cleanup (); + TALER_KYCLOGIC_rules_free (lrs); + lrs = NULL; TALER_KYCLOGIC_kyc_done (); TALER_MHD_daemons_halt (); TALER_MHD_daemons_destroy (); @@ -1537,7 +1541,6 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *config) { enum TALER_KYCLOGIC_KycTriggerEvent event; - struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs = NULL; const struct TALER_KYCLOGIC_KycRule *rule = NULL; (void) cls; diff --git a/src/lib/exchange_api_post-reserves-RESERVE_PUB-open.c b/src/lib/exchange_api_post-reserves-RESERVE_PUB-open.c @@ -413,7 +413,7 @@ TALER_EXCHANGE_post_reserves_open_create ( cp = GNUNET_JSON_PACK ( GNUNET_JSON_pack_allow_null ( GNUNET_JSON_pack_data_auto ("h_age_commitment", - &ahac)), + achp)), TALER_JSON_pack_amount ("amount", &pd->amount), GNUNET_JSON_pack_data_auto ("denom_pub_hash", diff --git a/src/lib/exchange_api_restrictions.c b/src/lib/exchange_api_restrictions.c @@ -17,10 +17,9 @@ /** * @file lib/exchange_api_restrictions.c * @brief convenience functions related to account restrictions -a * @author Christian Grothoff + * @author Christian Grothoff */ -#include "platform.h" /* UNNECESSARY? */ -#include "taler/taler_exchange_service.h" /* UNNECESSARY? */ +#include "taler/taler_exchange_service.h" #include <regex.h> @@ -42,7 +41,18 @@ TALER_EXCHANGE_test_account_allowed ( bool ok; wm1 = TALER_payto_get_method (payto_uri.normalized_payto); + if (NULL == wm1) + { + GNUNET_break (0); + GNUNET_free (wm1); + return GNUNET_SYSERR; + } wm2 = TALER_payto_get_method (account->fpayto_uri.full_payto); + if (NULL == wm2) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } ok = (0 == strcmp (wm1, wm2)); GNUNET_free (wm1);