diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-12-28 22:16:03 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-12-28 22:16:03 +0100 |
commit | b554501621913b9fef71a2652ba10ebabd7849f4 (patch) | |
tree | 6b9651c28d75be330bfc1fead188e64f9bd7db63 /src/exchange/taler-exchange-httpd_purses_delete.c | |
parent | 2f993d3ee32ac614a8f0b405fc3177c3d33feba9 (diff) | |
download | exchange-b554501621913b9fef71a2652ba10ebabd7849f4.tar.gz exchange-b554501621913b9fef71a2652ba10ebabd7849f4.tar.bz2 exchange-b554501621913b9fef71a2652ba10ebabd7849f4.zip |
integrate DELETE into dispatcher, remove legacy KYC code
Diffstat (limited to 'src/exchange/taler-exchange-httpd_purses_delete.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_purses_delete.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_purses_delete.c b/src/exchange/taler-exchange-httpd_purses_delete.c index 34ab11b51..f4106a664 100644 --- a/src/exchange/taler-exchange-httpd_purses_delete.c +++ b/src/exchange/taler-exchange-httpd_purses_delete.c @@ -35,13 +35,27 @@ MHD_RESULT TEH_handler_purses_delete ( - struct MHD_Connection *connection, - const struct TALER_PurseContractPublicKeyP *purse_pub) + struct TEH_RequestContext *rc, + const char *const args[1]) { + struct MHD_Connection *connection = rc->connection; + struct TALER_PurseContractPublicKeyP purse_pub; struct TALER_PurseContractSignatureP purse_sig; bool found; bool decided; + if (GNUNET_OK != + GNUNET_STRINGS_string_to_data (args[0], + strlen (args[0]), + &purse_pub, + sizeof (purse_pub))) + { + GNUNET_break_op (0); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_EXCHANGE_GENERIC_PURSE_PUB_MALFORMED, + args[0]); + } { const char *sig; @@ -66,7 +80,7 @@ TEH_handler_purses_delete ( } if (GNUNET_OK != - TALER_wallet_purse_delete_verify (purse_pub, + TALER_wallet_purse_delete_verify (&purse_pub, &purse_sig)) { TALER_LOG_WARNING ("Invalid signature on /purses/$PID/delete request\n"); @@ -89,7 +103,7 @@ TEH_handler_purses_delete ( enum GNUNET_DB_QueryStatus qs; qs = TEH_plugin->do_purse_delete (TEH_plugin->cls, - purse_pub, + &purse_pub, &purse_sig, &decided, &found); |