exchange

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

commit 2ace4be7ece935e61627ae19ecef4ad5011cc315
parent 1262e2462d4b6c51e91122bd70ea9f893a01de27
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 29 Jun 2026 17:27:54 +0200

bugfixes

Diffstat:
Msrc/include/taler/taler_kyclogic_plugin.h | 2+-
Msrc/kyclogic/plugin_kyclogic_kycaid.c | 5+++++
Msrc/kyclogic/plugin_kyclogic_persona.c | 15++++++++-------
Msrc/lib/exchange_api_post-withdraw.c | 6+++---
4 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/src/include/taler/taler_kyclogic_plugin.h b/src/include/taler/taler_kyclogic_plugin.h @@ -273,8 +273,8 @@ typedef void * @param provider_name name of the provider with the attributes * @param provider_user_id set to user ID at the provider, or NULL if not supported or unknown * @param provider_legitimization_id set to legitimization process ID at the provider, or NULL if not supported or unknown - * @param attributes user attributes returned by the provider, MUST include "FORM_ID" of type String, or NULL on error * @param expiration until when is the KYC check valid + * @param attributes user attributes returned by the provider, MUST include "FORM_ID" of type String, or NULL on error * @param http_status HTTP status code of @a response * @param[in] response to return to the HTTP client */ diff --git a/src/kyclogic/plugin_kyclogic_kycaid.c b/src/kyclogic/plugin_kyclogic_kycaid.c @@ -994,6 +994,11 @@ handle_webhook_finished (void *cls, json_object_get ( j, "profile_status")); + if (NULL == profile_status) + { + GNUNET_break_op (0); + profile_status = "<invalid>"; + } if (0 != strcasecmp ("valid", profile_status)) { diff --git a/src/kyclogic/plugin_kyclogic_persona.c b/src/kyclogic/plugin_kyclogic_persona.c @@ -908,7 +908,7 @@ persona_proof_cancel (struct TALER_KYCLOGIC_ProofHandle *ph) * @param ph proof handle to generate reply for * @param status status to return * @param account_id account to return - * @param inquiry_id inquiry ID to supply + * @param inquiry_id inquiry ID to supply, NULL if unknown * @param http_status HTTP status to use * @param template template to instantiate * @param[in] body body for the template to use (reference @@ -1012,8 +1012,9 @@ return_invalid_response (struct TALER_KYCLOGIC_ProofHandle *ph, GNUNET_JSON_PACK ( GNUNET_JSON_pack_uint64 ("persona_http_status", response_code), - GNUNET_JSON_pack_string ("persona_inquiry_id", - inquiry_id), + GNUNET_JSON_pack_allow_null ( + GNUNET_JSON_pack_string ("persona_inquiry_id", + inquiry_id)), TALER_JSON_pack_ec ( TALER_EC_EXCHANGE_KYC_GENERIC_PROVIDER_UNEXPECTED_REPLY), GNUNET_JSON_pack_string ("detail", @@ -1138,7 +1139,7 @@ handle_proof_finished (void *cls, { case MHD_HTTP_OK: { - const char *inquiry_id; + const char *inquiry_id = NULL; const char *account_id; const char *type = NULL; const json_t *attributes; @@ -1568,7 +1569,7 @@ persona_webhook_cancel (struct TALER_KYCLOGIC_WebhookHandle *wh) * @param wh proof handle to generate reply for * @param status status to return * @param account_id account to return - * @param inquiry_id inquiry ID to supply + * @param inquiry_id inquiry ID to supply, NULL if unknown * @param attr KYC attribute data for the client * @param http_status HTTP status to use */ @@ -1610,7 +1611,7 @@ webhook_generic_reply (struct TALER_KYCLOGIC_WebhookHandle *wh, * Call @a wh callback with HTTP error response. * * @param wh proof handle to generate reply for - * @param inquiry_id inquiry ID to supply + * @param inquiry_id inquiry ID to supply, NULL if unknown * @param http_status HTTP status to use */ static void @@ -1709,7 +1710,7 @@ handle_webhook_finished (void *cls, { case MHD_HTTP_OK: { - const char *inquiry_id; + const char *inquiry_id = NULL; const char *account_id; const char *type = NULL; const json_t *attributes; diff --git a/src/lib/exchange_api_post-withdraw.c b/src/lib/exchange_api_post-withdraw.c @@ -898,7 +898,7 @@ prepare_coins ( wh->bp_coins[cs_coin_idx].candidate = can; wh->bp_coins[cs_coin_idx].planchet = planchet; wh->bp_coins[cs_coin_idx].denom_pub = &cd->denom_pub.key; - wh->bp_coins[cs_coin_idx].cs_idx = cs_coin_idx; + wh->bp_coins[cs_coin_idx].cs_idx = cs_denom_idx - 1; wh->bp_coins[cs_coin_idx].age_denom = age_denom; cs_coin_idx++; break; @@ -906,8 +906,8 @@ prepare_coins ( default: FAIL_IF (1); } - } - } + } /* for k in [0..KAPPA) */ + } /* for i in [0 .. wh->num_coins) */ if (0 < cs_num) {