hash inputs to sign_fdh functions as required by new API
This commit is contained in:
parent
9bc96506bb
commit
4154e41a41
@ -335,6 +335,7 @@ PERF_TALER_EXCHANGEDB_coin_init (
|
|||||||
{
|
{
|
||||||
struct PERF_TALER_EXCHANGEDB_Coin *coin;
|
struct PERF_TALER_EXCHANGEDB_Coin *coin;
|
||||||
struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
|
struct GNUNET_CRYPTO_EddsaPrivateKey *priv;
|
||||||
|
struct GNUNET_HashCode hc;
|
||||||
|
|
||||||
coin = GNUNET_new (struct PERF_TALER_EXCHANGEDB_Coin);
|
coin = GNUNET_new (struct PERF_TALER_EXCHANGEDB_Coin);
|
||||||
GNUNET_assert (NULL != coin);
|
GNUNET_assert (NULL != coin);
|
||||||
@ -350,11 +351,12 @@ PERF_TALER_EXCHANGEDB_coin_init (
|
|||||||
&coin->public_info.coin_pub.eddsa_pub);
|
&coin->public_info.coin_pub.eddsa_pub);
|
||||||
coin->public_info.denom_pub.rsa_public_key =
|
coin->public_info.denom_pub.rsa_public_key =
|
||||||
GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key);
|
GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key);
|
||||||
// This is broken at the moment because it needs to be a hash of a coin public key.
|
GNUNET_CRYPTO_hash (&coin->public_info.coin_pub,
|
||||||
|
sizeof (struct TALER_CoinSpendPublicKeyP),
|
||||||
|
&hc);
|
||||||
coin->public_info.denom_sig.rsa_signature =
|
coin->public_info.denom_sig.rsa_signature =
|
||||||
GNUNET_CRYPTO_rsa_sign_fdh (dki->denom_priv.rsa_private_key,
|
GNUNET_CRYPTO_rsa_sign_fdh (dki->denom_priv.rsa_private_key,
|
||||||
&coin->public_info.coin_pub,
|
&hc);
|
||||||
sizeof (struct TALER_CoinSpendPublicKeyP));
|
|
||||||
GNUNET_assert (NULL != coin->public_info.denom_pub.rsa_public_key);
|
GNUNET_assert (NULL != coin->public_info.denom_pub.rsa_public_key);
|
||||||
GNUNET_assert (NULL != coin->public_info.denom_sig.rsa_signature);
|
GNUNET_assert (NULL != coin->public_info.denom_sig.rsa_signature);
|
||||||
|
|
||||||
|
@ -335,12 +335,15 @@ test_melting (struct TALER_EXCHANGEDB_Session *session)
|
|||||||
melts = GNUNET_new_array (MELT_OLD_COINS, struct TALER_EXCHANGEDB_RefreshMelt);
|
melts = GNUNET_new_array (MELT_OLD_COINS, struct TALER_EXCHANGEDB_RefreshMelt);
|
||||||
for (cnt=0; cnt < MELT_OLD_COINS; cnt++)
|
for (cnt=0; cnt < MELT_OLD_COINS; cnt++)
|
||||||
{
|
{
|
||||||
|
struct GNUNET_HashCode hc;
|
||||||
|
|
||||||
RND_BLK (&melts[cnt].coin.coin_pub);
|
RND_BLK (&melts[cnt].coin.coin_pub);
|
||||||
// This appears to be broken because it needs to be a hash of a coin public key
|
GNUNET_CRYPTO_hash (&melts[cnt].coin.coin_pub,
|
||||||
|
sizeof (melts[cnt].coin.coin_pub),
|
||||||
|
&hc);
|
||||||
melts[cnt].coin.denom_sig.rsa_signature =
|
melts[cnt].coin.denom_sig.rsa_signature =
|
||||||
GNUNET_CRYPTO_rsa_sign_fdh (dkp->priv.rsa_private_key,
|
GNUNET_CRYPTO_rsa_sign_fdh (dkp->priv.rsa_private_key,
|
||||||
&melts[cnt].coin.coin_pub,
|
&hc);
|
||||||
sizeof (melts[cnt].coin.coin_pub));
|
|
||||||
melts[cnt].coin.denom_pub = dkp->pub;
|
melts[cnt].coin.denom_pub = dkp->pub;
|
||||||
RND_BLK (&melts[cnt].coin_sig);
|
RND_BLK (&melts[cnt].coin_sig);
|
||||||
melts[cnt].session_hash = session_hash;
|
melts[cnt].session_hash = session_hash;
|
||||||
@ -569,6 +572,7 @@ run (void *cls,
|
|||||||
struct TALER_EXCHANGEDB_Deposit deposit;
|
struct TALER_EXCHANGEDB_Deposit deposit;
|
||||||
struct TALER_EXCHANGEDB_Deposit deposit2;
|
struct TALER_EXCHANGEDB_Deposit deposit2;
|
||||||
struct TALER_WireTransferIdentifierRawP wtid;
|
struct TALER_WireTransferIdentifierRawP wtid;
|
||||||
|
struct GNUNET_HashCode hc;
|
||||||
json_t *wire;
|
json_t *wire;
|
||||||
json_t *just;
|
json_t *just;
|
||||||
const char * const json_wire_str =
|
const char * const json_wire_str =
|
||||||
@ -663,10 +667,12 @@ run (void *cls,
|
|||||||
RND_BLK(&cbc.h_coin_envelope);
|
RND_BLK(&cbc.h_coin_envelope);
|
||||||
RND_BLK(&cbc.reserve_sig);
|
RND_BLK(&cbc.reserve_sig);
|
||||||
cbc.denom_pub = dkp->pub;
|
cbc.denom_pub = dkp->pub;
|
||||||
|
GNUNET_CRYPTO_hash (&cbc.h_coin_envelope,
|
||||||
|
sizeof (cbc.h_coin_envelope),
|
||||||
|
&hc);
|
||||||
cbc.sig.rsa_signature
|
cbc.sig.rsa_signature
|
||||||
= GNUNET_CRYPTO_rsa_sign_fdh (dkp->priv.rsa_private_key,
|
= GNUNET_CRYPTO_rsa_sign_fdh (dkp->priv.rsa_private_key,
|
||||||
&cbc.h_coin_envelope,
|
&hc);
|
||||||
sizeof (cbc.h_coin_envelope));
|
|
||||||
cbc.reserve_pub = reserve_pub;
|
cbc.reserve_pub = reserve_pub;
|
||||||
cbc.amount_with_fee = value;
|
cbc.amount_with_fee = value;
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
@ -890,6 +896,7 @@ main (int argc,
|
|||||||
"test-exchange-db-%s", plugin_name);
|
"test-exchange-db-%s", plugin_name);
|
||||||
(void) GNUNET_asprintf (&config_filename,
|
(void) GNUNET_asprintf (&config_filename,
|
||||||
"%s.conf", testname);
|
"%s.conf", testname);
|
||||||
|
|
||||||
argv2[0] = argv[0];
|
argv2[0] = argv[0];
|
||||||
argv2[2] = config_filename;
|
argv2[2] = config_filename;
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
|
Loading…
Reference in New Issue
Block a user