[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: add option -s to the CS secmod h
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: add option -s to the CS secmod helper for DONAU to use a different path |
Date: |
Fri, 05 Jan 2024 14:21:58 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new dc742246 add option -s to the CS secmod helper for DONAU to use a
different path
dc742246 is described below
commit dc742246151fa5a0fa3f2150e130d5122008cfae
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Jan 5 14:21:53 2024 +0100
add option -s to the CS secmod helper for DONAU to use a different path
---
contrib/gana | 2 +-
contrib/wallet-core | 2 +-
src/exchange/taler-exchange-httpd_keys.c | 1 +
src/include/taler_crypto_lib.h | 2 ++
src/util/crypto_helper_cs.c | 14 +++++++++++---
src/util/taler-exchange-secmod-cs.c | 22 ++++++++++++++++++++--
src/util/test_helper_cs.c | 2 ++
7 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/contrib/gana b/contrib/gana
index c6caa0a9..6d3fb428 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit c6caa0a91e01b0c74fd71fce71ee5207264a492c
+Subproject commit 6d3fb428f0a2dd5bc5f35516ea77c32c2cf0ecfa
diff --git a/contrib/wallet-core b/contrib/wallet-core
index 415db772..a675c940 160000
--- a/contrib/wallet-core
+++ b/contrib/wallet-core
@@ -1 +1 @@
-Subproject commit 415db772c3fd2733acd9173995a40986fc821d2b
+Subproject commit a675c94085cfa90052c9ebacd2cebccfab2c4f18
diff --git a/src/exchange/taler-exchange-httpd_keys.c
b/src/exchange/taler-exchange-httpd_keys.c
index 4cefcf87..e987fcb5 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 fb9e32a2..bab27870 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 dae0b6fc..ac41f52c 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 a9696ee8..89d1462f 100644
--- a/src/util/taler-exchange-secmod-cs.c
+++ b/src/util/taler-exchange-secmod-cs.c
@@ -340,6 +340,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
@@ -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 2292cbfd..07e9907b 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)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: add option -s to the CS secmod helper for DONAU to use a different path,
gnunet <=