gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated (bc15478c -> b461fc6f)


From: gnunet
Subject: [taler-exchange] branch master updated (bc15478c -> b461fc6f)
Date: Wed, 09 Feb 2022 10:03:13 +0100

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

grothoff pushed a change to branch master
in repository exchange.

    from bc15478c -fix leak
     new e82d1832 -dce
     new b461fc6f -simpilify

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/util/crypto.c | 63 +++++++++----------------------------------------------
 1 file changed, 10 insertions(+), 53 deletions(-)

diff --git a/src/util/crypto.c b/src/util/crypto.c
index a32a1023..03c3ea0f 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -411,73 +411,30 @@ TALER_planchet_to_coin (
   const struct TALER_ExchangeWithdrawValues *alg_values,
   struct TALER_FreshCoin *coin)
 {
-  struct TALER_DenominationSignature sig;
-
-  if (dk->cipher != blind_sig->cipher
-      && dk->cipher != alg_values->cipher)
+  if ( (dk->cipher != blind_sig->cipher) ||
+       (dk->cipher != alg_values->cipher) )
   {
     GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
-
-  switch (dk->cipher)
+  if (GNUNET_OK !=
+      TALER_denom_sig_unblind (&coin->sig,
+                               blind_sig,
+                               bks,
+                               dk))
   {
-  case TALER_DENOMINATION_RSA:
-    if (GNUNET_OK !=
-        TALER_denom_sig_unblind (&sig,
-                                 blind_sig,
-                                 bks,
-                                 dk))
-    {
-      GNUNET_break_op (0);
-      return GNUNET_SYSERR;
-    }
-    break;
-  case TALER_DENOMINATION_CS:
-    {
-      struct GNUNET_CRYPTO_CsC c[2];
-      struct GNUNET_CRYPTO_CsBlindingSecret bs[2];
-      struct TALER_DenominationCSPublicRPairP r_pub_blind;
-
-      GNUNET_CRYPTO_cs_blinding_secrets_derive (&bks->nonce,
-                                                bs);
-      GNUNET_CRYPTO_cs_calc_blinded_c (
-        bs,
-        alg_values->details.cs_values.r_pub_pair.r_pub,
-        &dk->details.cs_public_key,
-        &c_hash->hash,
-        sizeof(struct GNUNET_HashCode),
-        c,
-        r_pub_blind.r_pub);
-      sig.details.cs_signature.r_point
-        = r_pub_blind.r_pub[blind_sig->details.blinded_cs_answer.b];
-      if (GNUNET_OK !=
-          TALER_denom_sig_unblind (&sig,
-                                   blind_sig,
-                                   bks,
-                                   dk))
-      {
-        GNUNET_break_op (0);
-        return GNUNET_SYSERR;
-      }
-      break;
-    }
-  default:
-    GNUNET_break (0);
+    GNUNET_break_op (0);
     return GNUNET_SYSERR;
   }
-
   if (GNUNET_OK !=
       TALER_denom_pub_verify (dk,
-                              &sig,
+                              &coin->sig,
                               c_hash))
   {
     GNUNET_break_op (0);
-    TALER_denom_sig_free (&sig);
+    TALER_denom_sig_free (&coin->sig);
     return GNUNET_SYSERR;
   }
-
-  coin->sig = sig;
   coin->coin_priv = *coin_priv;
   return GNUNET_OK;
 }

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