summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-08 09:58:22 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-08 09:58:22 +0100
commit8cbe16a2203d581ad2bdfcd7240653d1ee416634 (patch)
treede88ac97f6e2b9593c697405766bf87421ddca6a
parent133cf76f0d193e8226e53690b62de74e6b0f68d0 (diff)
downloadexchange-8cbe16a2203d581ad2bdfcd7240653d1ee416634.tar.gz
exchange-8cbe16a2203d581ad2bdfcd7240653d1ee416634.tar.bz2
exchange-8cbe16a2203d581ad2bdfcd7240653d1ee416634.zip
fix refresh/link tests
-rw-r--r--src/include/taler_crypto_lib.h25
-rw-r--r--src/lib/exchange_api_refreshes_reveal.c20
-rw-r--r--src/testing/Makefile.am3
-rw-r--r--src/testing/test_auditor_api_expire_reserve_now-cs.conf (renamed from src/testing/test_auditor_api_expire_reserve_now.conf)2
-rw-r--r--src/testing/test_auditor_api_expire_reserve_now-rsa.conf4
-rw-r--r--src/testing/testing_api_cmd_refresh.c16
-rw-r--r--src/util/wallet_signatures.c10
7 files changed, 38 insertions, 42 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 8c2479b98..89aa6ba81 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -2270,16 +2270,14 @@ TALER_wallet_melt_verify (
*
* @param h_denom_pub hash of the denomiantion public key of the new coin
* @param transfer_pub transfer public key
- * @param coin_ev coin envelope
- * @param coin_ev_size number of bytes in @a coin_ev
+ * @param bch blinded coin hash
* @param old_coin_priv private key to sign with
* @param[out] coin_sig resulting signature
*/
void
TALER_wallet_link_sign (const struct TALER_DenominationHash *h_denom_pub,
const struct TALER_TransferPublicKeyP *transfer_pub,
- const void *coin_ev,
- size_t coin_ev_size,
+ const struct TALER_BlindedCoinHash *bch,
const struct TALER_CoinSpendPrivateKeyP *old_coin_priv,
struct TALER_CoinSpendSignatureP *coin_sig);
@@ -2304,25 +2302,6 @@ TALER_wallet_link_verify (
/**
- * Sign link data.
- *
- * @param h_denom_pub hash of the denomiantion public key of the new coin
- * @param transfer_pub transfer public key
- * @param coin_ev coin envelope
- * @param coin_ev_size number of bytes in @a coin_ev
- * @param old_coin_priv private key to sign with
- * @param[out] coin_sig resulting signature
- */
-void
-TALER_wallet_link_sign (const struct TALER_DenominationHash *h_denom_pub,
- const struct TALER_TransferPublicKeyP *transfer_pub,
- const void *coin_ev,
- size_t coin_ev_size,
- const struct TALER_CoinSpendPrivateKeyP *old_coin_priv,
- struct TALER_CoinSpendSignatureP *coin_sig);
-
-
-/**
* Verify recoup signature.
*
* @param h_denom_pub hash of the denomiantion public key of the coin
diff --git a/src/lib/exchange_api_refreshes_reveal.c b/src/lib/exchange_api_refreshes_reveal.c
index 38ca93310..acef3e19b 100644
--- a/src/lib/exchange_api_refreshes_reveal.c
+++ b/src/lib/exchange_api_refreshes_reveal.c
@@ -418,15 +418,17 @@ TALER_EXCHANGE_refreshes_reveal (
&pd.blinded_planchet))));
{
struct TALER_CoinSpendSignatureP link_sig;
-
- TALER_wallet_link_sign (&denom_hash,
- &transfer_pub,
- pd.blinded_planchet.details.rsa_blinded_planchet.
- blinded_msg,
- pd.blinded_planchet.details.rsa_blinded_planchet.
- blinded_msg_size,
- &md.melted_coin.coin_priv,
- &link_sig);
+ struct TALER_BlindedCoinHash bch;
+
+ TALER_coin_ev_hash (&pd.blinded_planchet,
+ &denom_hash,
+ &bch);
+ TALER_wallet_link_sign (
+ &denom_hash,
+ &transfer_pub,
+ &bch,
+ &md.melted_coin.coin_priv,
+ &link_sig);
GNUNET_assert (0 ==
json_array_append_new (
link_sigs,
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index ae0d67b61..16c7a563f 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -484,7 +484,8 @@ test_kyc_api_LDADD = \
EXTRA_DIST = \
test_auditor_api.conf \
- test_auditor_api_expire_reserve_now.conf \
+ test_auditor_api_expire_reserve_now-cs.conf \
+ test_auditor_api_expire_reserve_now-rsa.conf \
test_bank_api_fakebank.conf \
test_bank_api_fakebank_twisted.conf \
test_bank_api_pybank.conf \
diff --git a/src/testing/test_auditor_api_expire_reserve_now.conf b/src/testing/test_auditor_api_expire_reserve_now-cs.conf
index c2bf8f479..7277a0dff 100644
--- a/src/testing/test_auditor_api_expire_reserve_now.conf
+++ b/src/testing/test_auditor_api_expire_reserve_now-cs.conf
@@ -1,4 +1,4 @@
-@INLINE@ test_auditor_api.conf
+@INLINE@ test_auditor_api-cs.conf
[exchangedb]
IDLE_RESERVE_EXPIRATION_TIME = 0 s
diff --git a/src/testing/test_auditor_api_expire_reserve_now-rsa.conf b/src/testing/test_auditor_api_expire_reserve_now-rsa.conf
new file mode 100644
index 000000000..788cc36f8
--- /dev/null
+++ b/src/testing/test_auditor_api_expire_reserve_now-rsa.conf
@@ -0,0 +1,4 @@
+@INLINE@ test_auditor_api-rsa.conf
+
+[exchangedb]
+IDLE_RESERVE_EXPIRATION_TIME = 0 s
diff --git a/src/testing/testing_api_cmd_refresh.c b/src/testing/testing_api_cmd_refresh.c
index dd70b438a..07476a7b3 100644
--- a/src/testing/testing_api_cmd_refresh.c
+++ b/src/testing/testing_api_cmd_refresh.c
@@ -122,6 +122,12 @@ struct RefreshMeltState
struct TALER_ExchangeWithdrawValues *alg_values;
/**
+ * Array of @a num_fresh_coins of blinding key secrets
+ * created during the melt operation.
+ */
+ union TALER_DenominationBlindingKeyP *bks;
+
+ /**
* Entropy seed for the refresh-melt operation.
*/
struct TALER_PlanchetSecretsP ps;
@@ -970,6 +976,11 @@ melt_cb (void *cls,
memcpy (rms->alg_values,
alg_values,
num_coins * sizeof (struct TALER_ExchangeWithdrawValues));
+ rms->bks = GNUNET_new_array (num_coins,
+ union TALER_DenominationBlindingKeyP);
+ memcpy (rms->bks,
+ bks,
+ num_coins * sizeof (union TALER_DenominationBlindingKeyP));
}
if (0 != rms->total_backoff.rel_value_us)
{
@@ -1055,7 +1066,6 @@ melt_run (void *cls,
TALER_TESTING_interpreter_fail (rms->is);
return;
}
-
if (GNUNET_OK !=
TALER_TESTING_get_trait_denom_sig (coin_command,
0,
@@ -1172,6 +1182,7 @@ melt_cleanup (void *cls,
GNUNET_free (rms->fresh_pks);
}
GNUNET_free (rms->alg_values);
+ GNUNET_free (rms->bks);
GNUNET_free (rms->melt_fresh_amounts);
GNUNET_free (rms);
}
@@ -1205,6 +1216,9 @@ melt_traits (void *cls,
&rms->fresh_pks[index]),
TALER_TESTING_make_trait_coin_priv (0,
rms->melt_priv),
+ // ????
+ TALER_TESTING_make_trait_blinding_key (index,
+ &rms->bks[index]),
TALER_TESTING_trait_end ()
};
diff --git a/src/util/wallet_signatures.c b/src/util/wallet_signatures.c
index bc4903e0e..669ea6dd5 100644
--- a/src/util/wallet_signatures.c
+++ b/src/util/wallet_signatures.c
@@ -107,9 +107,7 @@ TALER_wallet_deposit_verify (
void
TALER_wallet_link_sign (const struct TALER_DenominationHash *h_denom_pub,
const struct TALER_TransferPublicKeyP *transfer_pub,
- // FIXME: consider passing hash!
- const void *coin_ev,
- size_t coin_ev_size,
+ const struct TALER_BlindedCoinHash *bch,
const struct TALER_CoinSpendPrivateKeyP *old_coin_priv,
struct TALER_CoinSpendSignatureP *coin_sig)
{
@@ -117,12 +115,10 @@ TALER_wallet_link_sign (const struct TALER_DenominationHash *h_denom_pub,
.purpose.size = htonl (sizeof (ldp)),
.purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_LINK),
.h_denom_pub = *h_denom_pub,
- .transfer_pub = *transfer_pub
+ .transfer_pub = *transfer_pub,
+ .coin_envelope_hash = *bch
};
- GNUNET_CRYPTO_hash (coin_ev,
- coin_ev_size,
- &ldp.coin_envelope_hash.hash);
GNUNET_CRYPTO_eddsa_sign (&old_coin_priv->eddsa_priv,
&ldp,
&coin_sig->eddsa_signature);