summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-11-06 19:43:47 +0100
committerChristian Grothoff <christian@grothoff.org>2021-11-06 19:43:47 +0100
commit9d6e1040669435dfa2ab93abd4f1669c7bf90871 (patch)
treec072a1284e6b3da14f972d98197d22f4d14500d5 /src/include
parent57acad487de0ecb3f964c83a60e4f2d7d1ec460b (diff)
downloadexchange-9d6e1040669435dfa2ab93abd4f1669c7bf90871.tar.gz
exchange-9d6e1040669435dfa2ab93abd4f1669c7bf90871.tar.bz2
exchange-9d6e1040669435dfa2ab93abd4f1669c7bf90871.zip
include h_extensions in deposit confirmation
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_auditor_service.h2
-rw-r--r--src/include/taler_auditordb_plugin.h5
-rw-r--r--src/include/taler_crypto_lib.h34
-rw-r--r--src/include/taler_signatures.h18
-rw-r--r--src/include/taler_testing_lib.h2
5 files changed, 57 insertions, 4 deletions
diff --git a/src/include/taler_auditor_service.h b/src/include/taler_auditor_service.h
index 9e2e46d28..4da72c1c4 100644
--- a/src/include/taler_auditor_service.h
+++ b/src/include/taler_auditor_service.h
@@ -235,6 +235,7 @@ typedef void
* @param h_wire hash of merchant wire details
* @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 contract was finalized, must not be too far in the future
+ * @param wire_deadline date until which the exchange should wire the funds
* @param refund_deadline date until which the merchant can issue a refund to the customer via the auditor (can be zero if refunds are not allowed); must not be after the @a wire_deadline
* @param amount_without_fee the amount confirmed to be wired by the exchange to the merchant
* @param coin_pub coin’s public key
@@ -257,6 +258,7 @@ TALER_AUDITOR_deposit_confirmation (
const struct TALER_MerchantWireHash *h_wire,
const struct TALER_PrivateContractHash *h_contract_terms,
struct GNUNET_TIME_Absolute timestamp,
+ struct GNUNET_TIME_Absolute wire_deadline,
struct GNUNET_TIME_Absolute refund_deadline,
const struct TALER_Amount *amount_without_fee,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h
index 18db86946..8dd454b97 100644
--- a/src/include/taler_auditordb_plugin.h
+++ b/src/include/taler_auditordb_plugin.h
@@ -296,6 +296,11 @@ struct TALER_AUDITORDB_DepositConfirmation
struct GNUNET_TIME_Absolute refund_deadline;
/**
+ * How much time does the @e exchange have to wire the funds?
+ */
+ struct GNUNET_TIME_Absolute wire_deadline;
+
+ /**
* Amount to be deposited, excluding fee. Calculated from the
* amount with fee and the fee from the deposit request.
*/
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 881e368ee..7787c23d8 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -1547,6 +1547,40 @@ TALER_CRYPTO_helper_esign_disconnect (
struct TALER_CRYPTO_ExchangeSignHelper *esh);
+/* ********************* exchange signing ************************** */
+
+
+/**
+ * Verify a deposit confirmation.
+ *
+ * @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the exchange)
+ * @param h_wire hash of the merchant’s account details
+ * @param h_extensions hash over the extensions, can be NULL
+ * @param exchange_timestamp timestamp when the contract was finalized, must not be too far off
+ * @param wire_deadline date until which the exchange should wire the funds
+ * @param refund_deadline date until which the merchant can issue a refund to the customer via the exchange (can be zero if refunds are not allowed); must not be after the @a wire_deadline
+ * @param amount_without_fee the amount to be deposited after fees
+ * @param coin_pub public key of the deposited coin
+ * @param merchant_pub the public key of the merchant (used to identify the merchant for refund requests)
+ * @param exchange_pub exchange's online signing public key
+ * @param exchange_sig the signature made with purpose #TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT
+ * @return #GNUNET_OK if the signature is valid
+ */
+enum GNUNET_GenericReturnValue
+TALER_exchange_deposit_confirm_verify (
+ const struct TALER_PrivateContractHash *h_contract_terms,
+ const struct TALER_MerchantWireHash *h_wire,
+ const struct TALER_ExtensionContractHash *h_extensions,
+ struct GNUNET_TIME_Absolute exchange_timestamp,
+ struct GNUNET_TIME_Absolute wire_deadline,
+ struct GNUNET_TIME_Absolute refund_deadline,
+ const struct TALER_Amount *amount_without_fee,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct TALER_ExchangePublicKeyP *exchange_pub,
+ const struct TALER_ExchangeSignatureP *exchange_sig);
+
+
/* ********************* wallet signing ************************** */
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index 5eef0db6f..40755348d 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -556,12 +556,24 @@ struct TALER_DepositConfirmationPS
struct TALER_MerchantWireHash h_wire GNUNET_PACKED;
/**
+ * Hash over the extension options of the deposit, 0 if there
+ * were not extension options.
+ */
+ struct TALER_ExtensionContractHash h_extensions GNUNET_PACKED;
+
+ /**
* Time when this confirmation was generated / when the exchange received
* the deposit request.
*/
struct GNUNET_TIME_AbsoluteNBO exchange_timestamp;
/**
+ * By when does the exchange expect to pay the merchant
+ * (as per the merchant's request).
+ */
+ struct GNUNET_TIME_AbsoluteNBO wire_deadline;
+
+ /**
* How much time does the @e merchant have to issue a refund
* request? Zero if refunds are not allowed. After this time, the
* coin cannot be refunded. Note that the wire transfer will not be
@@ -577,9 +589,7 @@ struct TALER_DepositConfirmationPS
struct TALER_AmountNBO amount_without_fee;
/**
- * The coin's public key. This is the value that must have been
- * signed (blindly) by the Exchange. The deposit request is to be
- * signed by the corresponding private key (using EdDSA).
+ * The public key of the coin that was deposited.
*/
struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -587,7 +597,7 @@ struct TALER_DepositConfirmationPS
* The Merchant's public key. Allows the merchant to later refund
* the transaction or to inquire about the wire transfer identifier.
*/
- struct TALER_MerchantPublicKeyP merchant;
+ struct TALER_MerchantPublicKeyP merchant_pub;
};
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 2656300fe..e99912a64 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -2379,6 +2379,8 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits,
op (coin_priv, const struct TALER_CoinSpendPrivateKeyP) \
op (coin_pub, const struct TALER_CoinSpendPublicKeyP) \
op (absolute_time, const struct GNUNET_TIME_Absolute) \
+ op (wire_deadline, const struct GNUNET_TIME_Absolute) \
+ op (refund_deadline, const struct GNUNET_TIME_Absolute) \
op (exchange_pub, const struct TALER_ExchangePublicKeyP) \
op (exchange_sig, const struct TALER_ExchangeSignatureP) \
op (blinding_key, const union TALER_DenominationBlindingKeyP)