From c1c40eaa24926273a6aa688e92e99d832aa1501e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 16 Aug 2021 11:01:38 +0200 Subject: -preparations for sepa auth plugin --- src/backend/anastasis-httpd_truth.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/backend/anastasis-httpd_truth.c') diff --git a/src/backend/anastasis-httpd_truth.c b/src/backend/anastasis-httpd_truth.c index f69ff7b..ee0f2bf 100644 --- a/src/backend/anastasis-httpd_truth.c +++ b/src/backend/anastasis-httpd_truth.c @@ -1168,8 +1168,7 @@ AH_handler_truth_get ( { gc->authorization = ANASTASIS_authorization_plugin_load (method, - AH_cfg, - &gc->challenge_cost); + AH_cfg); if (NULL == gc->authorization) { MHD_RESULT ret; @@ -1184,6 +1183,7 @@ AH_handler_truth_get ( GNUNET_free (method); return ret; } + gc->challenge_cost = gc->authorization->cost; } else { @@ -1192,6 +1192,7 @@ AH_handler_truth_get ( GNUNET_free (method); } + if (! gc->authorization->payment_plugin_managed) { struct TALER_Amount zero_amount; @@ -1294,6 +1295,7 @@ AH_handler_truth_get ( uint64_t code; enum ANASTASIS_DB_CodeStatus cs; struct GNUNET_HashCode hc; + bool satisfied; rt = GNUNET_TIME_UNIT_FOREVER_ABS; qs = db->create_challenge_code (db->cls, @@ -1327,7 +1329,8 @@ AH_handler_truth_get ( &hc); cs = db->verify_challenge_code (db->cls, &gc->truth_uuid, - &hc); + &hc, + &satisfied); switch (cs) { case ANASTASIS_DB_CODE_STATUS_CHALLENGE_CODE_MISMATCH: @@ -1376,12 +1379,14 @@ AH_handler_truth_get ( if (gc->have_response) { enum ANASTASIS_DB_CodeStatus cs; + bool satisfied; GNUNET_free (decrypted_truth); GNUNET_free (truth_mime); cs = db->verify_challenge_code (db->cls, &gc->truth_uuid, - &challenge_response); + &challenge_response, + &satisfied); switch (cs) { case ANASTASIS_DB_CODE_STATUS_CHALLENGE_CODE_MISMATCH: @@ -1407,6 +1412,7 @@ AH_handler_truth_get ( TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED, NULL); case ANASTASIS_DB_CODE_STATUS_VALID_CODE_STORED: + // FIXME: if ! satisfied don't do this... return return_key_share (&gc->truth_uuid, connection); } -- cgit v1.2.3