From 98cbd77432b0e9fc656479043a4d2b6e2e49572a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 28 Mar 2015 18:23:45 +0100 Subject: fix use of struct TALER_DenominationKeyValidityPS --- src/mint-tools/taler-mint-keyup.c | 31 ++++++++++++++++++++++++++++++- src/mint/taler-mint-httpd_keystate.c | 2 ++ 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'src') 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 @@ -53,6 +53,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? */ @@ -97,6 +102,13 @@ GNUNET_NETWORK_STRUCT_END 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); @@ -605,6 +618,19 @@ get_cointype_params (const char *ct, } ROUND_TO_SECS (params->duration_spend, rel_value_us); + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_time (kcfg, + ct, + "duration_legal", + ¶ms->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, @@ -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, ¶ms->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", -- cgit v1.2.3