From c0f992290a61e67f08e720649673951ef86638b5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Sep 2020 01:25:54 +0200 Subject: fix #6568 --- src/lib/merchant_api_post_order_abort.c | 50 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'src/lib/merchant_api_post_order_abort.c') diff --git a/src/lib/merchant_api_post_order_abort.c b/src/lib/merchant_api_post_order_abort.c index 98752af6..05896d47 100644 --- a/src/lib/merchant_api_post_order_abort.c +++ b/src/lib/merchant_api_post_order_abort.c @@ -136,12 +136,9 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah, { json_t *refund = json_array_get (refunds, i); uint32_t exchange_status; - json_t *exchange_reply; struct GNUNET_JSON_Specification spec_es[] = { - GNUNET_JSON_spec_uint32 ("exchange_http_status", + GNUNET_JSON_spec_uint32 ("exchange_status", &exchange_status), - GNUNET_JSON_spec_json ("exchange_reply", - &exchange_reply), GNUNET_JSON_spec_end () }; @@ -165,7 +162,7 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah, }; if (GNUNET_OK != - GNUNET_JSON_parse (exchange_reply, + GNUNET_JSON_parse (refund, spec_detail, NULL, NULL)) { @@ -173,29 +170,30 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah, GNUNET_JSON_parse_free (spec); return GNUNET_SYSERR; } - } - - { - struct TALER_RefundConfirmationPS rr = { - .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND), - .purpose.size = htonl (sizeof (rr)), - .h_contract_terms = oah->h_contract_terms, - .coin_pub = oah->coins[i].coin_pub, - .merchant = oah->merchant_pub, - .rtransaction_id = GNUNET_htonll (0) - }; - TALER_amount_hton (&rr.refund_amount, - &oah->coins[i].amount_with_fee); - if (GNUNET_OK != - GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND, - &rr, - &res[i].exchange_sig.eddsa_signature, - &res[i].exchange_pub.eddsa_pub)) { - GNUNET_break_op (0); - GNUNET_JSON_parse_free (spec); - return GNUNET_SYSERR; + struct TALER_RefundConfirmationPS rr = { + .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND), + .purpose.size = htonl (sizeof (rr)), + .h_contract_terms = oah->h_contract_terms, + .coin_pub = oah->coins[i].coin_pub, + .merchant = oah->merchant_pub, + .rtransaction_id = GNUNET_htonll (0) + }; + + TALER_amount_hton (&rr.refund_amount, + &oah->coins[i].amount_with_fee); + if (GNUNET_OK != + GNUNET_CRYPTO_eddsa_verify ( + TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND, + &rr, + &res[i].exchange_sig.eddsa_signature, + &res[i].exchange_pub.eddsa_pub)) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return GNUNET_SYSERR; + } } } } -- cgit v1.2.3