gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 23/28: REVOCATION: don't leak signature purpose memory.


From: gnunet
Subject: [gnunet] 23/28: REVOCATION: don't leak signature purpose memory.
Date: Mon, 06 Feb 2023 06:19:25 +0100

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

commit 76a3a328b726bef62d4ae767fc19f61f52ebbb67
Author: ulfvonbelow <strilen@tilde.club>
AuthorDate: Sun Jan 29 05:49:49 2023 -0600

    REVOCATION: don't leak signature purpose memory.
    
    Signed-off-by: Martin Schanzenbach <schanzen@gnunet.org>
---
 src/revocation/revocation_api.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index a0813ddcd..327b03494 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -427,20 +427,18 @@ check_signature_identity (const struct 
GNUNET_REVOCATION_PowP *pow,
   struct GNUNET_REVOCATION_SignaturePurposePS *spurp;
   unsigned char *sig;
   size_t ksize;
+  int ret;
 
   ksize = GNUNET_IDENTITY_public_key_get_length (key);
   spurp = REV_create_signature_message (pow);
   sig = ((unsigned char*) &pow[1] + ksize);
-  if (GNUNET_OK !=
-      GNUNET_IDENTITY_signature_verify_raw_ (
-        GNUNET_SIGNATURE_PURPOSE_REVOCATION,
-        &spurp->purpose,
-        sig,
-        key))
-  {
-    return GNUNET_SYSERR;
-  }
-  return GNUNET_OK;
+  ret =
+    GNUNET_IDENTITY_signature_verify_raw_ (GNUNET_SIGNATURE_PURPOSE_REVOCATION,
+                                           &spurp->purpose,
+                                           sig,
+                                           key);
+  GNUNET_free (spurp);
+  return ret == GNUNET_OK ? GNUNET_OK : GNUNET_SYSERR;
 }
 
 
@@ -588,6 +586,7 @@ sign_pow_identity (const struct GNUNET_IDENTITY_PrivateKey 
*key,
   int result = GNUNET_IDENTITY_sign_raw_ (key,
                                           &rp->purpose,
                                           (void*) sig);
+  GNUNET_free (rp);
   if (result == GNUNET_SYSERR)
     return GNUNET_NO;
   else

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