diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-26 12:22:26 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-26 12:22:26 +0100 |
commit | ae917eeee0a3100538cf71972a0cadcc80098d80 (patch) | |
tree | b974e974b53cc258aa24adc448c1df4cbc0d9e49 /src/mint/taler-mint-httpd_responses.c | |
parent | d4506f8a041385f7695b04b1ddfacb894d05da5c (diff) |
intermediary commit, breaking the build by starting to move towards variable-size GNUnet signatures instead of fixed-size signatures; much broken now
Diffstat (limited to 'src/mint/taler-mint-httpd_responses.c')
-rw-r--r-- | src/mint/taler-mint-httpd_responses.c | 22 |
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, const struct CollectableBlindcoin *collectable) { json_t *root = json_object (); + size_t sig_buf_size; + char *sig_buf; + sig_buf_size = GNUNET_CRYPTO_rsa_signature_encode (collectable->sig, + &sig_buf); json_object_set_new (root, "ev_sig", - TALER_JSON_from_data (&collectable->ev_sig, - sizeof (struct TALER_RSA_Signature))); + TALER_JSON_from_data (sig_buf, + sig_buf_size)); + GNUNET_free (sig_buf); return TALER_MINT_reply_json (connection, root, MHD_HTTP_OK); @@ -388,19 +393,26 @@ TALER_MINT_reply_refresh_commit_success (struct MHD_Connection *connection, int TALER_MINT_reply_refresh_reveal_success (struct MHD_Connection *connection, unsigned int num_newcoins, - const struct TALER_RSA_Signature *sigs) + const struct GNUNET_CRYPTO_rsa_Signature *sigs) { int newcoin_index; json_t *root; json_t *list; + char *buf; + size_t buf_size; root = json_object (); list = json_array (); json_object_set_new (root, "ev_sigs", list); for (newcoin_index = 0; newcoin_index < num_newcoins; newcoin_index++) + { + buf_size = GNUNET_CRYPTO_rsa_signature_encode (&sigs[newcoin_index], + &buf); json_array_append_new (list, - TALER_JSON_from_data (&sigs[newcoin_index], - sizeof (struct TALER_RSA_Signature))); + TALER_JSON_from_data (buf, + buf_size)); + GNUNET_free (buf); + } return TALER_MINT_reply_json (connection, root, MHD_HTTP_OK); |