summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_kyc-proof.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-16 11:14:59 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-16 11:14:59 +0100
commit6231c365fdd7b13032dffbebb94be62e2ef34455 (patch)
tree1474c95f30ba39751a75e5ba6980b5e18bbacbdc /src/exchange/taler-exchange-httpd_kyc-proof.c
parentcbb021b6bf996c79530ae3dda98ec85f716e9d07 (diff)
downloadexchange-6231c365fdd7b13032dffbebb94be62e2ef34455.tar.gz
exchange-6231c365fdd7b13032dffbebb94be62e2ef34455.tar.bz2
exchange-6231c365fdd7b13032dffbebb94be62e2ef34455.zip
-fix KYC logic change to work for all plugins and not just OAuth2.0
Diffstat (limited to 'src/exchange/taler-exchange-httpd_kyc-proof.c')
-rw-r--r--src/exchange/taler-exchange-httpd_kyc-proof.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/exchange/taler-exchange-httpd_kyc-proof.c b/src/exchange/taler-exchange-httpd_kyc-proof.c
index e550d28e2..d37164987 100644
--- a/src/exchange/taler-exchange-httpd_kyc-proof.c
+++ b/src/exchange/taler-exchange-httpd_kyc-proof.c
@@ -256,35 +256,34 @@ clean_kpc (struct TEH_RequestContext *rc)
MHD_RESULT
TEH_handler_kyc_proof (
struct TEH_RequestContext *rc,
- const char *const args[3])
+ const char *const args[1])
{
struct KycProofContext *kpc = rc->rh_ctx;
+ const char *provider_section_or_logic = args[0];
const char *h_payto;
+
if (NULL == kpc)
{
/* first time */
- if ( (NULL == args[0]))
+ if (NULL == provider_section_or_logic)
{
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_GENERIC_ENDPOINT_UNKNOWN,
- "'/kyc-proof/$LOGIC?state=$H_PAYTO' required");
+ "'/kyc-proof/$PROVIDER_SECTION?state=$H_PAYTO' required");
}
-
h_payto = MHD_lookup_connection_value (rc->connection,
MHD_GET_ARGUMENT_KIND,
"state");
- if ( (NULL == h_payto) )
+ if (NULL == h_payto)
{
GNUNET_break_op (0);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_BAD_REQUEST,
- TALER_EC_GENERIC_PARAMETER_MALFORMED,
+ TALER_EC_GENERIC_PARAMETER_MISSING,
"h_payto");
}
-
-
kpc = GNUNET_new (struct KycProofContext);
kpc->rc = rc;
rc->rh_ctx = kpc;
@@ -302,7 +301,7 @@ TEH_handler_kyc_proof (
"h_payto");
}
if (GNUNET_OK !=
- TALER_KYCLOGIC_lookup_logic (args[0],
+ TALER_KYCLOGIC_lookup_logic (provider_section_or_logic,
&kpc->logic,
&kpc->pd,
&kpc->provider_section))
@@ -311,14 +310,14 @@ TEH_handler_kyc_proof (
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_NOT_FOUND,
TALER_EC_EXCHANGE_KYC_GENERIC_LOGIC_UNKNOWN,
- args[0]);
+ provider_section_or_logic);
}
if (NULL != kpc->provider_section)
{
enum GNUNET_DB_QueryStatus qs;
struct GNUNET_TIME_Absolute expiration;
- if (0 != strcmp (args[0],
+ if (0 != strcmp (provider_section_or_logic,
kpc->provider_section))
{
GNUNET_break_op (0);
@@ -364,7 +363,6 @@ TEH_handler_kyc_proof (
}
kpc->ph = kpc->logic->proof (kpc->logic->cls,
kpc->pd,
- &args[1],
rc->connection,
&kpc->h_payto,
kpc->process_row,