gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: fix refresh/link tests


From: gnunet
Subject: [taler-exchange] branch master updated: fix refresh/link tests
Date: Tue, 08 Feb 2022 09:58:25 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 8cbe16a2 fix refresh/link tests
8cbe16a2 is described below

commit 8cbe16a2203d581ad2bdfcd7240653d1ee416634
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Feb 8 09:58:22 2022 +0100

    fix refresh/link tests
---
 src/include/taler_crypto_lib.h                     | 25 ++--------------------
 src/lib/exchange_api_refreshes_reveal.c            | 20 +++++++++--------
 src/testing/Makefile.am                            |  3 ++-
 ...=> test_auditor_api_expire_reserve_now-cs.conf} |  2 +-
 ...> test_auditor_api_expire_reserve_now-rsa.conf} |  2 +-
 src/testing/testing_api_cmd_refresh.c              | 16 +++++++++++++-
 src/util/wallet_signatures.c                       | 10 +++------
 7 files changed, 35 insertions(+), 43 deletions(-)

diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 8c2479b9..89aa6ba8 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);
 
@@ -2303,25 +2301,6 @@ TALER_wallet_link_verify (
   const struct TALER_CoinSpendSignatureP *coin_sig);
 
 
-/**
- * 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.
  *
diff --git a/src/lib/exchange_api_refreshes_reveal.c 
b/src/lib/exchange_api_refreshes_reveal.c
index 38ca9331..acef3e19 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 ae0d67b6..16c7a563 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
similarity index 59%
copy from src/testing/test_auditor_api_expire_reserve_now.conf
copy to src/testing/test_auditor_api_expire_reserve_now-cs.conf
index c2bf8f47..7277a0df 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.conf 
b/src/testing/test_auditor_api_expire_reserve_now-rsa.conf
similarity index 58%
rename from src/testing/test_auditor_api_expire_reserve_now.conf
rename to src/testing/test_auditor_api_expire_reserve_now-rsa.conf
index c2bf8f47..788cc36f 100644
--- a/src/testing/test_auditor_api_expire_reserve_now.conf
+++ b/src/testing/test_auditor_api_expire_reserve_now-rsa.conf
@@ -1,4 +1,4 @@
-@INLINE@ test_auditor_api.conf
+@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 dd70b438..07476a7b 100644
--- a/src/testing/testing_api_cmd_refresh.c
+++ b/src/testing/testing_api_cmd_refresh.c
@@ -121,6 +121,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.
    */
@@ -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 bc4903e0..669ea6dd 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);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]