summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-22 17:14:47 +0100
committerChristian Grothoff <christian@grothoff.org>2015-03-22 17:14:47 +0100
commit6c1081f1b50770d18df998915d8d74be383ad1bf (patch)
tree694ff2613fe5711f3fb9cf34032a474e84f44e30
parent1d7bb2d091fc6a87cb2b5b2f2e584ed6c3cc56db (diff)
downloadexchange-6c1081f1b50770d18df998915d8d74be383ad1bf.tar.gz
exchange-6c1081f1b50770d18df998915d8d74be383ad1bf.tar.bz2
exchange-6c1081f1b50770d18df998915d8d74be383ad1bf.zip
fix #3642
-rw-r--r--src/mint/taler-mint-httpd_refresh.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c
index 1fafd9481..d6bf3c428 100644
--- a/src/mint/taler-mint-httpd_refresh.c
+++ b/src/mint/taler-mint-httpd_refresh.c
@@ -493,6 +493,28 @@ handle_refresh_melt_json (struct MHD_Connection *connection,
GNUNET_free (denom_pubs);
return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
}
+ /* Check that the client does not try to melt the same coin twice
+ into the same session! */
+ for (j=0;j<i;j++)
+ {
+ if (0 == memcmp (&coin_public_infos[i].coin_pub,
+ &coin_public_infos[j].coin_pub,
+ sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)))
+ {
+ for (j=0;j<i;j++)
+ {
+ GNUNET_CRYPTO_rsa_public_key_free (coin_public_infos[j].denom_pub);
+ GNUNET_CRYPTO_rsa_signature_free (coin_public_infos[j].denom_sig);
+ }
+ GNUNET_free (coin_public_infos);
+ for (j=0;j<num_new_denoms;j++)
+ GNUNET_CRYPTO_rsa_public_key_free (denom_pubs[j]);
+ GNUNET_free (coin_melt_details);
+ GNUNET_free (denom_pubs);
+ return TALER_MINT_reply_external_error (connection,
+ "melting same coin twice in same session is not allowed");
+ }
+ }
}