gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: generate 502 on secmod unavailab


From: gnunet
Subject: [taler-exchange] branch master updated: generate 502 on secmod unavailable instead of 200 with bad public key; more logging
Date: Mon, 11 Oct 2021 14:32:34 +0200

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 66573865 generate 502 on secmod unavailable instead of 200 with bad 
public key; more logging
66573865 is described below

commit 66573865e1da2b23ad856d70088c23ec7f4d4922
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Oct 11 14:32:32 2021 +0200

    generate 502 on secmod unavailable instead of 200 with bad public key; more 
logging
---
 contrib/gana                             |  2 +-
 src/exchange/taler-exchange-httpd_keys.c | 15 +++++++++++++++
 src/util/crypto_helper_denom.c           | 12 ++++++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/contrib/gana b/contrib/gana
index 0272caa8..2e967c48 160000
--- a/contrib/gana
+++ b/contrib/gana
@@ -1 +1 @@
-Subproject commit 0272caa8ff8ee7553d035d29fb19d01866df43e4
+Subproject commit 2e967c48b395a3edb85982e2e349cb82e76dcb27
diff --git a/src/exchange/taler-exchange-httpd_keys.c 
b/src/exchange/taler-exchange-httpd_keys.c
index 72c2de12..0e000530 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -2504,6 +2504,21 @@ TEH_keys_management_get_keys_handler (const struct 
TEH_RequestHandler *rh,
       .signkeys = json_array ()
     };
 
+    if (GNUNET_is_zero (&denom_sm_pub))
+    {
+      return TALER_MHD_reply_with_error (connection,
+                                         MHD_HTTP_BAD_GATEWAY,
+                                         
TALER_EC_EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE,
+                                         NULL);
+    }
+    if (GNUNET_is_zero (&esign_sm_pub))
+    {
+      return TALER_MHD_reply_with_error (connection,
+                                         MHD_HTTP_BAD_GATEWAY,
+                                         
TALER_EC_EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE,
+                                         NULL);
+    }
+    // then a secmod helper is not yet running and we should return an 
MHD_HTTP_BAD_GATEWAY!
     GNUNET_assert (NULL != fbc.denoms);
     GNUNET_assert (NULL != fbc.signkeys);
     GNUNET_CONTAINER_multihashmap_iterate (ksh->helpers->denom_keys,
diff --git a/src/util/crypto_helper_denom.c b/src/util/crypto_helper_denom.c
index 4f8c921f..f8e77ae4 100644
--- a/src/util/crypto_helper_denom.c
+++ b/src/util/crypto_helper_denom.c
@@ -441,7 +441,11 @@ TALER_CRYPTO_helper_denom_poll (struct 
TALER_CRYPTO_DenominationHelper *dh)
 
   try_connect (dh);
   if (-1 == dh->sock)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Cannot poll denom helper: socket down\n");
     return; /* give up */
+  }
   while (1)
   {
     ret = recv (dh->sock,
@@ -464,10 +468,18 @@ TALER_CRYPTO_helper_denom_poll (struct 
TALER_CRYPTO_DenominationHelper *dh)
                       "Restarting connection to RSA helper, did not come up 
properly\n");
           do_disconnect (dh);
           if (0 == retry_limit)
+          {
+            GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                        "Cannot poll denom helper: retry limit reached\n");
             return; /* give up */
+          }
           try_connect (dh);
           if (-1 == dh->sock)
+          {
+            GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                        "Cannot poll denom helper: failed to connect\n");
             return; /* give up */
+          }
           retry_limit--;
           flag = MSG_DONTWAIT;
         }

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