aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-05 21:33:30 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-05 21:33:30 +0100
commite0b62b0a49672bd259ed47c9448b78c9be8823f7 (patch)
treec4c78b825f88ed6c01b2b2b5b9f78970f3a75f7a /src/lib
parent719779577a4c336126f0bbb77f947ea892a3cdd3 (diff)
towards offline tool uploading /management/keys
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/exchange_api_handle.c46
1 files changed, 14 insertions, 32 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index ed6093556..e630adf91 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -472,39 +472,21 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
sizeof (struct GNUNET_HashCode));
if (! check_sigs)
return GNUNET_OK;
- {
- struct TALER_DenominationKeyValidityPS denom_key_issue = {
- .purpose.purpose
- = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY),
- .purpose.size = htonl (sizeof (denom_key_issue)),
- .master = *master_key,
- .denom_hash = denom_key->h_key,
- .start = GNUNET_TIME_absolute_hton (denom_key->valid_from),
- .expire_withdraw
- = GNUNET_TIME_absolute_hton (denom_key->withdraw_valid_until),
- .expire_deposit = GNUNET_TIME_absolute_hton (denom_key->expire_deposit),
- .expire_legal = GNUNET_TIME_absolute_hton (denom_key->expire_legal)
- };
-
- TALER_amount_hton (&denom_key_issue.value,
- &denom_key->value);
- TALER_amount_hton (&denom_key_issue.fee_withdraw,
- &denom_key->fee_withdraw);
- TALER_amount_hton (&denom_key_issue.fee_deposit,
- &denom_key->fee_deposit);
- TALER_amount_hton (&denom_key_issue.fee_refresh,
- &denom_key->fee_refresh);
- TALER_amount_hton (&denom_key_issue.fee_refund,
- &denom_key->fee_refund);
- EXITIF (GNUNET_SYSERR ==
- GNUNET_CRYPTO_eddsa_verify (
- TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
- &denom_key_issue,
- &denom_key->master_sig.eddsa_signature,
- &master_key->eddsa_pub));
- }
+ EXITIF (GNUNET_SYSERR ==
+ TALER_exchange_offline_denom_validity_verify (
+ &denom_key->h_key,
+ denom_key->valid_from,
+ denom_key->withdraw_valid_until,
+ denom_key->expire_deposit,
+ denom_key->expire_legal,
+ &denom_key->value,
+ &denom_key->fee_withdraw,
+ &denom_key->fee_deposit,
+ &denom_key->fee_refresh,
+ &denom_key->fee_refund,
+ master_key,
+ &denom_key->master_sig));
return GNUNET_OK;
-
EXITIF_exit:
/* invalidate denom_key, just to be sure */
memset (denom_key,