aboutsummaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_responses.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mint/taler-mint-httpd_responses.c')
-rw-r--r--src/mint/taler-mint-httpd_responses.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/mint/taler-mint-httpd_responses.c b/src/mint/taler-mint-httpd_responses.c
index 75342cd2d..92bde3c70 100644
--- a/src/mint/taler-mint-httpd_responses.c
+++ b/src/mint/taler-mint-httpd_responses.c
@@ -295,10 +295,15 @@ TALER_MINT_reply_withdraw_sign_success (struct MHD_Connection *connection,
295 const struct CollectableBlindcoin *collectable) 295 const struct CollectableBlindcoin *collectable)
296{ 296{
297 json_t *root = json_object (); 297 json_t *root = json_object ();
298 size_t sig_buf_size;
299 char *sig_buf;
298 300
301 sig_buf_size = GNUNET_CRYPTO_rsa_signature_encode (collectable->sig,
302 &sig_buf);
299 json_object_set_new (root, "ev_sig", 303 json_object_set_new (root, "ev_sig",
300 TALER_JSON_from_data (&collectable->ev_sig, 304 TALER_JSON_from_data (sig_buf,
301 sizeof (struct TALER_RSA_Signature))); 305 sig_buf_size));
306 GNUNET_free (sig_buf);
302 return TALER_MINT_reply_json (connection, 307 return TALER_MINT_reply_json (connection,
303 root, 308 root,
304 MHD_HTTP_OK); 309 MHD_HTTP_OK);
@@ -388,19 +393,26 @@ TALER_MINT_reply_refresh_commit_success (struct MHD_Connection *connection,
388int 393int
389TALER_MINT_reply_refresh_reveal_success (struct MHD_Connection *connection, 394TALER_MINT_reply_refresh_reveal_success (struct MHD_Connection *connection,
390 unsigned int num_newcoins, 395 unsigned int num_newcoins,
391 const struct TALER_RSA_Signature *sigs) 396 const struct GNUNET_CRYPTO_rsa_Signature *sigs)
392{ 397{
393 int newcoin_index; 398 int newcoin_index;
394 json_t *root; 399 json_t *root;
395 json_t *list; 400 json_t *list;
401 char *buf;
402 size_t buf_size;
396 403
397 root = json_object (); 404 root = json_object ();
398 list = json_array (); 405 list = json_array ();
399 json_object_set_new (root, "ev_sigs", list); 406 json_object_set_new (root, "ev_sigs", list);
400 for (newcoin_index = 0; newcoin_index < num_newcoins; newcoin_index++) 407 for (newcoin_index = 0; newcoin_index < num_newcoins; newcoin_index++)
408 {
409 buf_size = GNUNET_CRYPTO_rsa_signature_encode (&sigs[newcoin_index],
410 &buf);
401 json_array_append_new (list, 411 json_array_append_new (list,
402 TALER_JSON_from_data (&sigs[newcoin_index], 412 TALER_JSON_from_data (buf,
403 sizeof (struct TALER_RSA_Signature))); 413 buf_size));
414 GNUNET_free (buf);
415 }
404 return TALER_MINT_reply_json (connection, 416 return TALER_MINT_reply_json (connection,
405 root, 417 root,
406 MHD_HTTP_OK); 418 MHD_HTTP_OK);