exchange

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

commit ce5dfb682d5c3d396187152a25b97a39b6c79927
parent 2c54480b5d48e0f1fddbfd7ce6075b4d1391135b
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 16 Apr 2025 21:44:02 +0200

-fix misc. bugs found in QC

Diffstat:
Msrc/exchange/taler-exchange-httpd_kyc-start.c | 4++++
Msrc/exchangedb/exchangedb_aml.c | 3++-
Msrc/kyclogic/kyclogic_api.c | 9+++++++++
Msrc/util/lang.c | 16+++++++++++-----
4 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_kyc-start.c b/src/exchange/taler-exchange-httpd_kyc-start.c @@ -508,6 +508,10 @@ TEH_handler_kyc_start ( (NULL == kyp->redirect_url) ) { GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "KYC process failed to start with error %d (%s)\n", + (int) kyp->ec, + kyp->hint); if (TALER_EC_NONE == kyp->ec) { GNUNET_break (0); diff --git a/src/exchangedb/exchangedb_aml.c b/src/exchangedb/exchangedb_aml.c @@ -43,7 +43,8 @@ TALER_EXCHANGEDB_persist_aml_program_result ( json_t *jmeasures = NULL; struct TALER_KYCLOGIC_LegitimizationRuleSet *lrs = NULL; - if (NULL != apr->details.success.new_measures) + if ( (TALER_KYCLOGIC_AMLR_SUCCESS == apr->status) && + (NULL != apr->details.success.new_measures) ) { lrs = TALER_KYCLOGIC_rules_parse (apr->details.success.new_rules); GNUNET_assert (NULL != lrs); diff --git a/src/kyclogic/kyclogic_api.c b/src/kyclogic/kyclogic_api.c @@ -819,6 +819,7 @@ TALER_KYCLOGIC_rules_parse (const json_t *jlrs) KYC_MEASURE_IMPOSSIBLE)) { rule->verboten = true; + continue; } else if (NULL == find_measure (lrs, @@ -1107,6 +1108,14 @@ TALER_KYCLOGIC_rule_to_measures ( const struct TALER_KYCLOGIC_Measure *ms; json_t *mi; + if (0 == + strcasecmp (measure_name, + KYC_MEASURE_IMPOSSIBLE)) + { + /* This case should be covered via the 'verboten' flag! */ + GNUNET_break (0); + continue; + } ms = find_measure (lrs, measure_name); if (NULL == ms) diff --git a/src/util/lang.c b/src/util/lang.c @@ -84,11 +84,17 @@ TALER_pattern_matches (const char *pattern, if (NULL != qp) while (isspace ((int) *qp)) qp++; - GNUNET_break_op ( (NULL == qp) || - (0 == strlen (qp)) || - (1 == sscanf (qp, - "q=%lf", - &q)) ); + if ( (NULL != qp) && + (0 != strlen (qp)) && + (1 != sscanf (qp, + "q=%lf", + &q)) ) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Unsupported pattern `%s' in HTTP header\n", + pattern); + break; + } if (pattern_matches (lp, value)) r = GNUNET_MAX (r, q);