aboutsummaryrefslogtreecommitdiff
path: root/src/mint
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
parentad4759b46ab6492180c5abd7c164d94ad9125898 (diff)
moving core refresh crypto logic to util -- towards fixing #3777
Diffstat (limited to 'src/mint')
-rw-r--r--src/mint/taler-mint-httpd_db.c31
-rw-r--r--src/mint/taler-mint-httpd_refresh.c6
2 files changed, 11 insertions, 26 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;
diff --git a/src/mint/taler-mint-httpd_refresh.c b/src/mint/taler-mint-httpd_refresh.c
index 0f9dbfa0c..759c55bb2 100644
--- a/src/mint/taler-mint-httpd_refresh.c
+++ b/src/mint/taler-mint-httpd_refresh.c
@@ -783,9 +783,9 @@ handle_refresh_reveal_json (struct MHD_Connection *connection,
res = (GNUNET_SYSERR == res) ? MHD_NO : MHD_YES;
else
res = TMH_DB_execute_refresh_reveal (connection,
- session_hash,
- num_oldcoins,
- transfer_privs);
+ session_hash,
+ num_oldcoins,
+ transfer_privs);
for (i = 0; i < TALER_CNC_KAPPA - 1; i++)
GNUNET_free (transfer_privs[i]);
return res;