[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-318-gf7711e6

by Werner Koch cvs at cvs.gnupg.org
Fri Oct 18 13:09:01 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  f7711e6eb5f02d03c74911f6f037ab28075e7c0d (commit)
       via  91e007606f1f6f8e1416c403fe809d47fddf9b1f (commit)
       via  4776dcd394ce59fa50d959921857b3427c5a63c8 (commit)
      from  b22417158c50ec3a0b2ff55b4ade063b42a87e8f (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 f7711e6eb5f02d03c74911f6f037ab28075e7c0d
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 17 18:08:59 2013 +0200

    tests: Add test options to keygen.
    
    * tests/keygen.c (usage): New.
    (main): Print usage info.  Allow running just one algo.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tests/keygen.c b/tests/keygen.c
index 2b98c42..5ab8e9d 100644
--- a/tests/keygen.c
+++ b/tests/keygen.c
@@ -470,6 +470,19 @@ progress_cb (void *cb_data, const char *what, int printchar,
 }
 
 
+static void
+usage (int mode)
+{
+  fputs ("usage: " PGM " [options] [{rsa|elg|dsa|ecc|nonce}]\n"
+         "Options:\n"
+         "  --verbose       be verbose\n"
+         "  --debug         flyswatter\n"
+         "  --progress      print progress indicators\n",
+         mode? stderr : stdout);
+  if (mode)
+    exit (1);
+}
+
 int
 main (int argc, char **argv)
 {
@@ -489,12 +502,7 @@ main (int argc, char **argv)
         }
       else if (!strcmp (*argv, "--help"))
         {
-          fputs ("usage: " PGM " [options]\n"
-                 "Options:\n"
-                 "  --verbose       be verbose\n"
-                 "  --debug         flyswatter\n"
-                 "  --progress      print progress indicators\n",
-                 stdout);
+          usage (0);
           exit (0);
         }
       else if (!strcmp (*argv, "--verbose"))
@@ -515,6 +523,8 @@ main (int argc, char **argv)
         }
       else if (!strncmp (*argv, "--", 2))
         die ("unknown option '%s'", *argv);
+      else
+        break;
     }
 
   if (!gcry_check_version (GCRYPT_VERSION))
@@ -528,11 +538,30 @@ main (int argc, char **argv)
   if (with_progress)
     gcry_set_progress_handler (progress_cb, NULL);
 
-  check_rsa_keys ();
-  check_elg_keys ();
-  check_dsa_keys ();
-  check_ecc_keys ();
-  check_nonce ();
+  if (!argc)
+    {
+      check_rsa_keys ();
+      check_elg_keys ();
+      check_dsa_keys ();
+      check_ecc_keys ();
+      check_nonce ();
+    }
+  else
+    {
+      for (; argc; argc--, argv++)
+        if (!strcmp (*argv, "rsa"))
+          check_rsa_keys ();
+        else if (!strcmp (*argv, "elg"))
+          check_elg_keys ();
+        else if (!strcmp (*argv, "dsa"))
+          check_dsa_keys ();
+        else if (!strcmp (*argv, "ecc"))
+          check_ecc_keys ();
+        else if (!strcmp (*argv, "nonce"))
+          check_nonce ();
+        else
+          usage (1);
+    }
 
   return error_count? 1:0;
 }

commit 91e007606f1f6f8e1416c403fe809d47fddf9b1f
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 17 18:07:28 2013 +0200

    mpi: Do not clear the sign of the mpi_mod result.
    
    * mpi/mpi-mod.c (_gcry_mpi_mod): Remove sign setting.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/mpi/mpi-mod.c b/mpi/mpi-mod.c
index 3d6248b..d48d7f4 100644
--- a/mpi/mpi-mod.c
+++ b/mpi/mpi-mod.c
@@ -47,7 +47,6 @@ void
 _gcry_mpi_mod (gcry_mpi_t rem, gcry_mpi_t dividend, gcry_mpi_t divisor)
 {
   _gcry_mpi_fdiv_r (rem, dividend, divisor);
-  rem->sign = 0;
 }
 
 

commit 4776dcd394ce59fa50d959921857b3427c5a63c8
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 17 18:01:48 2013 +0200

    ecc: Put the curve name again into the output of gcry_pk_genkey.
    
    * cipher/ecc.c (ecc_generate): Use the correct var.  Release
    CURVE_FLAGS.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/cipher/ecc.c b/cipher/ecc.c
index 8b61ae4..6f3cbbd 100644
--- a/cipher/ecc.c
+++ b/cipher/ecc.c
@@ -1568,7 +1568,7 @@ ecc_generate (const gcry_sexp_t genparms, gcry_sexp_t *r_skey)
 
   if (ed25519_with_ecdsa)
     {
-      rc = gcry_sexp_build (&curve_info, NULL, "(flags ecdsa)");
+      rc = gcry_sexp_build (&curve_flags, NULL, "(flags ecdsa)");
       if (rc)
         goto leave;
     }
@@ -1613,6 +1613,7 @@ ecc_generate (const gcry_sexp_t genparms, gcry_sexp_t *r_skey)
   mpi_free (x);
   mpi_free (y);
   _gcry_mpi_ec_free (ctx);
+  gcry_sexp_release (curve_flags);
   gcry_sexp_release (curve_info);
   return rc;
 }

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

Summary of changes:
 cipher/ecc.c   |    3 ++-
 mpi/mpi-mod.c  |    1 -
 tests/keygen.c |   51 ++++++++++++++++++++++++++++++++++++++++-----------
 3 files changed, 42 insertions(+), 13 deletions(-)


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




More information about the Gnupg-commits mailing list