aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-12-25 14:58:04 +0100
committerChristian Grothoff <christian@grothoff.org>2021-12-25 14:58:04 +0100
commit84c9adf5a6a243bd583f2144176f80708fa6a884 (patch)
tree28817239e3bad33c71f4aa34b666599c483b82fc /src/include
parent1c34489905a5809bc238f173fee99b7aa7ff5359 (diff)
v12: also do not sign over merchant_pub in REFUND signature, centralize logic
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_crypto_lib.h44
-rw-r--r--src/include/taler_signatures.h6
2 files changed, 44 insertions, 6 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 03edb446..db38c0c2 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -1897,6 +1897,50 @@ TALER_wallet_recoup_refresh_sign (
struct TALER_CoinSpendSignatureP *coin_sig);
+/* ********************* merchant signing ************************** */
+
+
+/**
+ * Create merchant signature approving a refund.
+ *
+ * @param coin_pub coin to be refunded
+ * @param h_contract_terms contract to be refunded
+ * @param rtransaction_id unique ID for this (partial) refund
+ * @param amount amount to be refunded
+ * @param merchant_priv private key to sign with
+ * @param[out] merchant_sig where to write the signature
+ */
+void
+TALER_merchant_refund_sign (
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_PrivateContractHash *h_contract_terms,
+ uint64_t rtransaction_id,
+ const struct TALER_Amount *amount,
+ const struct TALER_MerchantPrivateKeyP *merchant_priv,
+ struct TALER_MerchantSignatureP *merchant_sig);
+
+
+/**
+ * Verify merchant signature approving a refund.
+ *
+ * @param coin_pub coin to be refunded
+ * @param h_contract_terms contract to be refunded
+ * @param rtransaction_id unique ID for this (partial) refund
+ * @param amount amount to be refunded
+ * @param merchant_pub public key of the merchant
+ * @param merchant_sig signature to verify
+ * @return #GNUNET_OK if the signature is valid
+ */
+enum GNUNET_GenericReturnValue
+TALER_merchant_refund_verify (
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_PrivateContractHash *h_contract_terms,
+ uint64_t rtransaction_id,
+ const struct TALER_Amount *amount,
+ const struct TALER_MerchantPublicKeyP *merchant_pub,
+ const struct TALER_MerchantSignatureP *merchant_sig);
+
+
/* ********************* offline signing ************************** */
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index abd10323..bcfa863c 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -631,12 +631,6 @@ struct TALER_RefundRequestPS
struct TALER_CoinSpendPublicKeyP coin_pub;
/**
- * 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;
-
- /**
* Merchant-generated transaction ID for the refund.
*/
uint64_t rtransaction_id GNUNET_PACKED;