gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: handle double-revoke gracefully


From: gnunet
Subject: [taler-exchange] branch master updated: handle double-revoke gracefully
Date: Thu, 25 Nov 2021 09:54:28 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 414237c3 handle double-revoke gracefully
414237c3 is described below

commit 414237c335dd0f960ee07de92ff20c92b5c7afd5
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Nov 25 09:54:23 2021 +0100

    handle double-revoke gracefully
---
 src/util/taler-exchange-secmod-eddsa.c |  9 ++++++++-
 src/util/taler-exchange-secmod-rsa.c   | 12 ++++++++++--
 src/util/test_helper_eddsa.c           |  5 +++--
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/util/taler-exchange-secmod-eddsa.c 
b/src/util/taler-exchange-secmod-eddsa.c
index f49b9865..3fe9b284 100644
--- a/src/util/taler-exchange-secmod-eddsa.c
+++ b/src/util/taler-exchange-secmod-eddsa.c
@@ -454,7 +454,14 @@ handle_revoke_request (struct TES_Client *client,
                 "Revocation request ignored, key unknown\n");
     return GNUNET_OK;
   }
-
+  if (key->purge)
+  {
+    GNUNET_assert (0 == pthread_mutex_unlock (&keys_lock));
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Revocation request ignored, key %s already revoked\n",
+                TALER_B2S (&key->exchange_pub));
+    return GNUNET_OK;
+  }
   key_gen++;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Revoking key %s, bumping generation to %llu\n",
diff --git a/src/util/taler-exchange-secmod-rsa.c 
b/src/util/taler-exchange-secmod-rsa.c
index a2bbaf05..b384be13 100644
--- a/src/util/taler-exchange-secmod-rsa.c
+++ b/src/util/taler-exchange-secmod-rsa.c
@@ -573,11 +573,19 @@ handle_revoke_request (struct TES_Client *client,
                 GNUNET_h2s (&rr->h_rsa.hash));
     return GNUNET_OK;
   }
+  if (dk->purge)
+  {
+    GNUNET_assert (0 == pthread_mutex_unlock (&keys_lock));
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Revocation request ignored, denomination key %s already 
revoked\n",
+                GNUNET_h2s (&rr->h_rsa.hash));
+    return GNUNET_OK;
+  }
 
   key_gen++;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Revoking key %p, bumping generation to %llu\n",
-              dk,
+              "Revoking key %s, bumping generation to %llu\n",
+              GNUNET_h2s (&rr->h_rsa.hash),
               (unsigned long long) key_gen);
   purge_key (dk);
 
diff --git a/src/util/test_helper_eddsa.c b/src/util/test_helper_eddsa.c
index 97800e2c..d0d3d433 100644
--- a/src/util/test_helper_eddsa.c
+++ b/src/util/test_helper_eddsa.c
@@ -197,8 +197,9 @@ test_revocation (struct TALER_CRYPTO_ExchangeSignHelper 
*esh)
       }
       keys[j].revoked = true;
       fprintf (stderr,
-               "Revoking key %s ...",
-               TALER_B2S (&keys[j].exchange_pub));
+               "Revoking key %s (%u) ...",
+               TALER_B2S (&keys[j].exchange_pub),
+               j);
       TALER_CRYPTO_helper_esign_revoke (esh,
                                         &keys[j].exchange_pub);
       for (unsigned int k = 0; k<1000; k++)

-- 
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]