summaryrefslogtreecommitdiff
path: root/src/backend/anastasis-httpd_truth.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-16 11:01:38 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-16 11:01:38 +0200
commitc1c40eaa24926273a6aa688e92e99d832aa1501e (patch)
treed5d01686cd125e70d1702ac5bbc2660c71d90760 /src/backend/anastasis-httpd_truth.c
parent3b90e437e26013f5570d6c216b832c7bcd740712 (diff)
downloadanastasis-c1c40eaa24926273a6aa688e92e99d832aa1501e.tar.gz
anastasis-c1c40eaa24926273a6aa688e92e99d832aa1501e.tar.bz2
anastasis-c1c40eaa24926273a6aa688e92e99d832aa1501e.zip
-preparations for sepa auth plugin
Diffstat (limited to 'src/backend/anastasis-httpd_truth.c')
-rw-r--r--src/backend/anastasis-httpd_truth.c14
1 files changed, 10 insertions, 4 deletions
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);
}