summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorThien-Thi Nguyen <ttn@gnuvola.org>2022-04-17 19:55:14 -0400
committerThien-Thi Nguyen <ttn@gnuvola.org>2022-04-17 19:55:14 -0400
commit1d6158c4c4e082cf1840aabb96eb6610c4ae465c (patch)
treef33966e79b6d2b48d1c0041324fe3b05a1b272c1 /src/backend
parent6945c4865a7c373eef8ee90bf1a767b6df9bc292 (diff)
downloadmerchant-1d6158c4c4e082cf1840aabb96eb6610c4ae465c.tar.gz
merchant-1d6158c4c4e082cf1840aabb96eb6610c4ae465c.tar.bz2
merchant-1d6158c4c4e082cf1840aabb96eb6610c4ae465c.zip
Use new exchange func: TALER_merchant_contract_sign
* src/backend/taler-merchant-httpd_post-orders-ID-claim.c (TMH_post_orders_ID_claim): Rework to use ‘TALER_merchant_contract_sign’.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-claim.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c
index 3d8a7d01..1ea4323a 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c
@@ -265,11 +265,9 @@ TMH_post_orders_ID_claim (const struct TMH_RequestHandler *rh,
/* create contract signature */
{
+ struct TALER_PrivateContractHashP hash;
struct GNUNET_CRYPTO_EddsaSignature merchant_sig;
- struct TALER_ProposalDataPS pdps = {
- .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_CONTRACT),
- .purpose.size = htonl (sizeof (pdps))
- };
+
/**
* Hash of the JSON contract in UTF-8 including 0-termination,
* using JSON_COMPACT | JSON_SORT_KEYS
@@ -277,7 +275,7 @@ TMH_post_orders_ID_claim (const struct TMH_RequestHandler *rh,
if (GNUNET_OK !=
TALER_JSON_contract_hash (contract_terms,
- &pdps.hash))
+ &hash))
{
GNUNET_break (0);
json_decref (contract_terms);
@@ -287,9 +285,9 @@ TMH_post_orders_ID_claim (const struct TMH_RequestHandler *rh,
NULL);
}
- GNUNET_CRYPTO_eddsa_sign (&hc->instance->merchant_priv.eddsa_priv,
- &pdps,
- &merchant_sig);
+ TALER_merchant_contract_sign (&hash,
+ &hc->instance->merchant_priv,
+ &merchant_sig);
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_OK,