[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-178-gd8e99a0

by Werner Koch cvs at cvs.gnupg.org
Mon Aug 5 19:29:40 CEST 2013


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  d8e99a04dba6a606e879464cd11deee760d1e000 (commit)
      from  10dfa41b43a906031bc674ea41cd3073701011f3 (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 d8e99a04dba6a606e879464cd11deee760d1e000
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Aug 5 18:58:41 2013 +0200

    mpi: Improve gcry_mpi_invm to detect bad input.
    
    * mpi/mpi-inv.c (gcry_mpi_invm): Return 0 for bad input.
    --
    
    Without this patch the function may enter and endless loop.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/mpi/mpi-inv.c b/mpi/mpi-inv.c
index 5d26946..15fa58f 100644
--- a/mpi/mpi-inv.c
+++ b/mpi/mpi-inv.c
@@ -165,6 +165,11 @@ gcry_mpi_invm( gcry_mpi_t x, gcry_mpi_t a, gcry_mpi_t n )
     int sign;
     int odd ;
 
+    if (!mpi_cmp_ui (a, 0))
+        return 0; /* Inverse does not exists.  */
+    if (!mpi_cmp_ui (n, 1))
+        return 0; /* Inverse does not exists.  */
+
     u = mpi_copy(a);
     v = mpi_copy(n);
 

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

Summary of changes:
 mpi/mpi-inv.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)


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




More information about the Gnupg-commits mailing list