[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: -work around FTBFS
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: -work around FTBFS |
Date: |
Sun, 05 Jun 2022 23:38:46 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 41eb57c7 -work around FTBFS
41eb57c7 is described below
commit 41eb57c7252bd14794502a7164acb5794df1a3ae
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jun 5 23:38:43 2022 +0200
-work around FTBFS
---
contrib/merchant-backoffice | 2 +-
src/lib/merchant_api_post_order_pay.c | 46 +++++++++++++++++++++--------------
2 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/contrib/merchant-backoffice b/contrib/merchant-backoffice
index 182cdfff..1d7ee55e 160000
--- a/contrib/merchant-backoffice
+++ b/contrib/merchant-backoffice
@@ -1 +1 @@
-Subproject commit 182cdfffa1d4b6f2bb3543d30cfa7509e73bda03
+Subproject commit 1d7ee55ea115b91687c203a8f084ea852867b1f0
diff --git a/src/lib/merchant_api_post_order_pay.c
b/src/lib/merchant_api_post_order_pay.c
index c246a1d4..bd6fca6f 100644
--- a/src/lib/merchant_api_post_order_pay.c
+++ b/src/lib/merchant_api_post_order_pay.c
@@ -106,29 +106,41 @@ struct TALER_MERCHANT_OrderPayHandle
/**
* We got a 409 response back from the exchange (or the merchant).
- * Now we need to check the provided cryptograophic proof that the
+ * Now we need to check the provided cryptographic proof that the
* coin was actually already spent!
*
* @param pc handle of the original coin we paid with
- * @param json cryptograophic proof of coin's transaction
+ * @param json cryptographic proof of coin's transaction
* history as was returned by the exchange/merchant
* @return #GNUNET_OK if proof checks out
*/
-static int
+static enum GNUNET_GenericReturnValue
check_coin_history (const struct TALER_MERCHANT_PaidCoin *pc,
json_t *json)
{
+#if FIXME
struct TALER_Amount spent;
struct TALER_Amount spent_plus_contrib;
- struct TALER_DenominationHashP h_denom_pub;
struct TALER_DenominationHashP h_denom_pub_pc;
-
+ const struct TALER_EXCHANGE_DenomPublicKey *dpk;
+ const struct TALER_EXCHANGE_Keys *keys;
+ struct TALER_EXCHANGE_Handle *exchange;
+
+ exchange = TALER_EXCHANGE_connect (ctx,
+ pc->exchange_url,
+ &cert_cb,
+ ctx,
+ TALER_EXCHANGE_OPTION_END);
+ keys = TALER_EXCHANGE_get_keys (exchange);
+ TALER_denom_pub_hash (&pc->denom_pub,
+ &h_denom_pub_pc);
+ dpk = TALER_EXCHANGE_get_denomination_key_by_hash (
+ keys,
+ &h_denom_pub_pc);
if (GNUNET_OK !=
- TALER_EXCHANGE_verify_coin_history (NULL, /* do not verify fees */
- pc->amount_with_fee.currency,
+ TALER_EXCHANGE_verify_coin_history (dpk,
&pc->coin_pub,
json,
- &h_denom_pub,
&spent))
{
/* Exchange's history fails to verify */
@@ -144,12 +156,8 @@ check_coin_history (const struct TALER_MERCHANT_PaidCoin
*pc,
GNUNET_break (0);
return GNUNET_SYSERR;
}
- TALER_denom_pub_hash (&pc->denom_pub,
- &h_denom_pub_pc);
- if ( (-1 != TALER_amount_cmp (&pc->denom_value,
- &spent_plus_contrib)) &&
- (0 != GNUNET_memcmp (&h_denom_pub,
- &h_denom_pub_pc)) )
+ if (-1 != TALER_amount_cmp (&pc->denom_value,
+ &spent_plus_contrib))
{
/* according to our calculations, the transaction should
have still worked, AND we did not get any proof of
@@ -157,6 +165,7 @@ check_coin_history (const struct TALER_MERCHANT_PaidCoin
*pc,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
+#endif
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Accepting proof of double-spending (or coin public key
re-use)\n");
return GNUNET_OK;
@@ -211,11 +220,11 @@ check_conflict (struct TALER_MERCHANT_OrderPayHandle *oph,
for (unsigned int i = 0; i<oph->num_coins; i++)
{
- if (0 == memcmp (&oph->coins[i].coin_pub,
- &coin_pub,
- sizeof (struct TALER_CoinSpendPublicKeyP)))
+ if (0 ==
+ GNUNET_memcmp (&oph->coins[i].coin_pub,
+ &coin_pub))
{
- int ret;
+ enum GNUNET_GenericReturnValue ret;
ret = check_coin_history (&oph->coins[i],
history);
@@ -432,6 +441,7 @@ TALER_MERCHANT_order_pay_frontend (
return NULL;
}
j_coins = json_array ();
+ GNUNET_assert (NULL != j_coins);
for (unsigned int i = 0; i<num_coins; i++)
{
json_t *j_coin;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: -work around FTBFS,
gnunet <=