diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-16 16:44:00 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-16 16:44:00 +0200 |
commit | d94a0fe2f979348b45289b66b1cb5f72c3c3e76c (patch) | |
tree | cd909fd72847ef6e7c399ddea1a2b3ce27efcb9e /src/authorization/anastasis_authorization_plugin_sms.c | |
parent | 349d37ea1398901daddb11d5c28b8148e393ccb7 (diff) | |
download | anastasis-d94a0fe2f979348b45289b66b1cb5f72c3c3e76c.tar.gz anastasis-d94a0fe2f979348b45289b66b1cb5f72c3c3e76c.tar.bz2 anastasis-d94a0fe2f979348b45289b66b1cb5f72c3c3e76c.zip |
-modify plugins to set 'satisfied' bit
Diffstat (limited to 'src/authorization/anastasis_authorization_plugin_sms.c')
-rw-r--r-- | src/authorization/anastasis_authorization_plugin_sms.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_sms.c b/src/authorization/anastasis_authorization_plugin_sms.c index b780c68..df398fd 100644 --- a/src/authorization/anastasis_authorization_plugin_sms.c +++ b/src/authorization/anastasis_authorization_plugin_sms.c @@ -24,6 +24,8 @@ #include <taler/taler_json_lib.h> #include <regex.h> #include "anastasis_util_lib.h" +#include <gnunet/gnunet_db_lib.h> +#include "anastasis_database_lib.h" /** @@ -247,7 +249,20 @@ sms_start (void *cls, { struct SMS_Context *ctx = cls; struct ANASTASIS_AUTHORIZATION_State *as; - + 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; |