This commit is contained in:
Christian Grothoff 2016-05-02 05:10:40 +02:00
parent 1c2be591d3
commit b98a204562
11 changed files with 34 additions and 34 deletions

View File

@ -247,7 +247,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
{ {
struct GNUNET_TIME_Absolute valid_from; struct GNUNET_TIME_Absolute valid_from;
struct GNUNET_TIME_Absolute withdraw_valid_until; struct GNUNET_TIME_Absolute withdraw_valid_until;
struct GNUNET_TIME_Absolute deposit_valid_until; struct GNUNET_TIME_Absolute expire_deposit;
struct GNUNET_TIME_Absolute expire_legal; struct GNUNET_TIME_Absolute expire_legal;
struct TALER_Amount value; struct TALER_Amount value;
struct TALER_Amount fee_withdraw; struct TALER_Amount fee_withdraw;
@ -262,7 +262,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
GNUNET_JSON_spec_fixed_auto ("master_sig", GNUNET_JSON_spec_fixed_auto ("master_sig",
&sig), &sig),
GNUNET_JSON_spec_absolute_time ("stamp_expire_deposit", GNUNET_JSON_spec_absolute_time ("stamp_expire_deposit",
&deposit_valid_until), &expire_deposit),
GNUNET_JSON_spec_absolute_time ("stamp_expire_withdraw", GNUNET_JSON_spec_absolute_time ("stamp_expire_withdraw",
&withdraw_valid_until), &withdraw_valid_until),
GNUNET_JSON_spec_absolute_time ("stamp_start", GNUNET_JSON_spec_absolute_time ("stamp_start",
@ -302,7 +302,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
denom_key_issue.master = *master_key; denom_key_issue.master = *master_key;
denom_key_issue.start = GNUNET_TIME_absolute_hton (valid_from); denom_key_issue.start = GNUNET_TIME_absolute_hton (valid_from);
denom_key_issue.expire_withdraw = GNUNET_TIME_absolute_hton (withdraw_valid_until); denom_key_issue.expire_withdraw = GNUNET_TIME_absolute_hton (withdraw_valid_until);
denom_key_issue.expire_spend = GNUNET_TIME_absolute_hton (deposit_valid_until); denom_key_issue.expire_deposit = GNUNET_TIME_absolute_hton (expire_deposit);
denom_key_issue.expire_legal = GNUNET_TIME_absolute_hton (expire_legal); denom_key_issue.expire_legal = GNUNET_TIME_absolute_hton (expire_legal);
TALER_amount_hton (&denom_key_issue.value, TALER_amount_hton (&denom_key_issue.value,
&value); &value);
@ -326,7 +326,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
denom_key->h_key = denom_key_issue.denom_hash; denom_key->h_key = denom_key_issue.denom_hash;
denom_key->valid_from = valid_from; denom_key->valid_from = valid_from;
denom_key->withdraw_valid_until = withdraw_valid_until; denom_key->withdraw_valid_until = withdraw_valid_until;
denom_key->deposit_valid_until = deposit_valid_until; denom_key->expire_deposit = expire_deposit;
denom_key->expire_legal = expire_legal; denom_key->expire_legal = expire_legal;
denom_key->value = value; denom_key->value = value;
denom_key->fee_withdraw = fee_withdraw; denom_key->fee_withdraw = fee_withdraw;
@ -431,7 +431,7 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
} }
kv.start = GNUNET_TIME_absolute_hton (dk->valid_from); kv.start = GNUNET_TIME_absolute_hton (dk->valid_from);
kv.expire_withdraw = GNUNET_TIME_absolute_hton (dk->withdraw_valid_until); kv.expire_withdraw = GNUNET_TIME_absolute_hton (dk->withdraw_valid_until);
kv.expire_spend = GNUNET_TIME_absolute_hton (dk->deposit_valid_until); kv.expire_deposit = GNUNET_TIME_absolute_hton (dk->expire_deposit);
kv.expire_legal = GNUNET_TIME_absolute_hton (dk->expire_legal); kv.expire_legal = GNUNET_TIME_absolute_hton (dk->expire_legal);
TALER_amount_hton (&kv.value, TALER_amount_hton (&kv.value,
&dk->value); &dk->value);

View File

@ -73,7 +73,7 @@ struct MeltedCoinP
/** /**
* Timestamp indicating when coins of this denomination become invalid. * Timestamp indicating when coins of this denomination become invalid.
*/ */
struct GNUNET_TIME_AbsoluteNBO deposit_valid_until; struct GNUNET_TIME_AbsoluteNBO expire_deposit;
/** /**
* Size of the encoded public key that follows. * Size of the encoded public key that follows.
@ -189,7 +189,7 @@ struct MeltedCoin
/** /**
* Timestamp indicating when coins of this denomination become invalid. * Timestamp indicating when coins of this denomination become invalid.
*/ */
struct GNUNET_TIME_Absolute deposit_valid_until; struct GNUNET_TIME_Absolute expire_deposit;
/** /**
* Denomination key of the original coin. * Denomination key of the original coin.
@ -396,7 +396,7 @@ serialize_melted_coin (const struct MeltedCoin *mc,
&mc->original_value); &mc->original_value);
for (i=0;i<TALER_CNC_KAPPA;i++) for (i=0;i<TALER_CNC_KAPPA;i++)
mcp.transfer_priv[i] = mc->transfer_priv[i]; mcp.transfer_priv[i] = mc->transfer_priv[i];
mcp.deposit_valid_until = GNUNET_TIME_absolute_hton (mc->deposit_valid_until); mcp.expire_deposit = GNUNET_TIME_absolute_hton (mc->expire_deposit);
mcp.pbuf_size = htons ((uint16_t) pbuf_size); mcp.pbuf_size = htons ((uint16_t) pbuf_size);
mcp.sbuf_size = htons ((uint16_t) sbuf_size); mcp.sbuf_size = htons ((uint16_t) sbuf_size);
memcpy (&buf[off], memcpy (&buf[off],
@ -478,7 +478,7 @@ deserialize_melted_coin (struct MeltedCoin *mc,
&mcp.original_value); &mcp.original_value);
for (i=0;i<TALER_CNC_KAPPA;i++) for (i=0;i<TALER_CNC_KAPPA;i++)
mc->transfer_priv[i] = mcp.transfer_priv[i]; mc->transfer_priv[i] = mcp.transfer_priv[i];
mc->deposit_valid_until = GNUNET_TIME_absolute_ntoh (mcp.deposit_valid_until); mc->expire_deposit = GNUNET_TIME_absolute_ntoh (mcp.expire_deposit);
return off; return off;
} }
@ -891,8 +891,8 @@ TALER_EXCHANGE_refresh_prepare (unsigned int num_melts,
md.melted_coins[i].transfer_priv[j].ecdhe_priv = *tpk; md.melted_coins[i].transfer_priv[j].ecdhe_priv = *tpk;
GNUNET_free (tpk); GNUNET_free (tpk);
} }
md.melted_coins[i].deposit_valid_until md.melted_coins[i].expire_deposit
= melt_pks[i].deposit_valid_until; = melt_pks[i].expire_deposit;
md.melted_coins[i].pub_key.rsa_public_key md.melted_coins[i].pub_key.rsa_public_key
= GNUNET_CRYPTO_rsa_public_key_dup (melt_pks[i].key.rsa_public_key); = GNUNET_CRYPTO_rsa_public_key_dup (melt_pks[i].key.rsa_public_key);
md.melted_coins[i].sig.rsa_signature md.melted_coins[i].sig.rsa_signature

View File

@ -118,7 +118,7 @@ print_dk (const struct TALER_DenominationKeyValidityPS *dk)
GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_ntoh (dk->expire_withdraw))); GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_ntoh (dk->expire_withdraw)));
fprintf (stdout, fprintf (stdout,
"Deposit end time: %s\n", "Deposit end time: %s\n",
GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_ntoh (dk->expire_spend))); GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_ntoh (dk->expire_deposit)));
fprintf (stdout, fprintf (stdout,
"Legal dispute end time: %s\n", "Legal dispute end time: %s\n",
GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_ntoh (dk->expire_legal))); GNUNET_STRINGS_absolute_time_to_string (GNUNET_TIME_absolute_ntoh (dk->expire_legal)));
@ -320,7 +320,7 @@ main (int argc,
print_dk (dk); print_dk (dk);
kv.start = dk->start; kv.start = dk->start;
kv.expire_withdraw = dk->expire_withdraw; kv.expire_withdraw = dk->expire_withdraw;
kv.expire_spend = dk->expire_spend; kv.expire_deposit = dk->expire_deposit;
kv.expire_legal = dk->expire_legal; kv.expire_legal = dk->expire_legal;
kv.value = dk->value; kv.value = dk->value;
kv.fee_withdraw = dk->fee_withdraw; kv.fee_withdraw = dk->fee_withdraw;

View File

@ -145,7 +145,7 @@ denomkeys_iter (void *cls,
if ( (0 != GNUNET_TIME_absolute_ntoh (dki->issue.properties.start).abs_value_us % 1000000) || if ( (0 != GNUNET_TIME_absolute_ntoh (dki->issue.properties.start).abs_value_us % 1000000) ||
(0 != GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_withdraw).abs_value_us % 1000000) || (0 != GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_withdraw).abs_value_us % 1000000) ||
(0 != GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_legal).abs_value_us % 1000000) || (0 != GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_legal).abs_value_us % 1000000) ||
(0 != GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_spend).abs_value_us % 1000000) ) (0 != GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_deposit).abs_value_us % 1000000) )
{ {
fprintf (stderr, fprintf (stderr,
"Timestamps are not multiples of a round second\n"); "Timestamps are not multiples of a round second\n");

View File

@ -765,7 +765,7 @@ create_denomkey_issue (const struct CoinTypeParams *params,
dki->issue.properties.expire_withdraw = dki->issue.properties.expire_withdraw =
GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (params->anchor, GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (params->anchor,
params->duration_withdraw)); params->duration_withdraw));
dki->issue.properties.expire_spend = dki->issue.properties.expire_deposit =
GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (params->anchor, GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (params->anchor,
params->duration_spend)); params->duration_spend));
dki->issue.properties.expire_legal = dki->issue.properties.expire_legal =

View File

@ -155,7 +155,7 @@ denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk,
"stamp_expire_withdraw", "stamp_expire_withdraw",
GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_withdraw)), GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_withdraw)),
"stamp_expire_deposit", "stamp_expire_deposit",
GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_spend)), GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_deposit)),
"stamp_expire_legal", "stamp_expire_legal",
GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_legal)), GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (dki->properties.expire_legal)),
"denom_pub", "denom_pub",
@ -236,7 +236,7 @@ reload_keys_denom_iter (void *cls,
return GNUNET_OK; return GNUNET_OK;
} }
now = GNUNET_TIME_absolute_get (); now = GNUNET_TIME_absolute_get ();
if (GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_spend).abs_value_us < if (GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_deposit).abs_value_us <
now.abs_value_us) now.abs_value_us)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@ -749,7 +749,7 @@ TMH_KS_denomination_key_lookup (const struct TMH_KS_StateHandle *key_state,
break; break;
case TMH_KS_DKU_DEPOSIT: case TMH_KS_DKU_DEPOSIT:
if (now.abs_value_us > if (now.abs_value_us >
GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_spend).abs_value_us) GNUNET_TIME_absolute_ntoh (dki->issue.properties.expire_deposit).abs_value_us)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Not returning DKI for %s, as time to spend coin has passed\n", "Not returning DKI for %s, as time to spend coin has passed\n",

View File

@ -66,7 +66,7 @@ PERF_TALER_EXCHANGEDB_denomination_init ()
&properties.master.eddsa_pub); &properties.master.eddsa_pub);
properties.start = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get()); properties.start = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get());
properties.expire_withdraw = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_forever_()); properties.expire_withdraw = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_forever_());
properties.expire_spend = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_forever_()); properties.expire_deposit = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_forever_());
properties.expire_legal = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_forever_()); properties.expire_legal = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_forever_());
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (CURRENCY ":1.1", &amount)); TALER_string_to_amount (CURRENCY ":1.1", &amount));

View File

@ -258,7 +258,7 @@ postgres_create_tables (void *cls,
",master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)" ",master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64)"
",valid_from INT8 NOT NULL" ",valid_from INT8 NOT NULL"
",expire_withdraw INT8 NOT NULL" ",expire_withdraw INT8 NOT NULL"
",expire_spend INT8 NOT NULL" ",expire_deposit INT8 NOT NULL"
",expire_legal INT8 NOT NULL" ",expire_legal INT8 NOT NULL"
",coin_val INT8 NOT NULL" /* value of this denom */ ",coin_val INT8 NOT NULL" /* value of this denom */
",coin_frac INT4 NOT NULL" /* fractional value of this denom */ ",coin_frac INT4 NOT NULL" /* fractional value of this denom */
@ -533,7 +533,7 @@ postgres_prepare (PGconn *db_conn)
",master_sig" ",master_sig"
",valid_from" ",valid_from"
",expire_withdraw" ",expire_withdraw"
",expire_spend" ",expire_deposit"
",expire_legal" ",expire_legal"
",coin_val" /* value of this denom */ ",coin_val" /* value of this denom */
",coin_frac" /* fractional value of this denom */ ",coin_frac" /* fractional value of this denom */
@ -563,7 +563,7 @@ postgres_prepare (PGconn *db_conn)
",master_sig" ",master_sig"
",valid_from" ",valid_from"
",expire_withdraw" ",expire_withdraw"
",expire_spend" ",expire_deposit"
",expire_legal" ",expire_legal"
",coin_val" /* value of this denom */ ",coin_val" /* value of this denom */
",coin_frac" /* fractional value of this denom */ ",coin_frac" /* fractional value of this denom */
@ -1382,7 +1382,7 @@ postgres_insert_denomination_info (void *cls,
GNUNET_PQ_query_param_auto_from_type (&issue->signature), GNUNET_PQ_query_param_auto_from_type (&issue->signature),
GNUNET_PQ_query_param_absolute_time_nbo (&issue->properties.start), GNUNET_PQ_query_param_absolute_time_nbo (&issue->properties.start),
GNUNET_PQ_query_param_absolute_time_nbo (&issue->properties.expire_withdraw), GNUNET_PQ_query_param_absolute_time_nbo (&issue->properties.expire_withdraw),
GNUNET_PQ_query_param_absolute_time_nbo (&issue->properties.expire_spend), GNUNET_PQ_query_param_absolute_time_nbo (&issue->properties.expire_deposit),
GNUNET_PQ_query_param_absolute_time_nbo (&issue->properties.expire_legal), GNUNET_PQ_query_param_absolute_time_nbo (&issue->properties.expire_legal),
TALER_PQ_query_param_amount_nbo (&issue->properties.value), TALER_PQ_query_param_amount_nbo (&issue->properties.value),
TALER_PQ_query_param_amount_nbo (&issue->properties.fee_withdraw), TALER_PQ_query_param_amount_nbo (&issue->properties.fee_withdraw),
@ -1478,8 +1478,8 @@ postgres_get_denomination_info (void *cls,
&issue->properties.start), &issue->properties.start),
GNUNET_PQ_result_spec_absolute_time_nbo ("expire_withdraw", GNUNET_PQ_result_spec_absolute_time_nbo ("expire_withdraw",
&issue->properties.expire_withdraw), &issue->properties.expire_withdraw),
GNUNET_PQ_result_spec_absolute_time_nbo ("expire_spend", GNUNET_PQ_result_spec_absolute_time_nbo ("expire_deposit",
&issue->properties.expire_spend), &issue->properties.expire_deposit),
GNUNET_PQ_result_spec_absolute_time_nbo ("expire_legal", GNUNET_PQ_result_spec_absolute_time_nbo ("expire_legal",
&issue->properties.expire_legal), &issue->properties.expire_legal),
TALER_PQ_result_spec_amount_nbo ("coin", TALER_PQ_result_spec_amount_nbo ("coin",

View File

@ -137,7 +137,7 @@ create_denom_key_pair (unsigned int size,
dki.issue.properties.expire_withdraw = GNUNET_TIME_absolute_hton dki.issue.properties.expire_withdraw = GNUNET_TIME_absolute_hton
(GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (), (GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
GNUNET_TIME_UNIT_HOURS)); GNUNET_TIME_UNIT_HOURS));
dki.issue.properties.expire_spend = GNUNET_TIME_absolute_hton dki.issue.properties.expire_deposit = GNUNET_TIME_absolute_hton
(GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_add
(GNUNET_TIME_absolute_get (), (GNUNET_TIME_absolute_get (),
GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 2))); GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 2)));

View File

@ -95,14 +95,14 @@ struct TALER_EXCHANGE_DenomPublicKey
/** /**
* Timestamp indicating when coins of this denomination become invalid. * Timestamp indicating when coins of this denomination become invalid.
*/ */
struct GNUNET_TIME_Absolute deposit_valid_until; struct GNUNET_TIME_Absolute expire_deposit;
/** /**
* When do signatures with this denomination key become invalid? * When do signatures with this denomination key become invalid?
* After this point, these signatures cannot be used in (legal) * After this point, these signatures cannot be used in (legal)
* disputes anymore, as the Exchange is then allowed to destroy its side * disputes anymore, as the Exchange is then allowed to destroy its side
* of the evidence. @e expire_legal is expected to be significantly * of the evidence. @e expire_legal is expected to be significantly
* larger than @e expire_spend (by a year or more). * larger than @e expire_deposit (by a year or more).
*/ */
struct GNUNET_TIME_Absolute expire_legal; struct GNUNET_TIME_Absolute expire_legal;

View File

@ -659,18 +659,18 @@ struct TALER_DenominationKeyValidityPS
* exchange will refuse transactions involving this key as it will * exchange will refuse transactions involving this key as it will
* "drop" the table with double-spending information (shortly after) * "drop" the table with double-spending information (shortly after)
* this time. Note that wallets should refresh coins significantly * this time. Note that wallets should refresh coins significantly
* before this time to be on the safe side. @e expire_spend must be * before this time to be on the safe side. @e expire_deposit must be
* significantly larger than @e expire_withdraw (by months or even * significantly larger than @e expire_withdraw (by months or even
* years). * years).
*/ */
struct GNUNET_TIME_AbsoluteNBO expire_spend; struct GNUNET_TIME_AbsoluteNBO expire_deposit;
/** /**
* When do signatures with this denomination key become invalid? * When do signatures with this denomination key become invalid?
* After this point, these signatures cannot be used in (legal) * After this point, these signatures cannot be used in (legal)
* disputes anymore, as the Exchange is then allowed to destroy its side * disputes anymore, as the Exchange is then allowed to destroy its side
* of the evidence. @e expire_legal is expected to be significantly * of the evidence. @e expire_legal is expected to be significantly
* larger than @e expire_spend (by a year or more). * larger than @e expire_deposit (by a year or more).
*/ */
struct GNUNET_TIME_AbsoluteNBO expire_legal; struct GNUNET_TIME_AbsoluteNBO expire_legal;
@ -762,18 +762,18 @@ struct TALER_ExchangeKeyValidityPS
* exchange will refuse transactions involving this key as it will * exchange will refuse transactions involving this key as it will
* "drop" the table with double-spending information (shortly after) * "drop" the table with double-spending information (shortly after)
* this time. Note that wallets should refresh coins significantly * this time. Note that wallets should refresh coins significantly
* before this time to be on the safe side. @e expire_spend must be * before this time to be on the safe side. @e expire_deposit must be
* significantly larger than @e expire_withdraw (by months or even * significantly larger than @e expire_withdraw (by months or even
* years). * years).
*/ */
struct GNUNET_TIME_AbsoluteNBO expire_spend; struct GNUNET_TIME_AbsoluteNBO expire_deposit;
/** /**
* When do signatures with this denomination key become invalid? * When do signatures with this denomination key become invalid?
* After this point, these signatures cannot be used in (legal) * After this point, these signatures cannot be used in (legal)
* disputes anymore, as the Exchange is then allowed to destroy its side * disputes anymore, as the Exchange is then allowed to destroy its side
* of the evidence. @e expire_legal is expected to be significantly * of the evidence. @e expire_legal is expected to be significantly
* larger than @e expire_spend (by a year or more). * larger than @e expire_deposit (by a year or more).
*/ */
struct GNUNET_TIME_AbsoluteNBO expire_legal; struct GNUNET_TIME_AbsoluteNBO expire_legal;