diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-03-02 23:39:26 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-03-02 23:39:26 +0100 |
commit | cf4b6ebd6de3370da4b16d2f1ef19a2a3d3d0b12 (patch) | |
tree | eeec41a888f4f9cbdb77d6f01844ef20fccc2a43 /src/backend/anastasis-httpd_truth-challenge.c | |
parent | 81311476b804c054e4ee19c9b182f3b34357f88f (diff) | |
download | anastasis-cf4b6ebd6de3370da4b16d2f1ef19a2a3d3d0b12.tar.gz anastasis-cf4b6ebd6de3370da4b16d2f1ef19a2a3d3d0b12.tar.bz2 anastasis-cf4b6ebd6de3370da4b16d2f1ef19a2a3d3d0b12.zip |
push new /truth/ API through the entire implementation
Diffstat (limited to 'src/backend/anastasis-httpd_truth-challenge.c')
-rw-r--r-- | src/backend/anastasis-httpd_truth-challenge.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/src/backend/anastasis-httpd_truth-challenge.c b/src/backend/anastasis-httpd_truth-challenge.c index c583403..65dc244 100644 --- a/src/backend/anastasis-httpd_truth-challenge.c +++ b/src/backend/anastasis-httpd_truth-challenge.c @@ -981,33 +981,6 @@ AH_handler_truth_challenge ( gc->connection = connection; gc->truth_uuid = *truth_uuid; gc->hc->cc = &request_done; - { - const char *pay_id; - - pay_id = MHD_lookup_connection_value (connection, - MHD_HEADER_KIND, - ANASTASIS_HTTP_HEADER_PAYMENT_IDENTIFIER); - if (NULL != pay_id) - { - if (GNUNET_OK != - GNUNET_STRINGS_string_to_data ( - pay_id, - strlen (pay_id), - &gc->payment_identifier, - sizeof (struct ANASTASIS_PaymentSecretP))) - { - GNUNET_break_op (0); - return TALER_MHD_reply_with_error (connection, - MHD_HTTP_BAD_REQUEST, - TALER_EC_GENERIC_PARAMETER_MALFORMED, - ANASTASIS_HTTP_HEADER_PAYMENT_IDENTIFIER); - } - gc->payment_identifier_provided = true; - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Client provided payment identifier `%s'\n", - pay_id); - } - } { const char *long_poll_timeout_ms; @@ -1104,6 +1077,9 @@ AH_handler_truth_challenge ( struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_fixed_auto ("truth_decryption_key", &gc->truth_key), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_fixed_auto ("payment_secret", + &gc->payment_identifier)), GNUNET_JSON_spec_end () }; enum GNUNET_GenericReturnValue res; @@ -1121,6 +1097,12 @@ AH_handler_truth_challenge ( GNUNET_break_op (0); return MHD_YES; /* failure */ } + gc->payment_identifier_provided + = ! GNUNET_is_zero (&gc->payment_identifier); + if (gc->payment_identifier_provided) + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Client provided payment identifier `%s'\n", + TALER_B2S (&gc->payment_identifier)); } } |