summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-03-04 00:30:43 +0100
committerChristian Grothoff <christian@grothoff.org>2022-03-04 00:30:43 +0100
commitf9a2808ed02535427e4d2a8a45bcdc9777b8caf5 (patch)
tree38d3ff08c215bfa1796b8ae0f68176b3a74799dd /src/exchange
parent1643b745af309f754959621fa2a631c899ba1975 (diff)
downloadexchange-f9a2808ed02535427e4d2a8a45bcdc9777b8caf5.tar.gz
exchange-f9a2808ed02535427e4d2a8a45bcdc9777b8caf5.tar.bz2
exchange-f9a2808ed02535427e4d2a8a45bcdc9777b8caf5.zip
-fix kyc test
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-check.c68
1 files changed, 33 insertions, 35 deletions
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c
index ba9186866..de6ac42fd 100644
--- a/src/exchange/taler-exchange-httpd_kyc-check.c
+++ b/src/exchange/taler-exchange-httpd_kyc-check.c
@@ -60,11 +60,6 @@ struct KycPoller
struct GNUNET_DB_EventHandler *eh;
/**
- * UUID found based on @e h_payto.
- */
- uint64_t payment_target_uuid;
-
- /**
* UUID being checked.
*/
uint64_t auth_payment_target_uuid;
@@ -81,6 +76,11 @@ struct KycPoller
struct TALER_PaytoHashP h_payto;
/**
+ * Payto URL as a string, as given to us by t
+ */
+ const char *hps;
+
+ /**
* When will this request time out?
*/
struct GNUNET_TIME_Absolute timeout;
@@ -183,9 +183,6 @@ kyc_check (void *cls,
"inselect_wallet_status");
return qs;
}
- // FIXME: avoid duplicating this...
- kyp->payment_target_uuid = kyp->kyc.payment_target_uuid;
-
return qs;
}
@@ -293,32 +290,28 @@ TEH_handler_kyc_check (
tms));
}
}
+ kyp->hps = MHD_lookup_connection_value (rc->connection,
+ MHD_GET_ARGUMENT_KIND,
+ "h_payto");
+ if (NULL == kyp->hps)
{
- const char *hps;
-
- hps = MHD_lookup_connection_value (rc->connection,
- MHD_GET_ARGUMENT_KIND,
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_PARAMETER_MISSING,
+ "h_payto");
+ }
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_string_to_data (kyp->hps,
+ strlen (kyp->hps),
+ &kyp->h_payto,
+ sizeof (kyp->h_payto)))
+ {
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_PARAMETER_MALFORMED,
"h_payto");
- if (NULL == hps)
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MISSING,
- "h_payto");
- }
- if (GNUNET_OK !=
- GNUNET_STRINGS_string_to_data (hps,
- strlen (hps),
- &kyp->h_payto,
- sizeof (kyp->h_payto)))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
- "h_payto");
- }
}
}
@@ -360,8 +353,13 @@ TEH_handler_kyc_check (
return res;
if (kyp->auth_payment_target_uuid !=
- kyp->payment_target_uuid)
+ kyp->kyc.payment_target_uuid)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Account %llu provided, but payto %s is for %llu\n",
+ (unsigned long long) kyp->auth_payment_target_uuid,
+ kyp->hps,
+ (unsigned long long) kyp->kyc.payment_target_uuid);
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_UNAUTHORIZED,
@@ -391,9 +389,9 @@ TEH_handler_kyc_check (
GNUNET_assert (TEH_KYC_OAUTH2 == TEH_kyc_config.mode);
GNUNET_asprintf (&redirect_uri,
- "%s/kyc-proof/%llu",
+ "%s/kyc-proof/%s",
TEH_base_url,
- (unsigned long long) kyp->payment_target_uuid);
+ kyp->hps);
redirect_uri_encoded = TALER_urlencode (redirect_uri);
GNUNET_free (redirect_uri);
GNUNET_asprintf (&url,