aboutsummaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_purses_delete.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange/taler-exchange-httpd_purses_delete.c')
-rw-r--r--src/exchange/taler-exchange-httpd_purses_delete.c22
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 34ab11b5..f4106a66 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);