gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: fix crash on retry limit exceed


From: gnunet
Subject: [taler-anastasis] branch master updated: fix crash on retry limit exceeded for security question
Date: Wed, 24 Aug 2022 13:04:38 +0200

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 1d778d8  fix crash on retry limit exceeded for security question
1d778d8 is described below

commit 1d778d852f1135b48c3f7a868e12a647dde40669
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Aug 24 13:04:36 2022 +0200

    fix crash on retry limit exceeded for security question
---
 src/backend/anastasis-httpd_truth-solve.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/backend/anastasis-httpd_truth-solve.c 
b/src/backend/anastasis-httpd_truth-solve.c
index a632e6b..957d924 100644
--- a/src/backend/anastasis-httpd_truth-solve.c
+++ b/src/backend/anastasis-httpd_truth-solve.c
@@ -199,14 +199,24 @@ static struct GNUNET_SCHEDULER_Task *to_task;
 static MHD_RESULT
 reply_rate_limited (const struct SolveContext *gc)
 {
+  if (NULL != gc->authorization)
+    return TALER_MHD_REPLY_JSON_PACK (
+      gc->connection,
+      MHD_HTTP_TOO_MANY_REQUESTS,
+      TALER_MHD_PACK_EC (TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED),
+      GNUNET_JSON_pack_uint64 ("request_limit",
+                               gc->authorization->retry_counter),
+      GNUNET_JSON_pack_time_rel ("request_frequency",
+                                 gc->authorization->code_rotation_period));
+  /* must be security question */
   return TALER_MHD_REPLY_JSON_PACK (
     gc->connection,
     MHD_HTTP_TOO_MANY_REQUESTS,
     TALER_MHD_PACK_EC (TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED),
     GNUNET_JSON_pack_uint64 ("request_limit",
-                             gc->authorization->retry_counter),
+                             INITIAL_RETRY_COUNTER),
     GNUNET_JSON_pack_time_rel ("request_frequency",
-                               gc->authorization->code_rotation_period));
+                               MAX_QUESTION_FREQ));
 }
 
 

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