gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated (488d2173 -> 30985c09)


From: gnunet
Subject: [taler-exchange] branch master updated (488d2173 -> 30985c09)
Date: Mon, 28 Mar 2022 12:34:17 +0200

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

oec pushed a change to branch master
in repository exchange.

    from 488d2173 -fix leaks in test_crypto.c
     new ccf2d69d -fix leak in test_age_restriction.c
     new 30985c09 -rename variable

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/age_restriction.c      | 34 +++++++++++++++++-----------------
 src/util/test_age_restriction.c | 11 ++++++++---
 2 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/src/util/age_restriction.c b/src/util/age_restriction.c
index 3f382ab7..bd6adb3a 100644
--- a/src/util/age_restriction.c
+++ b/src/util/age_restriction.c
@@ -171,25 +171,25 @@ enum GNUNET_GenericReturnValue
 TALER_age_commitment_derive (
   const struct TALER_AgeCommitmentProof *orig,
   const uint64_t salt,
-  struct TALER_AgeCommitmentProof *new)
+  struct TALER_AgeCommitmentProof *newacp)
 {
-  GNUNET_assert (NULL != new);
+  GNUNET_assert (NULL != newacp);
   GNUNET_assert (orig->proof.num <=
                  orig->commitment.num);
   GNUNET_assert (orig->commitment.num ==
                  __builtin_popcount (orig->commitment.mask.bits) - 1);
 
-  new->commitment.mask = orig->commitment.mask;
-  new->commitment.num = orig->commitment.num;
-  new->commitment.keys = GNUNET_new_array (
-    new->commitment.num,
+  newacp->commitment.mask = orig->commitment.mask;
+  newacp->commitment.num = orig->commitment.num;
+  newacp->commitment.keys = GNUNET_new_array (
+    newacp->commitment.num,
     struct TALER_AgeCommitmentPublicKeyP);
 
-  new->proof.num = orig->proof.num;
-  new->proof.keys = NULL;
-  if (0 != new->proof.num)
-    new->proof.keys = GNUNET_new_array (
-      new->proof.num,
+  newacp->proof.num = orig->proof.num;
+  newacp->proof.keys = NULL;
+  if (0 != newacp->proof.num)
+    newacp->proof.keys = GNUNET_new_array (
+      newacp->proof.num,
       struct TALER_AgeCommitmentPrivateKeyP);
 
 #ifndef AGE_RESTRICTION_WITH_ECDSA
@@ -200,7 +200,7 @@ TALER_age_commitment_derive (
       &orig->commitment.keys[i].pub,
       &salt,
       sizeof(salt),
-      &new->commitment.keys[i].pub);
+      &newacp->commitment.keys[i].pub);
   }
 
   /* 2. Derive the private keys */
@@ -210,7 +210,7 @@ TALER_age_commitment_derive (
       &orig->proof.keys[i].priv,
       &salt,
       sizeof(salt),
-      &new->proof.keys[i].priv);
+      &newacp->proof.keys[i].priv);
   }
 #else
   char label[sizeof(uint64_t) + 1] = {0};
@@ -227,7 +227,7 @@ TALER_age_commitment_derive (
       &orig->commitment.keys[i].pub,
       label,
       "age commitment derive",
-      &new->commitment.keys[i].pub);
+      &newacp->commitment.keys[i].pub);
   }
 
   /* 2. Derive the private keys */
@@ -238,7 +238,7 @@ TALER_age_commitment_derive (
       &orig->proof.keys[i].priv,
       label,
       "age commitment derive");
-    new->proof.keys[i].priv = *priv;
+    newacp->proof.keys[i].priv = *priv;
     GNUNET_free (priv);
   }
 #endif
@@ -352,9 +352,9 @@ TALER_age_commitment_verify (
     };
 
 #ifndef AGE_RESTRICTION_WITH_ECDSA
-  #define verify(a,b,c,d)      GNUNET_CRYPTO_edx25519_verify (a,b,c,d)
+  #define verify(a,b,c,d)      GNUNET_CRYPTO_edx25519_verify ((a),(b),(c),(d))
 #else
-  #define verify(a,b,c,d)      GNUNET_CRYPTO_ecdsa_verify (a,b,c,d)
+  #define verify(a,b,c,d)      GNUNET_CRYPTO_ecdsa_verify ((a),(b),(c),(d))
 #endif
     return verify (TALER_SIGNATURE_WALLET_AGE_ATTESTATION,
                    &at,
diff --git a/src/util/test_age_restriction.c b/src/util/test_age_restriction.c
index 0b182bd4..bf64a705 100644
--- a/src/util/test_age_restriction.c
+++ b/src/util/test_age_restriction.c
@@ -195,11 +195,11 @@ test_attestation (void)
 
         if (min_group <= age_group &&
             GNUNET_OK != ret)
-          return GNUNET_SYSERR;
+          ret = GNUNET_SYSERR;
 
         if (min_group > age_group &&
             GNUNET_NO != ret)
-          return GNUNET_SYSERR;
+          ret = GNUNET_SYSERR;
 
         if (min_group > age_group)
           continue;
@@ -218,9 +218,14 @@ test_attestation (void)
           min_group);
 
         if (GNUNET_OK != ret)
-          return ret;
+          break;
       }
+
+      TALER_age_commitment_proof_free (&acp[i]);
     }
+
+    if (GNUNET_SYSERR == ret)
+      return ret;
   }
   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]