From d94a0fe2f979348b45289b66b1cb5f72c3c3e76c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 16 Aug 2021 16:44:00 +0200 Subject: -modify plugins to set 'satisfied' bit --- .../anastasis_authorization_plugin_post.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/authorization/anastasis_authorization_plugin_post.c') 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 #include #include "anastasis_util_lib.h" - +#include +#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; -- cgit v1.2.3