aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-28 18:23:45 +0100
committerChristian Grothoff <christian@grothoff.org>2015-03-28 18:23:45 +0100
commit98cbd77432b0e9fc656479043a4d2b6e2e49572a (patch)
tree4bf62193955c2e937947749740d40c6f1ed1efd9
parent576545daebd608f24cbbeec627169d5274e6ddd3 (diff)
fix use of struct TALER_DenominationKeyValidityPS
-rw-r--r--src/mint-tools/taler-mint-keyup.c31
-rw-r--r--src/mint/taler-mint-httpd_keystate.c2
2 files changed, 32 insertions, 1 deletions
diff --git a/src/mint-tools/taler-mint-keyup.c b/src/mint-tools/taler-mint-keyup.c
index 5cea08c55..27ffc9219 100644
--- a/src/mint-tools/taler-mint-keyup.c
+++ b/src/mint-tools/taler-mint-keyup.c
@@ -54,6 +54,11 @@ GNUNET_NETWORK_STRUCT_BEGIN
struct CoinTypeNBOP
{
/**
+ * How long are the signatures legally valid?
+ */
+ struct GNUNET_TIME_RelativeNBO duration_legal;
+
+ /**
* How long can the coin be spend?
*/
struct GNUNET_TIME_RelativeNBO duration_spend;
@@ -98,6 +103,13 @@ struct CoinTypeParams
{
/**
+ * How long are the signatures legally valid? Should be
+ * significantly larger than @e duration_spend (i.e. years).
+ */
+ struct GNUNET_TIME_Relative duration_legal;
+
+
+ /**
* How long can the coin be spend? Should be significantly
* larger than @e duration_withdraw (i.e. years).
*/
@@ -232,6 +244,7 @@ hash_coin_type (const struct CoinTypeParams *p,
0,
sizeof (struct CoinTypeNBOP));
p_nbo.duration_spend = GNUNET_TIME_relative_hton (p->duration_spend);
+ p_nbo.duration_legal = GNUNET_TIME_relative_hton (p->duration_legal);
p_nbo.duration_withdraw = GNUNET_TIME_relative_hton (p->duration_withdraw);
TALER_amount_hton (&p_nbo.value,
&p->value);
@@ -608,6 +621,19 @@ get_cointype_params (const char *ct,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (kcfg,
ct,
+ "duration_legal",
+ &params->duration_legal))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ ct,
+ "duration_legal");
+ return GNUNET_SYSERR;
+ }
+ ROUND_TO_SECS (params->duration_legal,
+ rel_value_us);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_time (kcfg,
+ ct,
"duration_overlap",
&params->duration_overlap))
{
@@ -719,7 +745,10 @@ create_denomkey_issue (const struct CoinTypeParams *params,
params->duration_withdraw));
dki->issue.expire_spend =
GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (params->anchor,
- params->duration_spend));
+ params->duration_spend));
+ dki->issue.expire_legal =
+ GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (params->anchor,
+ params->duration_legal));
TALER_amount_hton (&dki->issue.value,
&params->value);
TALER_amount_hton (&dki->issue.fee_withdraw,
diff --git a/src/mint/taler-mint-httpd_keystate.c b/src/mint/taler-mint-httpd_keystate.c
index 33407e020..8caeb2d01 100644
--- a/src/mint/taler-mint-httpd_keystate.c
+++ b/src/mint/taler-mint-httpd_keystate.c
@@ -138,6 +138,8 @@ denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk,
TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->expire_withdraw)),
"stamp_expire_deposit",
TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->expire_spend)),
+ "stamp_expire_legal",
+ TALER_json_from_abs (GNUNET_TIME_absolute_ntoh (dki->expire_legal)),
"denom_pub",
TALER_json_from_rsa_public_key (pk->rsa_public_key),
"value",