[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-246-g10789e3

by Werner Koch cvs at cvs.gnupg.org
Thu Aug 6 15:42:29 CEST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".

The branch, master has been updated
       via  10789e3cdda7b944acb4b59624c34a2ccfaea6e5 (commit)
       via  1d896371fbc94c605fce35eabcde01e24dd22892 (commit)
      from  e93f4c21c59756604440ad8cbf27e67d29c99ffd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 10789e3cdda7b944acb4b59624c34a2ccfaea6e5
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Aug 6 14:57:44 2015 +0200

    tools: Fix memory leak for functions "I" and "G".
    
    * src/mpicalc.c (do_inv, do_gcd): Init A after stack check.
    --
    
    Reported-by: Ismo Puustinen <ismo.puustinen at intel.com>
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/mpicalc.c b/src/mpicalc.c
index f1fbbef..ebd1bbb 100644
--- a/src/mpicalc.c
+++ b/src/mpicalc.c
@@ -200,12 +200,14 @@ do_powm (void)
 static void
 do_inv (void)
 {
-  gcry_mpi_t a = mpi_new (0);
+  gcry_mpi_t a;
+
   if (stackidx < 2)
     {
       fputs ("stack underflow\n", stderr);
       return;
     }
+  a = mpi_new (0);
   mpi_invm (a, stack[stackidx - 2], stack[stackidx - 1]);
   mpi_set (stack[stackidx - 2], a);
   mpi_release (a);
@@ -215,12 +217,14 @@ do_inv (void)
 static void
 do_gcd (void)
 {
-  gcry_mpi_t a = mpi_new (0);
+  gcry_mpi_t a;
+
   if (stackidx < 2)
     {
       fputs ("stack underflow\n", stderr);
       return;
     }
+  a = mpi_new (0);
   mpi_gcd (a, stack[stackidx - 2], stack[stackidx - 1]);
   mpi_set (stack[stackidx - 2], a);
   mpi_release (a);

commit 1d896371fbc94c605fce35eabcde01e24dd22892
Author: Ismo Puustinen <ismo.puustinen at intel.com>
Date:   Wed Aug 5 15:27:43 2015 +0300

    ecc: Free memory also when in error branch.
    
    * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_sign): Init DISGEST and goto
    leave on error.
    --
    
    Fixing an issue found by static analysis.
    
    Signed-off-by: Ismo Puustinen <ismo.puustinen at intel.com>
    
    Added DIGEST init and wrote Changelog.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c
index 4323d8e..1e95489 100644
--- a/cipher/ecc-eddsa.c
+++ b/cipher/ecc-eddsa.c
@@ -580,7 +580,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey,
   mpi_ec_t ctx = NULL;
   int b;
   unsigned int tmp;
-  unsigned char *digest;
+  unsigned char *digest = NULL;
   gcry_buffer_t hvec[3];
   const void *mbuf;
   size_t mlen;
@@ -607,8 +607,10 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey,
   ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0,
                                      skey->E.p, skey->E.a, skey->E.b);
   b = (ctx->nbits+7)/8;
-  if (b != 256/8)
-    return GPG_ERR_INTERNAL; /* We only support 256 bit. */
+  if (b != 256/8) {
+    rc = GPG_ERR_INTERNAL; /* We only support 256 bit. */
+    goto leave;
+  }
 
   rc = _gcry_ecc_eddsa_compute_h_d (&digest, skey->d, ctx);
   if (rc)

-----------------------------------------------------------------------

Summary of changes:
 cipher/ecc-eddsa.c | 8 +++++---
 src/mpicalc.c      | 8 ++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org




More information about the Gnupg-commits mailing list