diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-24 22:29:30 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-24 22:29:30 +0200 |
commit | f00d029affb0a1e27fb6c0d0aae279bc165c2bf4 (patch) | |
tree | 4ec79da819cdcd36781f7be010f57271aa44859f /src/backend | |
parent | 8276be2a2cece6365227c5b4e5aafd1f63b9a9fc (diff) | |
download | anastasis-f00d029affb0a1e27fb6c0d0aae279bc165c2bf4.tar.gz anastasis-f00d029affb0a1e27fb6c0d0aae279bc165c2bf4.tar.bz2 anastasis-f00d029affb0a1e27fb6c0d0aae279bc165c2bf4.zip |
IBAN test passes
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/anastasis-httpd_truth.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/backend/anastasis-httpd_truth.c b/src/backend/anastasis-httpd_truth.c index 3b853dc..aa3011b 100644 --- a/src/backend/anastasis-httpd_truth.c +++ b/src/backend/anastasis-httpd_truth.c @@ -130,6 +130,11 @@ struct GetContext struct GNUNET_CONTAINER_HeapNode *hn; /** + * Challenge response we got from the request. + */ + struct GNUNET_HashCode challenge_response; + + /** * How long do we wait at most for payment or * authorization? */ @@ -965,6 +970,8 @@ run_authorization_process (struct MHD_Connection *connection, GNUNET_assert (! gc->suspended); gc->authorization->cleanup (gc->as); gc->as = NULL; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Resuming with authorization successful!\n"); if (gc->in_list) { GNUNET_CONTAINER_DLL_remove (gc_head, @@ -986,7 +993,6 @@ AH_handler_truth_get ( struct TM_HandlerContext *hc) { struct GetContext *gc = hc->ctx; - struct GNUNET_HashCode challenge_response; void *encrypted_truth; size_t encrypted_truth_size; void *decrypted_truth; @@ -1071,7 +1077,7 @@ AH_handler_truth_get ( if ( (NULL != challenge_response_s) && (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (challenge_response_s, - &challenge_response)) ) + &gc->challenge_response)) ) { GNUNET_break_op (0); return TALER_MHD_reply_with_error (connection, @@ -1367,15 +1373,15 @@ AH_handler_truth_get ( GNUNET_assert (0); } } - if ( (decrypted_truth_size != sizeof (challenge_response)) || - (0 != memcmp (&challenge_response, + if ( (decrypted_truth_size != sizeof (struct GNUNET_HashCode)) || + (0 != memcmp (&gc->challenge_response, decrypted_truth, decrypted_truth_size)) ) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Wrong answer provided to secure question had %u bytes, wanted %u\n", (unsigned int) decrypted_truth_size, - (unsigned int) sizeof (challenge_response)); + (unsigned int) sizeof (struct GNUNET_HashCode)); GNUNET_free (decrypted_truth); GNUNET_free (truth_mime); return TALER_MHD_reply_with_error (connection, @@ -1398,7 +1404,7 @@ AH_handler_truth_get ( GNUNET_free (truth_mime); cs = db->verify_challenge_code (db->cls, &gc->truth_uuid, - &challenge_response, + &gc->challenge_response, &satisfied); switch (cs) { |