From 1e8529a19ed41d4ea8c92ab855d6b24a9f7b9899 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 8 Aug 2015 21:48:13 +0200 Subject: [PATCH] add missing conclusion over melt session hash computation --- src/mint-lib/mint_api_refresh.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mint-lib/mint_api_refresh.c b/src/mint-lib/mint_api_refresh.c index 3012957d6..51571009f 100644 --- a/src/mint-lib/mint_api_refresh.c +++ b/src/mint-lib/mint_api_refresh.c @@ -985,6 +985,10 @@ TALER_MINT_refresh_prepare (unsigned int num_melts, GNUNET_free (link_enc); } } + GNUNET_CRYPTO_hash_context_finish (hash_context, + &md.melt_session_hash); + + /* finally, serialize everything */ buf = serialize_melt_data (&md, res_size); free_melt_data (&md); @@ -1075,6 +1079,8 @@ verify_refresh_melt_signature_ok (struct TALER_MINT_RefreshMeltHandle *rmh, GNUNET_break_op (0); return GNUNET_SYSERR; } + + /* check that mint signing key is permitted */ key_state = TALER_MINT_get_keys (rmh->mint); if (GNUNET_OK != TALER_MINT_test_signing_key (key_state, @@ -1083,11 +1089,15 @@ verify_refresh_melt_signature_ok (struct TALER_MINT_RefreshMeltHandle *rmh, GNUNET_break_op (0); return GNUNET_SYSERR; } + + /* check that noreveal index is in permitted range */ if (TALER_CNC_KAPPA >= *noreveal_index) { GNUNET_break_op (0); return GNUNET_SYSERR; } + + /* verify signature by mint */ confirm.purpose.purpose = htonl (TALER_SIGNATURE_MINT_CONFIRM_MELT); confirm.purpose.size = htonl (sizeof (confirm)); confirm.session_hash = rmh->md->melt_session_hash;