summaryrefslogtreecommitdiff
path: root/src/backend/anastasis-httpd_truth.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-23 18:22:06 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-23 18:22:06 +0200
commitd153d8036ea14503f812717b8994a4a845ab643e (patch)
tree04de8dfb53255762f6649dc680be12b0f2954929 /src/backend/anastasis-httpd_truth.c
parent4aedf96ba44ffc804749b595a1ad5d4a17d82d77 (diff)
downloadanastasis-d153d8036ea14503f812717b8994a4a845ab643e.tar.gz
anastasis-d153d8036ea14503f812717b8994a4a845ab643e.tar.bz2
anastasis-d153d8036ea14503f812717b8994a4a845ab643e.zip
-more work on iban logic
Diffstat (limited to 'src/backend/anastasis-httpd_truth.c')
-rw-r--r--src/backend/anastasis-httpd_truth.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/backend/anastasis-httpd_truth.c b/src/backend/anastasis-httpd_truth.c
index 2c757db..3b853dc 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -1435,6 +1435,33 @@ AH_handler_truth_get (
connection);
}
/* continue with authorization plugin below */
+ {
+ enum GNUNET_DB_QueryStatus qs;
+
+ qs = db->get_unlimited_challenge_code (
+ db->cls,
+ &gc->truth_uuid,
+ gc->authorization->code_rotation_period,
+ gc->authorization->code_validity_period,
+ &gc->code);
+ switch (qs)
+ {
+ case GNUNET_DB_STATUS_HARD_ERROR:
+ case GNUNET_DB_STATUS_SOFT_ERROR:
+ case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+ GNUNET_break (0);
+ GNUNET_free (decrypted_truth);
+ return TALER_MHD_reply_with_error (gc->connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_GENERIC_DB_FETCH_FAILED,
+ "create_challenge_code");
+ case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+ /* challenge code was stored successfully*/
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Got challenge code\n");
+ break;
+ }
+ }
break;
default:
GNUNET_break (0);
@@ -1491,7 +1518,7 @@ AH_handler_truth_get (
return TALER_MHD_reply_with_error (gc->connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_FETCH_FAILED,
- "store_challenge_code");
+ "create_challenge_code");
case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
/* 0 == retry_counter of existing challenge => rate limit exceeded */
GNUNET_free (decrypted_truth);