diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-04-10 22:18:50 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-04-10 22:18:50 +0200 |
commit | dd63d2f8462175a1636f5ea05fd8d75d66887ceb (patch) | |
tree | 6530ca821a732fabf0c23f74b13ccb8f110e5734 | |
parent | d04360879ef1719ecdffd7fa202c53463550b691 (diff) |
fix type of transfer keys
-rw-r--r-- | src/include/taler_crypto_lib.h | 6 | ||||
-rw-r--r-- | src/mint/taler-mint-httpd_db.c | 22 |
2 files changed, 9 insertions, 19 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index d2fd2598b..d7d12354a 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -101,9 +101,8 @@ struct TALER_TransferPublicKeyP { /** * Taler uses ECDSA for transfer keys. - * FIXME: should this not be ECDHE? */ - struct GNUNET_CRYPTO_EcdsaPublicKey ecdsa_pub; + struct GNUNET_CRYPTO_EcdhePublicKey ecdhe_pub; }; @@ -115,9 +114,8 @@ struct TALER_TransferPrivateKeyP { /** * Taler uses ECDSA for melting session keys. - * FIXME: should this not be ECDHE? */ - struct GNUNET_CRYPTO_EcdsaPrivateKey ecdsa_priv; + struct GNUNET_CRYPTO_EcdhePrivateKey ecdhe_priv; }; diff --git a/src/mint/taler-mint-httpd_db.c b/src/mint/taler-mint-httpd_db.c index d8ce9e1c4..d2f446350 100644 --- a/src/mint/taler-mint-httpd_db.c +++ b/src/mint/taler-mint-httpd_db.c @@ -782,8 +782,6 @@ check_commitment (struct MHD_Connection *connection, unsigned int j; struct TALER_LinkSecretP last_shared_secret; int secret_initialized = GNUNET_NO; - struct GNUNET_CRYPTO_EcdhePublicKey coin_ecdhe; - struct GNUNET_CRYPTO_EcdhePrivateKey transfer_ecdhe; struct TALER_MINTDB_RefreshCommitLinkP *commit_links; struct TALER_MINTDB_RefreshCommitCoin *commit_coins; @@ -809,8 +807,8 @@ check_commitment (struct MHD_Connection *connection, struct TALER_LinkSecretP shared_secret; struct TALER_TransferPublicKeyP transfer_pub_check; - GNUNET_CRYPTO_ecdsa_key_get_public (&transfer_privs[j].ecdsa_priv, - &transfer_pub_check.ecdsa_pub); + GNUNET_CRYPTO_ecdhe_key_get_public (&transfer_privs[j].ecdhe_priv, + &transfer_pub_check.ecdhe_pub); if (0 != memcmp (&transfer_pub_check, &commit_links[j].transfer_pub, @@ -822,31 +820,25 @@ check_commitment (struct MHD_Connection *connection, /* FIXME: return more specific error with original signature (#3712) */ return (MHD_YES == TMH_RESPONSE_reply_refresh_reveal_missmatch (connection, - off, - j, - "transfer key")) + off, + j, + "transfer key")) ? GNUNET_NO : GNUNET_SYSERR; } /* We're converting key types here, which is not very nice * but necessary and harmless (keys will be thrown away later). */ - GNUNET_CRYPTO_ecdsa_public_to_ecdhe (&melts[j].coin.coin_pub.ecdsa_pub, - &coin_ecdhe); - GNUNET_CRYPTO_ecdsa_private_to_ecdhe (&transfer_privs[j].ecdsa_priv, - &transfer_ecdhe); if (GNUNET_OK != - GNUNET_CRYPTO_ecc_ecdh (&transfer_ecdhe, - &coin_ecdhe, + GNUNET_CRYPTO_ecc_ecdh (&transfer_privs[j].ecdhe_priv, + &melts[j].coin.coin_pub.ecdhe_pub, &transfer_secret.key)) { GNUNET_break (0); - GNUNET_CRYPTO_ecdhe_key_clear (&transfer_ecdhe); GNUNET_free (commit_links); return (MHD_YES == TMH_RESPONSE_reply_internal_error (connection, "ECDH error")) ? GNUNET_NO : GNUNET_SYSERR; } - GNUNET_CRYPTO_ecdhe_key_clear (&transfer_ecdhe); if (GNUNET_OK != TALER_transfer_decrypt (&commit_links[j].shared_secret_enc, &transfer_secret, |