summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_responses.c
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/exchange/taler-exchange-httpd_responses.c
parent1c34489905a5809bc238f173fee99b7aa7ff5359 (diff)
downloadexchange-84c9adf5a6a243bd583f2144176f80708fa6a884.tar.gz
exchange-84c9adf5a6a243bd583f2144176f80708fa6a884.tar.bz2
exchange-84c9adf5a6a243bd583f2144176f80708fa6a884.zip
v12: also do not sign over merchant_pub in REFUND signature, centralize logic
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index 5739e6709..66a3b0af9 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -165,25 +165,15 @@ TEH_RESPONSE_compile_transaction_history (
const struct TALER_EXCHANGEDB_RefundListEntry *refund =
pos->details.refund;
struct TALER_Amount value;
- // FIXME: move to libtalerutil!
- struct TALER_RefundRequestPS rr = {
- .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND),
- .purpose.size = htonl (sizeof (rr)),
- .h_contract_terms = refund->h_contract_terms,
- .coin_pub = *coin_pub,
- .merchant = refund->merchant_pub,
- .rtransaction_id = GNUNET_htonll (refund->rtransaction_id)
- };
- TALER_amount_hton (&rr.refund_amount,
- &refund->refund_amount);
#if ENABLE_SANITY_CHECKS
- /* internal sanity check before we hand out a bogus sig... */
if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_REFUND,
- &rr,
- &refund->merchant_sig.eddsa_sig,
- &refund->merchant_pub.eddsa_pub))
+ TALER_merchant_refund_verify (coin_pub,
+ &refund->h_contract_terms,
+ refund->rtransaction_id,
+ &refund->refund_amount,
+ &refund->merchant_pub,
+ &refund->merchant_sig))
{
GNUNET_break (0);
json_decref (history);