diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-10-05 19:26:04 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-10-05 19:26:04 +0200 |
commit | 1f6c8d0c33e054723115333d94d634a16ddaa7c2 (patch) | |
tree | 1895cb134830f9c836275dc7e0552a8fabfa65da /src/lib | |
parent | bcbd909892257d32bcc8ebc85ac2413fc3a26062 (diff) |
refactor h_extensions -> h_policy, and structs accordingly
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/auditor_api_deposit_confirmation.c | 14 | ||||
-rw-r--r-- | src/lib/exchange_api_batch_deposit.c | 14 | ||||
-rw-r--r-- | src/lib/exchange_api_common.c | 11 | ||||
-rw-r--r-- | src/lib/exchange_api_common.h | 4 | ||||
-rw-r--r-- | src/lib/exchange_api_deposit.c | 14 | ||||
-rw-r--r-- | src/lib/exchange_api_refund.c | 9 |
6 files changed, 38 insertions, 28 deletions
diff --git a/src/lib/auditor_api_deposit_confirmation.c b/src/lib/auditor_api_deposit_confirmation.c index c4542d0e..0dc3ed1e 100644 --- a/src/lib/auditor_api_deposit_confirmation.c +++ b/src/lib/auditor_api_deposit_confirmation.c @@ -153,7 +153,7 @@ handle_deposit_confirmation_finished (void *cls, * Verify signature information about the deposit-confirmation. * * @param h_wire hash of merchant wire details - * @param h_extensions hash over the extensions, if any + * @param h_policy hash over the extensions, if any * @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the auditor) * @param exchange_timestamp timestamp when the deposit was received by the wallet * @param wire_deadline by what time must the amount be wired to the merchant @@ -172,7 +172,7 @@ handle_deposit_confirmation_finished (void *cls, */ static enum GNUNET_GenericReturnValue verify_signatures (const struct TALER_MerchantWireHashP *h_wire, - const struct TALER_ExtensionContractHashP *h_extensions, + const struct TALER_ExtensionPolicyHashP *h_policy, const struct TALER_PrivateContractHashP *h_contract_terms, struct GNUNET_TIME_Timestamp exchange_timestamp, struct GNUNET_TIME_Timestamp wire_deadline, @@ -192,7 +192,7 @@ verify_signatures (const struct TALER_MerchantWireHashP *h_wire, TALER_exchange_online_deposit_confirmation_verify ( h_contract_terms, h_wire, - h_extensions, + h_policy, exchange_timestamp, wire_deadline, refund_deadline, @@ -239,7 +239,7 @@ struct TALER_AUDITOR_DepositConfirmationHandle * TALER_AUDITOR_deposit_confirmation ( struct TALER_AUDITOR_Handle *auditor, const struct TALER_MerchantWireHashP *h_wire, - const struct TALER_ExtensionContractHashP *h_extensions, + const struct TALER_ExtensionPolicyHashP *h_policy, const struct TALER_PrivateContractHashP *h_contract_terms, struct GNUNET_TIME_Timestamp exchange_timestamp, struct GNUNET_TIME_Timestamp wire_deadline, @@ -266,7 +266,7 @@ TALER_AUDITOR_deposit_confirmation ( TALER_AUDITOR_handle_is_ready_ (auditor)); if (GNUNET_OK != verify_signatures (h_wire, - h_extensions, + h_policy, h_contract_terms, exchange_timestamp, wire_deadline, @@ -290,8 +290,8 @@ TALER_AUDITOR_deposit_confirmation ( = GNUNET_JSON_PACK ( GNUNET_JSON_pack_data_auto ("h_wire", h_wire), - GNUNET_JSON_pack_data_auto ("h_extensions", - h_extensions), + GNUNET_JSON_pack_data_auto ("h_policy", + h_policy), GNUNET_JSON_pack_data_auto ("h_contract_terms", h_contract_terms), GNUNET_JSON_pack_timestamp ("exchange_timestamp", diff --git a/src/lib/exchange_api_batch_deposit.c b/src/lib/exchange_api_batch_deposit.c index 39c1c9b4..43f7d2d4 100644 --- a/src/lib/exchange_api_batch_deposit.c +++ b/src/lib/exchange_api_batch_deposit.c @@ -97,9 +97,9 @@ struct TALER_EXCHANGE_BatchDepositHandle struct TALER_MerchantWireHashP h_wire; /** - * Hash over the extensions, or all zero. + * Hash over the policy, or all zero. */ - struct TALER_ExtensionContractHashP h_extensions; + struct TALER_ExtensionPolicyHashP h_policy; /** * Time when this confirmation was generated / when the exchange received @@ -185,7 +185,7 @@ auditor_cb (void *cls, aie->dch = TALER_AUDITOR_deposit_confirmation ( ah, &dh->h_wire, - &dh->h_extensions, + &dh->h_policy, &dh->dcd.h_contract_terms, dh->exchange_timestamp, dh->dcd.wire_deadline, @@ -317,7 +317,7 @@ handle_deposit_finished (void *cls, TALER_exchange_online_deposit_confirmation_verify ( &dh->dcd.h_contract_terms, &dh->h_wire, - &dh->h_extensions, + &dh->h_policy, dh->exchange_timestamp, dh->dcd.wire_deadline, dh->dcd.refund_deadline, @@ -493,8 +493,8 @@ TALER_EXCHANGE_batch_deposit ( dh->num_cdds = num_cdds; dh->dcd = *dcd; if (NULL != dcd->extension_details) - TALER_deposit_extension_hash (dcd->extension_details, - &dh->h_extensions); + TALER_deposit_policy_hash (dcd->extension_details, + &dh->h_policy); TALER_merchant_wire_signature_hash (dcd->merchant_payto_uri, &dcd->wire_salt, &dh->h_wire); @@ -533,7 +533,7 @@ TALER_EXCHANGE_batch_deposit ( if (GNUNET_OK != TALER_EXCHANGE_verify_deposit_signature_ (dcd, - &dh->h_extensions, + &dh->h_policy, &dh->h_wire, cdd, dki)) diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c index 2cb379f8..30d609bd 100644 --- a/src/lib/exchange_api_common.c +++ b/src/lib/exchange_api_common.c @@ -724,7 +724,8 @@ help_deposit (struct CoinHistoryParseContext *pc, { struct TALER_MerchantWireHashP h_wire; struct TALER_PrivateContractHashP h_contract_terms; - // struct TALER_ExtensionContractHashP h_extensions; // FIXME #7270! + struct TALER_ExtensionPolicyHashP h_policy; + bool no_h_policy; struct GNUNET_TIME_Timestamp wallet_timestamp; struct TALER_MerchantPublicKeyP merchant_pub; struct GNUNET_TIME_Timestamp refund_deadline = {0}; @@ -740,6 +741,10 @@ help_deposit (struct CoinHistoryParseContext *pc, GNUNET_JSON_spec_fixed_auto ("h_wire", &h_wire), GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_fixed_auto ("h_policy", + &h_policy), + &no_h_policy), + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("h_age_commitment", &hac), &no_hac), @@ -771,7 +776,7 @@ help_deposit (struct CoinHistoryParseContext *pc, &h_wire, &h_contract_terms, no_hac ? NULL : &hac, - NULL /* h_extensions! */, + no_h_policy ? NULL : &h_policy, &pc->dk->h_key, wallet_timestamp, &merchant_pub, @@ -1905,7 +1910,7 @@ TALER_EXCHANGE_get_min_denomination_ ( enum GNUNET_GenericReturnValue TALER_EXCHANGE_verify_deposit_signature_ ( const struct TALER_EXCHANGE_DepositContractDetail *dcd, - const struct TALER_ExtensionContractHashP *ech, + const struct TALER_ExtensionPolicyHashP *ech, const struct TALER_MerchantWireHashP *h_wire, const struct TALER_EXCHANGE_CoinDepositDetail *cdd, const struct TALER_EXCHANGE_DenomPublicKey *dki) diff --git a/src/lib/exchange_api_common.h b/src/lib/exchange_api_common.h index a75ed3ed..1412ddb1 100644 --- a/src/lib/exchange_api_common.h +++ b/src/lib/exchange_api_common.h @@ -203,7 +203,7 @@ TALER_EXCHANGE_get_min_denomination_ ( * Verify signature information about the deposit. * * @param dcd contract details - * @param ech hashed contract (passed to avoid recomputation) + * @param eph hashed policy (passed to avoid recomputation) * @param h_wire hashed wire details (passed to avoid recomputation) * @param cdd coin-specific details * @param dki denomination of the coin @@ -212,7 +212,7 @@ TALER_EXCHANGE_get_min_denomination_ ( enum GNUNET_GenericReturnValue TALER_EXCHANGE_verify_deposit_signature_ ( const struct TALER_EXCHANGE_DepositContractDetail *dcd, - const struct TALER_ExtensionContractHashP *ech, + const struct TALER_ExtensionPolicyHashP *eph, const struct TALER_MerchantWireHashP *h_wire, const struct TALER_EXCHANGE_CoinDepositDetail *cdd, const struct TALER_EXCHANGE_DenomPublicKey *dki); diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c index 3ba986b2..074f2eb4 100644 --- a/src/lib/exchange_api_deposit.c +++ b/src/lib/exchange_api_deposit.c @@ -97,9 +97,9 @@ struct TALER_EXCHANGE_DepositHandle struct TALER_MerchantWireHashP h_wire; /** - * Hash over the extensions, or all zero. + * Hash over the policy, or all zero. */ - struct TALER_ExtensionContractHashP h_extensions; + struct TALER_ExtensionPolicyHashP h_policy; /** * Time when this confirmation was generated / when the exchange received @@ -177,7 +177,7 @@ auditor_cb (void *cls, aie->dch = TALER_AUDITOR_deposit_confirmation ( ah, &dh->h_wire, - &dh->h_extensions, + &dh->h_policy, &dh->dcd.h_contract_terms, dh->exchange_timestamp, dh->dcd.wire_deadline, @@ -277,7 +277,7 @@ handle_deposit_finished (void *cls, TALER_exchange_online_deposit_confirmation_verify ( &dh->dcd.h_contract_terms, &dh->h_wire, - &dh->h_extensions, + &dh->h_policy, dh->exchange_timestamp, dh->dcd.wire_deadline, dh->dcd.refund_deadline, @@ -447,14 +447,14 @@ TALER_EXCHANGE_deposit ( dh->cdd = *cdd; dh->dcd = *dcd; if (NULL != dcd->extension_details) - TALER_deposit_extension_hash (dcd->extension_details, - &dh->h_extensions); + TALER_deposit_policy_hash (dcd->extension_details, + &dh->h_policy); TALER_merchant_wire_signature_hash (dcd->merchant_payto_uri, &dcd->wire_salt, &dh->h_wire); if (GNUNET_OK != TALER_EXCHANGE_verify_deposit_signature_ (dcd, - &dh->h_extensions, + &dh->h_policy, &dh->h_wire, cdd, dki)) diff --git a/src/lib/exchange_api_refund.c b/src/lib/exchange_api_refund.c index a937c18a..e5409ce1 100644 --- a/src/lib/exchange_api_refund.c +++ b/src/lib/exchange_api_refund.c @@ -236,7 +236,8 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, struct TALER_PrivateContractHashP h_contract_terms; struct TALER_AgeCommitmentHash h_age_commitment; bool no_hac; - // struct TALER_ExtensionContractHashP h_extensions; // FIXME #7270! + struct TALER_ExtensionPolicyHashP h_policy; + bool no_h_policy; struct GNUNET_TIME_Timestamp wallet_timestamp; struct TALER_MerchantPublicKeyP merchant_pub; struct GNUNET_TIME_Timestamp refund_deadline; @@ -252,6 +253,10 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, GNUNET_JSON_spec_fixed_auto ("h_age_commitment", &h_age_commitment), &no_hac), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_fixed_auto ("h_policy", + &h_policy), + &no_h_policy), GNUNET_JSON_spec_timestamp ("timestamp", &wallet_timestamp), GNUNET_JSON_spec_timestamp ("refund_deadline", @@ -280,7 +285,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh, no_hac ? NULL : &h_age_commitment, - NULL /* FIXME #7270-OEC: h_extensions! */, + no_h_policy ? NULL : &h_policy, &h_denom_pub, wallet_timestamp, &merchant_pub, |