gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 22/37: cleanup


From: gnunet
Subject: [taler-exchange] 22/37: cleanup
Date: Fri, 04 Feb 2022 16:53:52 +0100

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

gian-demarmels pushed a commit to branch master
in repository exchange.

commit 4c7aa097840eb3254a6823177abcc90fa7ccf0d0
Author: Gian Demarmels <gian@demarmels.org>
AuthorDate: Fri Jan 7 16:33:00 2022 +0100

    cleanup
---
 src/util/taler-exchange-secmod-cs.c |  6 +++---
 src/util/test_helper_cs.c           | 23 +++++++++++------------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/util/taler-exchange-secmod-cs.c 
b/src/util/taler-exchange-secmod-cs.c
index 5c567587..d7624a0b 100644
--- a/src/util/taler-exchange-secmod-cs.c
+++ b/src/util/taler-exchange-secmod-cs.c
@@ -1081,7 +1081,6 @@ parse_key (struct Denomination *denom,
            const void *buf,
            size_t buf_size)
 {
-  struct GNUNET_CRYPTO_CsPrivateKey priv;
   char *anchor_s;
   char dummy;
   unsigned long long anchor_ll;
@@ -1119,8 +1118,9 @@ parse_key (struct Denomination *denom,
     return;
   }
 
-  // TODO: memcpy or cast?
-  memcpy (&priv, buf, sizeof(priv));
+  const struct GNUNET_CRYPTO_CsPrivateKey priv
+    = *((struct GNUNET_CRYPTO_CsPrivateKey *) buf);
+//  memcpy (&priv, buf, sizeof(priv));
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "privkey %zu\n",
diff --git a/src/util/test_helper_cs.c b/src/util/test_helper_cs.c
index b4a5f54c..501a398f 100644
--- a/src/util/test_helper_cs.c
+++ b/src/util/test_helper_cs.c
@@ -264,7 +264,6 @@ test_revocation (struct TALER_CRYPTO_CsDenominationHelper 
*dh)
 static int
 test_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh)
 {
-  struct TALER_DenominationCsPublicR r_pub;
   enum TALER_ErrorCode ec;
   bool success = false;
   struct TALER_PlanchetSecretsP ps;
@@ -287,11 +286,12 @@ test_r_derive (struct TALER_CRYPTO_CsDenominationHelper 
*dh)
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Requesting R derivation with key %s\n",
                   GNUNET_h2s (&keys[i].h_cs.hash));
-      r_pub = TALER_CRYPTO_helper_cs_r_derive (dh,
-                                               &keys[i].h_cs,
-                                               &pd.blinded_planchet.details.
-                                               cs_blinded_planchet.nonce,
-                                               &ec);
+      ps.cs_r_pub = TALER_CRYPTO_helper_cs_r_derive (dh,
+                                                     &keys[i].h_cs,
+                                                     &pd.blinded_planchet.
+                                                     details.
+                                                     cs_blinded_planchet.nonce,
+                                                     &ec);
     }
     switch (ec)
     {
@@ -318,12 +318,11 @@ test_r_derive (struct TALER_CRYPTO_CsDenominationHelper 
*dh)
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Received valid R for key %s\n",
                   GNUNET_h2s (&keys[i].h_cs.hash));
-      ps.cs_r_pub = r_pub;
+
       TALER_blinding_secret_create (&ps.blinding_key,
                                     TALER_DENOMINATION_CS,
                                     &ps.coin_priv,
                                     &ps.cs_r_pub);
-      // TODO: sometimes the tests fail here in a calculation in gnunet. needs 
to be further analysed.
       GNUNET_assert (GNUNET_OK ==
                      TALER_planchet_prepare (&keys[i].denom_pub,
                                              &ps,
@@ -376,10 +375,10 @@ test_r_derive (struct TALER_CRYPTO_CsDenominationHelper 
*dh)
     GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
                                 &nonce,
                                 sizeof (nonce));
-    r_pub = TALER_CRYPTO_helper_cs_r_derive (dh,
-                                             &rnd,
-                                             &nonce,
-                                             &ec);
+    ps.cs_r_pub = TALER_CRYPTO_helper_cs_r_derive (dh,
+                                                   &rnd,
+                                                   &nonce,
+                                                   &ec);
     if (TALER_EC_EXCHANGE_GENERIC_DENOMINATION_KEY_UNKNOWN != ec)
     {
       GNUNET_break (0);

-- 
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]