diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-29 20:00:21 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-29 20:00:21 +0100 |
commit | 090ddf170bd6fcf1d3d3d9d4fcc720ccb86b089e (patch) | |
tree | 3fc2f500c96db57fdb6cff4c68f9d93bcf5e4389 /src/mint/taler-mint-httpd_responses.c | |
parent | 8ca555500f01ebb2f7286961588b81b4ee5ac4fe (diff) |
working on cleaning up /refresh/melt logic
Diffstat (limited to 'src/mint/taler-mint-httpd_responses.c')
-rw-r--r-- | src/mint/taler-mint-httpd_responses.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/mint/taler-mint-httpd_responses.c b/src/mint/taler-mint-httpd_responses.c index 892b92ca7..de0736bdc 100644 --- a/src/mint/taler-mint-httpd_responses.c +++ b/src/mint/taler-mint-httpd_responses.c @@ -518,43 +518,37 @@ TALER_MINT_reply_withdraw_sign_success (struct MHD_Connection *connection, /** - * Send a response for "/refresh/melt". + * Send a response for "/refresh/melt". Essentially we sign + * over the client's signature and public key, thereby + * demonstrating that we accepted all of the client's coins. * * @param connection the connection to send the response to - * @param db_conn the database connection to fetch values from + * @param signature the client's signature over the melt request * @param session_pub the refresh session public key. * @return a MHD result code */ int TALER_MINT_reply_refresh_melt_success (struct MHD_Connection *connection, - const struct RefreshSession *session, + const struct GNUNET_CRYPTO_EddsaSignature *signature, const struct GNUNET_CRYPTO_EddsaPublicKey *session_pub) { int ret; - json_t *list; - struct GNUNET_HashContext *hash_context; struct RefreshMeltResponseSignatureBody body; struct GNUNET_CRYPTO_EddsaSignature sig; json_t *sig_json; - list = json_array (); - hash_context = GNUNET_CRYPTO_hash_context_start (); body.purpose.size = htonl (sizeof (struct RefreshMeltResponseSignatureBody)); body.purpose.purpose = htonl (TALER_SIGNATURE_REFRESH_MELT_RESPONSE); - /* FIXME: should we not add something to the hash_context in the meantime? */ - GNUNET_CRYPTO_hash_context_finish (hash_context, - &body.melt_response_hash); + body.melt_client_signature = *signature; + body.session_key = *session_pub; TALER_MINT_keys_sign (&body.purpose, &sig); sig_json = TALER_JSON_from_sig (&body.purpose, &sig); - GNUNET_assert (NULL != sig_json); ret = TALER_MINT_reply_json_pack (connection, MHD_HTTP_OK, - "{s:o, s:o}", - "signature", sig_json, - "blind_session_pubs", list); + "{s:o}", + "signature", sig_json); json_decref (sig_json); - json_decref (list); return ret; } @@ -570,7 +564,7 @@ TALER_MINT_reply_refresh_melt_success (struct MHD_Connection *connection, */ int TALER_MINT_reply_refresh_commit_success (struct MHD_Connection *connection, - struct RefreshSession *refresh_session) + const struct RefreshSession *refresh_session) { struct RefreshCommitResponseSignatureBody body; struct GNUNET_CRYPTO_EddsaSignature sig; |