diff options
m--------- | contrib/gana | 0 | ||||
m--------- | contrib/wallet-core | 0 | ||||
-rw-r--r-- | src/exchange/taler-exchange-httpd_keys.c | 1 | ||||
-rw-r--r-- | src/include/taler_crypto_lib.h | 2 | ||||
-rw-r--r-- | src/util/crypto_helper_cs.c | 14 | ||||
-rw-r--r-- | src/util/taler-exchange-secmod-cs.c | 22 | ||||
-rw-r--r-- | src/util/test_helper_cs.c | 2 |
7 files changed, 36 insertions, 5 deletions
diff --git a/contrib/gana b/contrib/gana -Subproject c6caa0a91e01b0c74fd71fce71ee5207264a492 +Subproject 6d3fb428f0a2dd5bc5f35516ea77c32c2cf0ecf diff --git a/contrib/wallet-core b/contrib/wallet-core -Subproject 415db772c3fd2733acd9173995a40986fc821d2 +Subproject a675c94085cfa90052c9ebacd2cebccfab2c4f1 diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c index 4cefcf871..e987fcb5a 100644 --- a/src/exchange/taler-exchange-httpd_keys.c +++ b/src/exchange/taler-exchange-httpd_keys.c @@ -1638,6 +1638,7 @@ setup_key_helpers (struct HelperState *hs) return GNUNET_SYSERR; } hs->csdh = TALER_CRYPTO_helper_cs_connect (TEH_cfg, + "taler", &helper_cs_cb, hs); if (NULL == hs->csdh) diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index fb9e32a21..bab27870b 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -2514,6 +2514,7 @@ typedef void * Initiate connection to an denomination key helper. * * @param cfg configuration to use + * @param section configuration section prefix to use, usually 'taler' or 'donau' * @param dkc function to call with key information * @param dkc_cls closure for @a dkc * @return NULL on error (such as bad @a cfg). @@ -2521,6 +2522,7 @@ typedef void struct TALER_CRYPTO_CsDenominationHelper * TALER_CRYPTO_helper_cs_connect ( const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section, TALER_CRYPTO_CsDenominationKeyStatusCallback dkc, void *dkc_cls); diff --git a/src/util/crypto_helper_cs.c b/src/util/crypto_helper_cs.c index dae0b6fc6..ac41f52c6 100644 --- a/src/util/crypto_helper_cs.c +++ b/src/util/crypto_helper_cs.c @@ -113,21 +113,27 @@ try_connect (struct TALER_CRYPTO_CsDenominationHelper *dh) struct TALER_CRYPTO_CsDenominationHelper * TALER_CRYPTO_helper_cs_connect ( const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section, TALER_CRYPTO_CsDenominationKeyStatusCallback dkc, void *dkc_cls) { struct TALER_CRYPTO_CsDenominationHelper *dh; char *unixpath; + char *secname; + GNUNET_asprintf (&secname, + "%s-exchange-secmod-cs", + section); if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, - "taler-exchange-secmod-cs", + secname, "UNIXPATH", &unixpath)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "taler-exchange-secmod-cs", + secname, "UNIXPATH"); + GNUNET_free (secname); return NULL; } /* we use >= here because we want the sun_path to always @@ -135,12 +141,14 @@ TALER_CRYPTO_helper_cs_connect ( if (strlen (unixpath) >= sizeof (dh->sa.sun_path)) { GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, - "taler-exchange-secmod-cs", + secname, "UNIXPATH", "path too long"); GNUNET_free (unixpath); + GNUNET_free (secname); return NULL; } + GNUNET_free (secname); dh = GNUNET_new (struct TALER_CRYPTO_CsDenominationHelper); dh->dkc = dkc; dh->dkc_cls = dkc_cls; diff --git a/src/util/taler-exchange-secmod-cs.c b/src/util/taler-exchange-secmod-cs.c index a9696ee84..89d1462f2 100644 --- a/src/util/taler-exchange-secmod-cs.c +++ b/src/util/taler-exchange-secmod-cs.c @@ -341,6 +341,13 @@ static struct GNUNET_TIME_Timestamp now_tmp; static char *keydir; /** + * Name of the configuration section prefix to use. Usually either "taler" or + * "donau". The actual configuration section will then be + * "$SECTION-exchange-secmod-cs". + */ +static const char *section = "taler"; + +/** * How much should coin creation (@e duration_withdraw) duration overlap * with the next denomination? Basically, the starting time of two * denominations is always @e duration_withdraw - #overlap_duration apart. @@ -2157,6 +2164,7 @@ run (void *cls, .updater = &cs_update_client_keys, .init = &cs_client_init }; + char *secname; (void) cls; (void) args; @@ -2171,18 +2179,23 @@ run (void *cls, /* get current time again, we may be timetraveling! */ now = GNUNET_TIME_timestamp_get (); } + GNUNET_asprintf (&secname, + "%s-exchange-secmod-cs", + section); if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, - "taler-exchange-secmod-cs", + secname, "KEY_DIR", &keydir)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "taler-exchange-secmod-cs", + secname, "KEY_DIR"); + GNUNET_free (secname); global_ret = EXIT_NOTCONFIGURED; return; } + GNUNET_free (secname); if (GNUNET_OK != load_durations (cfg)) { @@ -2264,6 +2277,11 @@ main (int argc, char **argv) { struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_option_string ('s', + "section", + "SECTION", + "name of the configuration section prefix to use, default is 'taler'", + §ion), GNUNET_GETOPT_option_timetravel ('T', "timetravel"), GNUNET_GETOPT_option_timestamp ('t', diff --git a/src/util/test_helper_cs.c b/src/util/test_helper_cs.c index 2292cbfd1..07e9907b4 100644 --- a/src/util/test_helper_cs.c +++ b/src/util/test_helper_cs.c @@ -970,6 +970,7 @@ par_signing (struct GNUNET_CONFIGURATION_Handle *cfg) int ret; dh = TALER_CRYPTO_helper_cs_connect (cfg, + "taler", &key_cb, NULL); GNUNET_assert (NULL != dh); @@ -1027,6 +1028,7 @@ run_test (void) nanosleep (&req, NULL); dh = TALER_CRYPTO_helper_cs_connect (cfg, + "taler", &key_cb, NULL); if (NULL != dh) |