exchange

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

commit c02d69f0869a52f4a72b6f2eb3df274b85baa42f
parent 93fb67305b989c3b16ff10372c72e7c2f7c2fff1
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Mon, 14 Jul 2025 13:03:23 +0200

add 'cprefix' option for (RSA) secmod helper for Donau

Diffstat:
Msrc/include/taler/taler_util.h | 6++++++
Msrc/util/Makefile.am | 2+-
Msrc/util/secmod_rsa.c | 23++++++++++++++---------
Msrc/util/taler-exchange-secmod-rsa.c | 3++-
4 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/src/include/taler/taler_util.h b/src/include/taler/taler_util.h @@ -982,6 +982,12 @@ struct TALER_SECMOD_Options const char *section; /** + * Configuration section prefix to use for denomination settings. + * "coin_" for the exchange, "doco_" for Donau. + */ + const char *cprefix; + + /** * Return value from main(). */ int global_ret; diff --git a/src/util/Makefile.am b/src/util/Makefile.am @@ -126,7 +126,7 @@ libtalerutil_la_LIBADD = \ -lm libtalerutil_la_LDFLAGS = \ - -version-info 9:0:0 \ + -version-info 10:0:0 \ -no-undefined diff --git a/src/util/secmod_rsa.c b/src/util/secmod_rsa.c @@ -420,8 +420,9 @@ do_sign (const struct TALER_RsaPubHashP *h_rsa, /* it is too early */ GNUNET_assert (0 == pthread_mutex_unlock (&keys_lock)); GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Signing request failed, denomination key %s is not yet valid\n", - GNUNET_h2s (&h_rsa->hash)); + "Signing request failed, denomination key %s is not yet valid (%llu)\n", + GNUNET_h2s (&h_rsa->hash), + (unsigned long long) dk->anchor.abs_time.abs_value_us); return TALER_EC_EXCHANGE_DENOMINATION_HELPER_TOO_EARLY; } @@ -1778,6 +1779,12 @@ struct LoadContext const struct GNUNET_CONFIGURATION_Handle *cfg; /** + * Configuration section prefix to use for denomination settings. + * "coin_" for the exchange, "doco_" for Donau. + */ + const char *cprefix; + + /** * Current time to use. */ struct GNUNET_TIME_Timestamp t; @@ -1805,12 +1812,9 @@ load_denominations (void *cls, bool wake = true; char *cipher; - if ( (0 != strncasecmp (denomination_alias, - "coin_", - strlen ("coin_"))) && - (0 != strncasecmp (denomination_alias, - "coin-", - strlen ("coin-"))) ) + if (0 != strncasecmp (denomination_alias, + ctx->cprefix, + strlen (ctx->cprefix))) return; /* not a denomination type definition */ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (ctx->cfg, @@ -2014,7 +2018,8 @@ TALER_SECMOD_rsa_run (void *cls, struct LoadContext lc = { .cfg = cfg, .ret = GNUNET_OK, - .t = opt->global_now + .t = opt->global_now, + .cprefix = opt->cprefix }; GNUNET_assert (0 == pthread_mutex_lock (&keys_lock)); diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c @@ -48,7 +48,8 @@ main (int argc, { struct TALER_SECMOD_Options opts = { .max_workers = 16, - .section = "taler-exchange" + .section = "taler-exchange", + .cprefix = "coin_" }; struct GNUNET_GETOPT_CommandLineOption options[] = { TALER_SECMOD_OPTIONS (&opts),