[git] GCRYPT - branch, master, updated. post-nuke-of-trailing-ws-20-gdd76819

by Werner Koch cvs at cvs.gnupg.org
Mon Mar 28 15:13:16 CEST 2011


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  dd76819014c4e9d75c4b9613e888f7536c676a46 (commit)
      from  9730275d294b4d9cbbb2453541f001c95f5f31a3 (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 dd76819014c4e9d75c4b9613e888f7536c676a46
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Mar 28 14:46:36 2011 +0200

    Fixed a few warnings emitted by gcc 4.6.

diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 3fba314..8961676 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,10 @@
+2011-03-28  Werner Koch  <wk at g10code.com>
+
+	* primegen.c (_gcry_generate_elg_prime): Make sure that PRIME is
+	NULL if the called func ever returns an error.
+
+	* pubkey.c (gcry_pk_decrypt): Remove unused var PUBKEY.
+
 2011-03-09  Werner Koch  <wk at g10code.com>
 
 	* kdf.c: New.
diff --git a/cipher/md.c b/cipher/md.c
index 053eab1..c3b3a4f 100644
--- a/cipher/md.c
+++ b/cipher/md.c
@@ -1232,6 +1232,7 @@ md_stop_debug( gcry_md_hd_t md )
     volatile u64 b = 42;
     volatile u64 c;
     c = a * b;
+    (void)c;
   }
 #endif
 }
diff --git a/cipher/primegen.c b/cipher/primegen.c
index edeb7c8..2788e34 100644
--- a/cipher/primegen.c
+++ b/cipher/primegen.c
@@ -738,12 +738,12 @@ gcry_mpi_t
 _gcry_generate_elg_prime (int mode, unsigned pbits, unsigned qbits,
 			  gcry_mpi_t g, gcry_mpi_t **ret_factors)
 {
-  gcry_err_code_t err = GPG_ERR_NO_ERROR;
   gcry_mpi_t prime = NULL;
 
-  err = prime_generate_internal ((mode == 1), &prime, pbits, qbits, g,
-				 ret_factors, GCRY_WEAK_RANDOM, 0, 0,
-                                 NULL, NULL);
+  if (prime_generate_internal ((mode == 1), &prime, pbits, qbits, g,
+                               ret_factors, GCRY_WEAK_RANDOM, 0, 0,
+                               NULL, NULL))
+    prime = NULL; /* (Should be NULL in the error case anyway.)  */
 
   return prime;
 }
diff --git a/cipher/pubkey.c b/cipher/pubkey.c
index d4a93c7..02eeecc 100644
--- a/cipher/pubkey.c
+++ b/cipher/pubkey.c
@@ -1755,7 +1755,6 @@ gcry_pk_decrypt (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t s_skey)
   int modern, want_pkcs1, flags;
   gcry_err_code_t rc;
   gcry_module_t module_enc = NULL, module_key = NULL;
-  gcry_pk_spec_t *pubkey = NULL;
 
   *r_plain = NULL;
 
@@ -1775,8 +1774,6 @@ gcry_pk_decrypt (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t s_skey)
       goto leave;
     }
 
-  pubkey = (gcry_pk_spec_t *) module_key->spec;
-
   rc = pubkey_decrypt (module_key->mod_id, &plain, data, skey, flags);
   if (rc)
     goto leave;
diff --git a/mpi/ChangeLog b/mpi/ChangeLog
index 227f451..7d32f5a 100644
--- a/mpi/ChangeLog
+++ b/mpi/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-28  Werner Koch  <wk at g10code.com>
+
+	* mpi-pow.c (gcry_mpi_powm): Remove unused var RSEC.
+
 2011-02-01  Werner Koch  <wk at g10code.com>
 
 	* mpi-cmp.c (gcry_mpi_cmp): Allow comparing of opaque MPIs.
diff --git a/mpi/mpi-pow.c b/mpi/mpi-pow.c
index fbdb7ce..33bbebe 100644
--- a/mpi/mpi-pow.c
+++ b/mpi/mpi-pow.c
@@ -45,7 +45,7 @@ gcry_mpi_powm (gcry_mpi_t res,
   mpi_size_t esize, msize, bsize, rsize;
   int               msign, bsign, rsign;
   /* Flags telling the secure allocation status of the arguments.  */
-  int        esec,  msec,  bsec,  rsec;
+  int        esec,  msec,  bsec;
   /* Size of the result including space for temporary values.  */
   mpi_size_t size;
   /* Helper.  */
@@ -71,7 +71,6 @@ gcry_mpi_powm (gcry_mpi_t res,
   esec = mpi_is_secure(expo);
   msec = mpi_is_secure(mod);
   bsec = mpi_is_secure(base);
-  rsec = mpi_is_secure(res);
 
   rp = res->d;
   ep = expo->d;
diff --git a/src/dumpsexp.c b/src/dumpsexp.c
index 6ea05e8..f6384d7 100644
--- a/src/dumpsexp.c
+++ b/src/dumpsexp.c
@@ -378,7 +378,7 @@ init_data (void)
 static void
 push_data (int c)
 {
-
+  (void)c;
 }
 
 /* Flush and thus print the current data chunk.  */
diff --git a/src/global.c b/src/global.c
index 51d7f39..cbb7eb8 100644
--- a/src/global.c
+++ b/src/global.c
@@ -534,6 +534,10 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr)
       err = _gcry_fips_run_selftests (1);
       break;
 
+#if _GCRY_GCC_VERSION >= 40600
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wswitch"
+#endif
     case 58:  /* Init external random test.  */
       {
         void **rctx        = va_arg (arg_ptr, void **);
@@ -568,6 +572,13 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr)
         _gcry_random_deinit_external_test (ctx);
       }
       break;
+    case 61:  /* RFU */
+      break;
+    case 62:  /* RFU */
+      break;
+#if _GCRY_GCC_VERSION >= 40600
+# pragma GCC diagnostic pop
+#endif
 
     case GCRYCTL_DISABLE_HWF:
       {
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 8ef49fc..e25f134 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-28  Werner Koch  <wk at g10code.com>
+
+	* random.c (readn): Remove used var P.
+
 2011-02-21  Werner Koch  <wk at g10code.com>
 
 	* version.c (main): Do a verbatim check of the version string.
diff --git a/tests/random.c b/tests/random.c
index 0575e8a..a243529 100644
--- a/tests/random.c
+++ b/tests/random.c
@@ -84,9 +84,7 @@ readn (int fd, void *buf, size_t buflen, size_t *ret_nread)
 {
   size_t nleft = buflen;
   int nread;
-  char *p;
 
-  p = buf;
   while ( nleft > 0 )
     {
       nread = read ( fd, buf, nleft );

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

Summary of changes:
 cipher/ChangeLog  |    7 +++++++
 cipher/md.c       |    1 +
 cipher/primegen.c |    8 ++++----
 cipher/pubkey.c   |    3 ---
 mpi/ChangeLog     |    4 ++++
 mpi/mpi-pow.c     |    3 +--
 src/dumpsexp.c    |    2 +-
 src/global.c      |   11 +++++++++++
 tests/ChangeLog   |    4 ++++
 tests/random.c    |    2 --
 10 files changed, 33 insertions(+), 12 deletions(-)


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




More information about the Gnupg-commits mailing list