gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated: proper handling of h_denom_pub m


From: gnunet
Subject: [taler-merchant] branch master updated: proper handling of h_denom_pub missmatch
Date: Sat, 11 Jul 2020 17:01:49 +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 d299f7e  proper handling of h_denom_pub missmatch
d299f7e is described below

commit d299f7e7d288309dc696962edd9ce257d2c1a926
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jul 11 17:01:47 2020 +0200

    proper handling of h_denom_pub missmatch
---
 src/lib/merchant_api_post_order_pay.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/lib/merchant_api_post_order_pay.c 
b/src/lib/merchant_api_post_order_pay.c
index 78fe308..3675ca6 100644
--- a/src/lib/merchant_api_post_order_pay.c
+++ b/src/lib/merchant_api_post_order_pay.c
@@ -104,7 +104,7 @@ struct TALER_MERCHANT_OrderPayHandle
 
 
 /**
- * We got a 403 response back from the exchange (or the merchant).
+ * We got a 409 response back from the exchange (or the merchant).
  * Now we need to check the provided cryptograophic proof that the
  * coin was actually already spent!
  *
@@ -143,25 +143,21 @@ check_coin_history (const struct TALER_MERCHANT_PaidCoin 
*pc,
     GNUNET_break (0);
     return GNUNET_SYSERR;
   }
-  if (-1 != TALER_amount_cmp (&pc->denom_value,
-                              &spent_plus_contrib))
-  {
-    /* according to our calculations, the transaction should
-       have still worked, exchange error! */
-    GNUNET_break_op (0);
-    return GNUNET_SYSERR;
-  }
   GNUNET_CRYPTO_rsa_public_key_hash (pc->denom_pub.rsa_public_key,
                                      &h_denom_pub_pc);
-  if (0 != GNUNET_memcmp (&h_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)) )
   {
-    /* Hash of denom pub doesn't match. */
-    GNUNET_break (0);
+    /* according to our calculations, the transaction should
+       have still worked, AND we did not get any proof of
+       coin public key re-use; hence: exchange error! */
+    GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Accepting proof of double-spending\n");
+              "Accepting proof of double-spending (or coin public key 
re-use)\n");
   return GNUNET_OK;
 }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]