summaryrefslogtreecommitdiff
path: root/src/util/crypto_helper_esign.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/crypto_helper_esign.c')
-rw-r--r--src/util/crypto_helper_esign.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/util/crypto_helper_esign.c b/src/util/crypto_helper_esign.c
index 702ea74df..e044d31d1 100644
--- a/src/util/crypto_helper_esign.c
+++ b/src/util/crypto_helper_esign.c
@@ -111,21 +111,28 @@ try_connect (struct TALER_CRYPTO_ExchangeSignHelper *esh)
struct TALER_CRYPTO_ExchangeSignHelper *
TALER_CRYPTO_helper_esign_connect (
const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
TALER_CRYPTO_ExchangeKeyStatusCallback ekc,
void *ekc_cls)
{
struct TALER_CRYPTO_ExchangeSignHelper *esh;
char *unixpath;
+ char *secname;
+
+ GNUNET_asprintf (&secname,
+ "%s-secmod-eddsa",
+ section);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg,
- "taler-exchange-secmod-eddsa",
+ secname,
"UNIXPATH",
&unixpath))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "taler-exchange-secmod-eddsa",
+ secname,
"UNIXPATH");
+ GNUNET_free (secname);
return NULL;
}
/* we use >= here because we want the sun_path to always
@@ -133,12 +140,14 @@ TALER_CRYPTO_helper_esign_connect (
if (strlen (unixpath) >= sizeof (esh->sa.sun_path))
{
GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
- "taler-exchange-secmod-eddsa",
+ secname,
"UNIXPATH",
"path too long");
GNUNET_free (unixpath);
+ GNUNET_free (secname);
return NULL;
}
+ GNUNET_free (secname);
esh = GNUNET_new (struct TALER_CRYPTO_ExchangeSignHelper);
esh->ekc = ekc;
esh->ekc_cls = ekc_cls;
@@ -182,7 +191,7 @@ handle_mt_avail (struct TALER_CRYPTO_ExchangeSignHelper *esh,
if (GNUNET_OK !=
TALER_exchange_secmod_eddsa_verify (
&kan->exchange_pub,
- GNUNET_TIME_absolute_ntoh (kan->anchor_time),
+ GNUNET_TIME_timestamp_ntoh (kan->anchor_time),
GNUNET_TIME_relative_ntoh (kan->duration),
&kan->secm_pub,
&kan->secm_sig))
@@ -191,7 +200,7 @@ handle_mt_avail (struct TALER_CRYPTO_ExchangeSignHelper *esh,
return GNUNET_SYSERR;
}
esh->ekc (esh->ekc_cls,
- GNUNET_TIME_absolute_ntoh (kan->anchor_time),
+ GNUNET_TIME_timestamp_ntoh (kan->anchor_time),
GNUNET_TIME_relative_ntoh (kan->duration),
&kan->exchange_pub,
&kan->secm_pub,
@@ -220,7 +229,7 @@ handle_mt_purge (struct TALER_CRYPTO_ExchangeSignHelper *esh,
return GNUNET_SYSERR;
}
esh->ekc (esh->ekc_cls,
- GNUNET_TIME_UNIT_ZERO_ABS,
+ GNUNET_TIME_UNIT_ZERO_TS,
GNUNET_TIME_UNIT_ZERO,
&pn->exchange_pub,
NULL,
@@ -357,9 +366,9 @@ TALER_CRYPTO_helper_esign_sign_ (
sr->header.size = htons (sizeof (buf));
sr->header.type = htons (TALER_HELPER_EDDSA_MT_REQ_SIGN);
sr->reserved = htonl (0);
- memcpy (&sr->purpose,
- purpose,
- purpose_size);
+ GNUNET_memcpy (&sr->purpose,
+ purpose,
+ purpose_size);
if (GNUNET_OK !=
TALER_crypto_helper_send_all (esh->sock,
buf,