diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-06 19:43:47 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-06 19:43:47 +0100 |
commit | 9d6e1040669435dfa2ab93abd4f1669c7bf90871 (patch) | |
tree | c072a1284e6b3da14f972d98197d22f4d14500d5 /src/auditor | |
parent | 57acad487de0ecb3f964c83a60e4f2d7d1ec460b (diff) |
include h_extensions in deposit confirmation
Diffstat (limited to 'src/auditor')
-rw-r--r-- | src/auditor/taler-auditor-httpd_deposit-confirmation.c | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation.c b/src/auditor/taler-auditor-httpd_deposit-confirmation.c index c7a23d718..20500a88d 100644 --- a/src/auditor/taler-auditor-httpd_deposit-confirmation.c +++ b/src/auditor/taler-auditor-httpd_deposit-confirmation.c @@ -183,33 +183,25 @@ verify_and_execute_deposit_confirmation ( } /* check deposit confirmation signature */ + if (GNUNET_OK != + TALER_exchange_deposit_confirm_verify (&dc->h_contract_terms, + &dc->h_wire, + NULL /* h_extensions! */, + dc->exchange_timestamp, + dc->wire_deadline, + dc->refund_deadline, + &dc->amount_without_fee, + &dc->coin_pub, + &dc->merchant, + &dc->exchange_pub, + &dc->exchange_sig)) { - struct TALER_DepositConfirmationPS dcs = { - .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT), - .purpose.size = htonl (sizeof (struct TALER_DepositConfirmationPS)), - .h_contract_terms = dc->h_contract_terms, - .h_wire = dc->h_wire, - .exchange_timestamp = GNUNET_TIME_absolute_hton (dc->exchange_timestamp), - .refund_deadline = GNUNET_TIME_absolute_hton (dc->refund_deadline), - .coin_pub = dc->coin_pub, - .merchant = dc->merchant - }; - - TALER_amount_hton (&dcs.amount_without_fee, - &dc->amount_without_fee); - if (GNUNET_OK != - GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT, - &dcs, - &dc->exchange_sig.eddsa_signature, - &dc->exchange_pub.eddsa_pub)) - { - TALER_LOG_WARNING ( - "Invalid signature on /deposit-confirmation request\n"); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_FORBIDDEN, - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); - } + TALER_LOG_WARNING ( + "Invalid signature on /deposit-confirmation request\n"); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_FORBIDDEN, + TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, + "exchange signature invalid"); } /* execute transaction */ @@ -263,6 +255,8 @@ TAH_DEPOSIT_CONFIRMATION_handler (struct TAH_RequestHandler *rh, &dc.exchange_timestamp), TALER_JSON_spec_absolute_time ("refund_deadline", &dc.refund_deadline), + TALER_JSON_spec_absolute_time ("wire_deadline", + &dc.wire_deadline), TALER_JSON_spec_amount ("amount_without_fee", TAH_currency, &dc.amount_without_fee), |