[git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.18-6-gb89f57f

by Werner Koch cvs at cvs.gnupg.org
Wed Aug 20 13:26:00 CEST 2014


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 Privacy Guard".

The branch, STABLE-BRANCH-1-4 has been updated
       via  b89f57fe5db364f78154671e1b2fe1ecd1b5c407 (commit)
       via  ecf2728230788f413cf1864c3cbda73d63de8491 (commit)
       via  45e3b81114f40070dd638ac790f42df01b8c1484 (commit)
      from  d58552760b26d840824658814d59c8b1a25a4219 (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 b89f57fe5db364f78154671e1b2fe1ecd1b5c407
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Aug 20 13:25:17 2014 +0200

    mpi: Suppress set-but-unused-variables warnings.
    
    * include/types.h (GNUPG_GCC_ATTR_UNUSED): Define for gcc >= 3.5.
    * mpi/mpih-div.c (mpihelp_divmod_1, mpihelp_mod_1): Mark dummy as
     unused.
    * mpi/mpi-internal.h (UDIV_QRNND_PREINV): Mark _ql as unused.
    --
    
    Due to the use of macros and longlong.h, we use variables which are
    only used by some architectures.  At least gcc 4.7.2 prints new
    warnings about set but not used variables.  This patch silences them.

diff --git a/include/types.h b/include/types.h
index 6baccdb..3c52485 100644
--- a/include/types.h
+++ b/include/types.h
@@ -143,4 +143,13 @@ struct string_list {
 typedef struct string_list *STRLIST;
 typedef struct string_list *strlist_t;
 
+
+
+#if __GNUC__ > 2 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 )
+# define GNUPG_GCC_ATTR_UNUSED  __attribute__ ((unused))
+#else
+# define GNUPG_GCC_ATTR_UNUSED
+#endif
+
+
 #endif /*G10_TYPES_H*/
diff --git a/mpi/mpi-internal.h b/mpi/mpi-internal.h
index 46da08d..9f79781 100644
--- a/mpi/mpi-internal.h
+++ b/mpi/mpi-internal.h
@@ -157,7 +157,8 @@ typedef int mpi_size_t;        /* (must be a signed type) */
  */
 #define UDIV_QRNND_PREINV(q, r, nh, nl, d, di) \
     do {							    \
-	mpi_limb_t _q, _ql, _r; 				    \
+	mpi_limb_t _ql GNUPG_GCC_ATTR_UNUSED;                       \
+	mpi_limb_t _q, _r; 				            \
 	mpi_limb_t _xh, _xl;					    \
 	umul_ppmm (_q, _ql, (nh), (di));			    \
 	_q += (nh);	/* DI is 2**BITS_PER_MPI_LIMB too small */  \
diff --git a/mpi/mpih-div.c b/mpi/mpih-div.c
index 235a810..eedfabf 100644
--- a/mpi/mpih-div.c
+++ b/mpi/mpih-div.c
@@ -49,7 +49,7 @@ mpihelp_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
 {
     mpi_size_t i;
     mpi_limb_t n1, n0, r;
-    int dummy;
+    int dummy GNUPG_GCC_ATTR_UNUSED;
 
     /* Botch: Should this be handled at all?  Rely on callers?	*/
     if( !dividend_size )
@@ -398,7 +398,7 @@ mpihelp_divmod_1( mpi_ptr_t quot_ptr,
 {
     mpi_size_t i;
     mpi_limb_t n1, n0, r;
-    int dummy;
+    int dummy GNUPG_GCC_ATTR_UNUSED;
 
     if( !dividend_size )
 	return 0;

commit ecf2728230788f413cf1864c3cbda73d63de8491
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Aug 20 12:22:35 2014 +0200

    Fix strict-alias warnings for rijndael.c
    
    * cipher/rijndael.c (do_setkey, prepare_decryption): Use u32_a_t cast.
    --
    
    This extends commit 0ad1458f827c7602ef7f1a4652af05641fd02b62

diff --git a/cipher/rijndael.c b/cipher/rijndael.c
index 99ee4a0..57142df 100644
--- a/cipher/rijndael.c
+++ b/cipher/rijndael.c
@@ -1773,14 +1773,14 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
 #define W (ctx->keySched)
 
     for (j = KC-1; j >= 0; j--) {
-        *((u32*)tk[j]) = *((u32*)k[j]);
+        *((u32_a_t*)tk[j]) = *((u32_a_t*)k[j]);
     }
     r = 0;
     t = 0;
     /* copy values into round key array */
     for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
         for (; (j < KC) && (t < 4); j++, t++) {
-            *((u32*)W[r][t]) = *((u32*)tk[j]);
+            *((u32_a_t*)W[r][t]) = *((u32_a_t*)tk[j]);
         }
         if (t == 4) {
             r++;
@@ -1799,24 +1799,24 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
 
         if (KC != 8) {
             for (j = 1; j < KC; j++) {
-                *((u32*)tk[j]) ^= *((u32*)tk[j-1]);
+                *((u32_a_t*)tk[j]) ^= *((u32_a_t*)tk[j-1]);
             }
         } else {
             for (j = 1; j < KC/2; j++) {
-                *((u32*)tk[j]) ^= *((u32*)tk[j-1]);
+                *((u32_a_t*)tk[j]) ^= *((u32_a_t*)tk[j-1]);
             }
             tk[KC/2][0] ^= S[tk[KC/2 - 1][0]];
             tk[KC/2][1] ^= S[tk[KC/2 - 1][1]];
             tk[KC/2][2] ^= S[tk[KC/2 - 1][2]];
             tk[KC/2][3] ^= S[tk[KC/2 - 1][3]];
             for (j = KC/2 + 1; j < KC; j++) {
-                *((u32*)tk[j]) ^= *((u32*)tk[j-1]);
+                *((u32_a_t*)tk[j]) ^= *((u32_a_t*)tk[j-1]);
             }
         }
         /* copy values into round key array */
         for (j = 0; (j < KC) && (r < ROUNDS + 1); ) {
             for (; (j < KC) && (t < 4); j++, t++) {
-                *((u32*)W[r][t]) = *((u32*)tk[j]);
+                *((u32_a_t*)W[r][t]) = *((u32_a_t*)tk[j]);
             }
             if (t == 4) {
                 r++;
@@ -1845,29 +1845,29 @@ prepare_decryption( RIJNDAEL_context *ctx )
     byte *w;
 
     for (r=0; r < MAXROUNDS+1; r++ ) {
-        *((u32*)ctx->keySched2[r][0]) = *((u32*)ctx->keySched[r][0]);
-        *((u32*)ctx->keySched2[r][1]) = *((u32*)ctx->keySched[r][1]);
-        *((u32*)ctx->keySched2[r][2]) = *((u32*)ctx->keySched[r][2]);
-        *((u32*)ctx->keySched2[r][3]) = *((u32*)ctx->keySched[r][3]);
+        *((u32_a_t*)ctx->keySched2[r][0]) = *((u32_a_t*)ctx->keySched[r][0]);
+        *((u32_a_t*)ctx->keySched2[r][1]) = *((u32_a_t*)ctx->keySched[r][1]);
+        *((u32_a_t*)ctx->keySched2[r][2]) = *((u32_a_t*)ctx->keySched[r][2]);
+        *((u32_a_t*)ctx->keySched2[r][3]) = *((u32_a_t*)ctx->keySched[r][3]);
     }
 #define W (ctx->keySched2)
     for (r = 1; r < ctx->ROUNDS; r++) {
         w = W[r][0];
-        *((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
-                   ^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
+        *((u32_a_t*)w) = *((u32_a_t*)U1[w[0]]) ^ *((u32_a_t*)U2[w[1]])
+                       ^ *((u32_a_t*)U3[w[2]]) ^ *((u32_a_t*)U4[w[3]]);
 
         w = W[r][1];
-        *((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
-                   ^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
+        *((u32_a_t*)w) = *((u32_a_t*)U1[w[0]]) ^ *((u32_a_t*)U2[w[1]])
+                       ^ *((u32_a_t*)U3[w[2]]) ^ *((u32_a_t*)U4[w[3]]);
 
         w = W[r][2];
-        *((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
-                   ^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
+        *((u32_a_t*)w) = *((u32_a_t*)U1[w[0]]) ^ *((u32_a_t*)U2[w[1]])
+                       ^ *((u32_a_t*)U3[w[2]]) ^ *((u32_a_t*)U4[w[3]]);
 
         w = W[r][3];
-        *((u32*)w) = *((u32*)U1[w[0]]) ^ *((u32*)U2[w[1]])
-                   ^ *((u32*)U3[w[2]]) ^ *((u32*)U4[w[3]]);
-    }
+        *((u32_a_t*)w) = *((u32_a_t*)U1[w[0]]) ^ *((u32_a_t*)U2[w[1]])
+                       ^ *((u32_a_t*)U3[w[2]]) ^ *((u32_a_t*)U4[w[3]]);
+}
 #undef W
 }
 

commit 45e3b81114f40070dd638ac790f42df01b8c1484
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Aug 20 12:05:16 2014 +0200

    gpg: Allow compressed data with algorithm 0.
    
    * g10/mainproc.c (proc_compressed): Remove superfluous check for
    an algorithm number of 0.
    --
    
    (backport from commit 88633bf3d417aeb5ea0f75508aba8e32adc8acef)
    
    GnuPG-bug-id: 1326, 1684

diff --git a/g10/mainproc.c b/g10/mainproc.c
index 5b6d8db..1e140ed 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -778,10 +778,7 @@ proc_compressed( CTX c, PACKET *pkt )
     PKT_compressed *zd = pkt->pkt.compressed;
     int rc;
 
-    /*printf("zip: compressed data packet\n");*/
-    if( !zd->algorithm )
-      rc=G10ERR_COMPR_ALGO;
-    else if( c->sigs_only )
+    if (c->sigs_only)
 	rc = handle_compressed( c, zd, proc_compressed_cb, c );
     else if( c->encrypt_only )
 	rc = handle_compressed( c, zd, proc_encrypt_cb, c );

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

Summary of changes:
 cipher/rijndael.c  |   38 +++++++++++++++++++-------------------
 g10/mainproc.c     |    5 +----
 include/types.h    |    9 +++++++++
 mpi/mpi-internal.h |    3 ++-
 mpi/mpih-div.c     |    4 ++--
 5 files changed, 33 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list