summaryrefslogtreecommitdiff
path: root/src/authorization/anastasis_authorization_plugin_post.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-16 16:44:00 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-16 16:44:00 +0200
commitd94a0fe2f979348b45289b66b1cb5f72c3c3e76c (patch)
treecd909fd72847ef6e7c399ddea1a2b3ce27efcb9e /src/authorization/anastasis_authorization_plugin_post.c
parent349d37ea1398901daddb11d5c28b8148e393ccb7 (diff)
downloadanastasis-d94a0fe2f979348b45289b66b1cb5f72c3c3e76c.tar.gz
anastasis-d94a0fe2f979348b45289b66b1cb5f72c3c3e76c.tar.bz2
anastasis-d94a0fe2f979348b45289b66b1cb5f72c3c3e76c.zip
-modify plugins to set 'satisfied' bit
Diffstat (limited to 'src/authorization/anastasis_authorization_plugin_post.c')
-rw-r--r--src/authorization/anastasis_authorization_plugin_post.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_post.c b/src/authorization/anastasis_authorization_plugin_post.c
index dddd273..30cea88 100644
--- a/src/authorization/anastasis_authorization_plugin_post.c
+++ b/src/authorization/anastasis_authorization_plugin_post.c
@@ -24,7 +24,8 @@
#include <taler/taler_json_lib.h>
#include <jansson.h>
#include "anastasis_util_lib.h"
-
+#include <gnunet/gnunet_db_lib.h>
+#include "anastasis_database_lib.h"
/**
* Saves the State of a authorization plugin.
@@ -277,7 +278,20 @@ post_start (void *cls,
struct PostContext *ctx = cls;
struct ANASTASIS_AUTHORIZATION_State *as;
json_error_t error;
-
+ enum GNUNET_DB_QueryStatus qs;
+
+ /* If the user can show this challenge code, this
+ plugin is already happy (no additional
+ requirements), so mark this challenge as
+ already satisfied from the start. */
+ qs = ctx->ac->db->mark_challenge_code_satisfied (ctx->ac->db->cls,
+ truth_uuid,
+ code);
+ if (qs <= 0)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
as = GNUNET_new (struct ANASTASIS_AUTHORIZATION_State);
as->trigger = trigger;
as->trigger_cls = trigger_cls;