aboutsummaryrefslogtreecommitdiff
path: root/src/mint/taler-mint-httpd_db.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-04-15 18:12:21 +0200
committerChristian Grothoff <christian@grothoff.org>2015-04-15 18:12:21 +0200
commit97e403bb665ccf736a840c28c717fa7b3dc8de30 (patch)
treeb17e0dc04663ae4ebe4cddfca9eacc4a8117214b /src/mint/taler-mint-httpd_db.c
parentad4759b46ab6492180c5abd7c164d94ad9125898 (diff)
moving core refresh crypto logic to util -- towards fixing #3777
Diffstat (limited to 'src/mint/taler-mint-httpd_db.c')
-rw-r--r--src/mint/taler-mint-httpd_db.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c
index 12f5eecf2..53567a92a 100644
--- a/src/mint/taler-mint-httpd_db.c
+++ b/src/mint/taler-mint-httpd_db.c
@@ -849,7 +849,6 @@ check_commitment (struct MHD_Connection *connection,
for (j = 0; j < num_oldcoins; j++)
{
- struct TALER_TransferSecretP transfer_secret;
struct TALER_LinkSecretP shared_secret;
struct TALER_TransferPublicKeyP transfer_pub_check;
@@ -871,32 +870,18 @@ check_commitment (struct MHD_Connection *connection,
"transfer key");
}
- /* We're converting key types here, which is not very nice
- * but necessary and harmless (keys will be thrown away later). */
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecc_ecdh (&transfer_privs[j].ecdhe_priv,
- &melts[j].coin.coin_pub.ecdhe_pub,
- &transfer_secret.key))
- {
- GNUNET_break (0);
- GNUNET_free (commit_links);
- return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection,
- "ECDH error"))
- ? GNUNET_NO : GNUNET_SYSERR;
- }
- if (GNUNET_OK !=
- TALER_transfer_decrypt (&commit_links[j].shared_secret_enc,
- &transfer_secret,
- &shared_secret))
- {
- GNUNET_break (0);
+ TALER_link_decrypt_secret (&commit_links[j].shared_secret_enc,
+ &transfer_privs[j],
+ &melts[j].coin.coin_pub,
+ &shared_secret))
+ {
GNUNET_free (commit_links);
return (MHD_YES ==
- TMH_RESPONSE_reply_internal_error (connection,
- "Decryption error"))
- ? GNUNET_NO : GNUNET_SYSERR;
+ TMH_RESPONSE_reply_internal_error (connection,
+ "Transfer secret decryption error"))
+ ? GNUNET_NO : GNUNET_SYSERR;
}
-
if (GNUNET_NO == secret_initialized)
{
secret_initialized = GNUNET_YES;