summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_deposit.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-07-01 07:08:13 +0200
committerChristian Grothoff <grothoff@gnunet.org>2022-07-01 07:08:13 +0200
commit085e40bc562343221bceb6fc4dc9aba8e32a27e3 (patch)
treea1fedd984e06ffa685e14dc5b7942d8d5b550c24 /src/lib/exchange_api_deposit.c
parent2805018da25b07a36b1ab56e6fc990d72d86d70a (diff)
downloadexchange-085e40bc562343221bceb6fc4dc9aba8e32a27e3.tar.gz
exchange-085e40bc562343221bceb6fc4dc9aba8e32a27e3.tar.bz2
exchange-085e40bc562343221bceb6fc4dc9aba8e32a27e3.zip
-exchange_api_batch_deposit.c compiles
Diffstat (limited to 'src/lib/exchange_api_deposit.c')
-rw-r--r--src/lib/exchange_api_deposit.c81
1 files changed, 5 insertions, 76 deletions
diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c
index 7e8246170..329643413 100644
--- a/src/lib/exchange_api_deposit.c
+++ b/src/lib/exchange_api_deposit.c
@@ -378,77 +378,6 @@ handle_deposit_finished (void *cls,
}
-/**
- * Verify signature information about the deposit.
- *
- * @param dcd contract details
- * @param ech hashed contract (passed to avoid recomputation)
- * @param h_wire hashed wire details (passed to avoid recomputation)
- * @param cdd coin-specific details
- * @param dki denomination of the coin
- * @return #GNUNET_OK if signatures are OK, #GNUNET_SYSERR if not
- */
-static enum GNUNET_GenericReturnValue
-verify_signatures (const struct TALER_EXCHANGE_DepositContractDetail *dcd,
- const struct TALER_ExtensionContractHashP *ech,
- const struct TALER_MerchantWireHashP *h_wire,
- const struct TALER_EXCHANGE_CoinDepositDetail *cdd,
- const struct TALER_EXCHANGE_DenomPublicKey *dki)
-{
- if (GNUNET_OK !=
- TALER_wallet_deposit_verify (&cdd->amount,
- &dki->fees.deposit,
- h_wire,
- &dcd->h_contract_terms,
- &cdd->h_age_commitment,
- ech,
- &cdd->h_denom_pub,
- dcd->timestamp,
- &dcd->merchant_pub,
- dcd->refund_deadline,
- &cdd->coin_pub,
- &cdd->coin_sig))
- {
- GNUNET_break_op (0);
- TALER_LOG_WARNING ("Invalid coin signature on /deposit request!\n");
- TALER_LOG_DEBUG ("... amount_with_fee was %s\n",
- TALER_amount2s (&cdd->amount));
- TALER_LOG_DEBUG ("... deposit_fee was %s\n",
- TALER_amount2s (&dki->fees.deposit));
- return GNUNET_SYSERR;
- }
-
- /* check coin signature */
- {
- struct TALER_CoinPublicInfo coin_info = {
- .coin_pub = cdd->coin_pub,
- .denom_pub_hash = cdd->h_denom_pub,
- .denom_sig = cdd->denom_sig,
- .h_age_commitment = cdd->h_age_commitment,
- };
-
- if (GNUNET_YES !=
- TALER_test_coin_valid (&coin_info,
- &dki->key))
- {
- GNUNET_break_op (0);
- TALER_LOG_WARNING ("Invalid coin passed for /deposit\n");
- return GNUNET_SYSERR;
- }
- }
-
- /* Check coin does make a contribution */
- if (0 < TALER_amount_cmp (&dki->fees.deposit,
- &cdd->amount))
- {
- GNUNET_break_op (0);
- TALER_LOG_WARNING ("Deposit amount smaller than fee\n");
- return GNUNET_SYSERR;
- }
- return GNUNET_OK;
-}
-
-
struct TALER_EXCHANGE_DepositHandle *
TALER_EXCHANGE_deposit (
struct TALER_EXCHANGE_Handle *exchange,
@@ -526,11 +455,11 @@ TALER_EXCHANGE_deposit (
&dcd->wire_salt,
&dh->h_wire);
if (GNUNET_OK !=
- verify_signatures (dcd,
- &dh->h_extensions,
- &dh->h_wire,
- cdd,
- dki))
+ TALER_EXCHANGE_verify_deposit_signature_ (dcd,
+ &dh->h_extensions,
+ &dh->h_wire,
+ cdd,
+ dki))
{
*ec = TALER_EC_EXCHANGE_DEPOSIT_COIN_SIGNATURE_INVALID;
GNUNET_break_op (0);