gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: allow 403, valid status code


From: gnunet
Subject: [taler-anastasis] branch master updated: allow 403, valid status code
Date: Mon, 08 Feb 2021 21:07:33 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new fc7cdef  allow 403, valid status code
fc7cdef is described below

commit fc7cdef5cefb3ca1616bf819e20250e3d76fa6e5
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Feb 8 21:07:31 2021 +0100

    allow 403, valid status code
---
 src/backend/anastasis-httpd_truth.c            | 23 +++++++++++++++--------
 src/restclient/anastasis_api_keyshare_lookup.c |  9 +++++++++
 src/testing/.gitignore                         |  1 +
 3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/src/backend/anastasis-httpd_truth.c 
b/src/backend/anastasis-httpd_truth.c
index 6354c6f..6bceec7 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -145,9 +145,12 @@ AH_truth_shutdown (void)
     GNUNET_CONTAINER_DLL_remove (gc_head,
                                  gc_tail,
                                  gc);
-    gc->authorization->cleanup (gc->as);
-    gc->authorization = NULL;
-    gc->as = NULL;
+    if (NULL != gc->as)
+    {
+      gc->authorization->cleanup (gc->as);
+      gc->as = NULL;
+      gc->authorization = NULL;
+    }
     MHD_resume_connection (gc->connection);
   }
   ANASTASIS_authorization_plugin_shutdown ();
@@ -725,8 +728,8 @@ AH_handler_truth_get (struct MHD_Connection *connection,
     case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
       break;
     }
-    is_question = strcmp ("question",
-                          method);
+    is_question = (0 == strcmp ("question",
+                                method));
     if (! is_question)
     {
       gc->authorization
@@ -835,14 +838,18 @@ AH_handler_truth_get (struct MHD_Connection *connection,
                        decrypted_truth,
                        decrypted_truth_size)) )
     {
-      enum GNUNET_DB_QueryStatus qs;
-
-      GNUNET_break_op (0);
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Wrong answer provided to secure question\n");
       GNUNET_free (decrypted_truth);
+      /* for rate-limiting... */
+#if 0
+      enum GNUNET_DB_QueryStatus qs;
+      // FIXME: fails: this is an UPDATE statement, we need to possibly INSERT 
_or_ UPDATE
       qs = db->mark_challenge_sent (db->cls,
                                     &gc->truth_public_key,
                                     0);
       GNUNET_break (0 < qs);
+#endif
       return TALER_MHD_reply_with_error (connection,
                                          MHD_HTTP_FORBIDDEN,
                                          
TALER_EC_ANASTASIS_TRUTH_CHALLENGE_FAILED,
diff --git a/src/restclient/anastasis_api_keyshare_lookup.c 
b/src/restclient/anastasis_api_keyshare_lookup.c
index 1453586..f7d61e2 100644
--- a/src/restclient/anastasis_api_keyshare_lookup.c
+++ b/src/restclient/anastasis_api_keyshare_lookup.c
@@ -125,13 +125,22 @@ handle_keyshare_lookup_finished (void *cls,
       ANASTASIS_keyshare_lookup_cancel (kslo);
       return;
     }
+  case MHD_HTTP_ALREADY_REPORTED:
+    /* Nothing really to verify */
+    break;
   case MHD_HTTP_BAD_REQUEST:
     /* This should never happen, either us or the anastasis server is buggy
        (or API version conflict); just pass JSON reply to the application */
     break;
+  case MHD_HTTP_FORBIDDEN:
+    /* Nothing really to verify, authentication failed */
+    break;
   case MHD_HTTP_NOT_FOUND:
     /* Nothing really to verify */
     break;
+  case MHD_HTTP_GONE:
+    /* Nothing really to verify */
+    break;
   case MHD_HTTP_INTERNAL_SERVER_ERROR:
     /* Server had an internal issue; we should retry, but this API
        leaves this to the application */
diff --git a/src/testing/.gitignore b/src/testing/.gitignore
index 6827c6c..a6eb294 100644
--- a/src/testing/.gitignore
+++ b/src/testing/.gitignore
@@ -1,2 +1,3 @@
 test_anastasis
 test_anastasisrest_api
+test_anastasis_api_home/.local/share/taler/crypto-*

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