[git] GnuPG - branch, STABLE-BRANCH-2-0, updated. gnupg-2.0.28-5-g0de9aed

by Werner Koch cvs at cvs.gnupg.org
Tue Jun 2 17:48:58 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 Privacy Guard".

The branch, STABLE-BRANCH-2-0 has been updated
       via  0de9aedf3eb73608eb4d1197b80e8cae6a0736a6 (commit)
       via  8a2134b8d50bd6a98a0a20fac9c2ac645e554e05 (commit)
       via  b2d9d105f717dc6c02ac81b5d987851279c4cd97 (commit)
       via  9dcf345a845c87e3beea1f757cd93ce229423972 (commit)
      from  03fb2db9f8d703c6484973ffbee7ff3520333b2c (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 0de9aedf3eb73608eb4d1197b80e8cae6a0736a6
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jun 2 17:46:42 2015 +0200

    doc: Replace "conventional encryption" by "symmetric encryption".
    
    --
    
    Suggested-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>

diff --git a/doc/DETAILS b/doc/DETAILS
index 65974dd..645814a 100644
--- a/doc/DETAILS
+++ b/doc/DETAILS
@@ -434,9 +434,9 @@ more arguments in future versions.
     DECRYPTION_OKAY
 	The decryption process succeeded.  This means, that either the
 	correct secret key has been used or the correct passphrase
-	for a conventional encrypted message was given.  The program
-	itself may return an errorcode because it may not be possible to
-	verify a signature for some reasons.
+	for a symmetric with passphrase encrypted message was given.
+        The program itself may return an errorcode because it may not
+        be possible to verify a signature for some reasons.
 
     NO_PUBKEY  <long keyid>
     NO_SECKEY  <long keyid>
diff --git a/doc/gpg-agent.texi b/doc/gpg-agent.texi
index b7b0d4c..9f20704 100644
--- a/doc/gpg-agent.texi
+++ b/doc/gpg-agent.texi
@@ -1177,7 +1177,7 @@ Replaced by a single @code{@@}
 @subsection Ask for a passphrase
 
 This function is usually used to ask for a passphrase to be used for
-conventional encryption, but may also be used by programs which need
+symmetric encryption, but may also be used by programs which need
 special handling of passphrases.  This command uses a syntax which helps
 clients to use the agent with minimum effort.
 
diff --git a/doc/gpg.texi b/doc/gpg.texi
index f5ffc04..2808562 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -2266,9 +2266,9 @@ to consider (e.g. @option{--symmetric}).
 @item --s2k-cipher-algo @code{name}
 @opindex s2k-cipher-algo
 Use @code{name} as the cipher algorithm used to protect secret keys.
-The default cipher is CAST5. This cipher is also used for
-conventional encryption if @option{--personal-cipher-preferences} and
- at option{--cipher-algo} is not given.
+The default cipher is CAST5. This cipher is also used for symmetric
+encryption with a passphrase if @option{--personal-cipher-preferences}
+and @option{--cipher-algo} is not given.
 
 @item --s2k-digest-algo @code{name}
 @opindex s2k-digest-algo
@@ -2281,7 +2281,7 @@ Selects how passphrases are mangled. If @code{n} is 0 a plain
 passphrase (which is not recommended) will be used, a 1 adds a salt to
 the passphrase and a 3 (the default) iterates the whole process a
 number of times (see --s2k-count).  Unless @option{--rfc1991} is used,
-this mode is also used for conventional encryption.
+this mode is also used for symmetric encryption with a passphrase.
 
 @item --s2k-count @code{n}
 @opindex s2k-count

commit 8a2134b8d50bd6a98a0a20fac9c2ac645e554e05
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jun 2 17:41:30 2015 +0200

    gpg: Consider that gcry_mpi_get_opaque may return NULL.
    
    * g10/seckey-cert.c (do_check): Handle a NULL opaque MPI.
    --
    
    This patch extends b2d9d10 for secret keys.  The problem is that we
    changed the semantics so that opaque MPIs may be NULL with a bit
    length.  This patch is not required in GnuPG 2 because we do not use
    secret keys there.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c
index 9995aa4..ad2f52d 100644
--- a/g10/seckey-cert.c
+++ b/g10/seckey-cert.c
@@ -40,7 +40,6 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
           int *canceled )
 {
     gpg_error_t err;
-    byte *buffer;
     u16 csum=0;
     int i, res;
     size_t nbytes;
@@ -116,10 +115,13 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
             p = gcry_mpi_get_opaque ( sk->skey[i], &ndatabits );
             ndata = (ndatabits+7)/8;
 
-            if ( ndata > 1 )
+            if ( ndata > 1 && p )
                 csumc = p[ndata-2] << 8 | p[ndata-1];
 	    data = xmalloc_secure ( ndata );
-	    gcry_cipher_decrypt ( cipher_hd, data, ndata, p, ndata );
+            if (p)
+              gcry_cipher_decrypt ( cipher_hd, data, ndata, p, ndata );
+            else
+              memset (data, 0, ndata);
 	    gcry_mpi_release (sk->skey[i]); sk->skey[i] = NULL ;
 
 	    p = data;
@@ -129,7 +131,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
                    attack */
                 sk->csum = 0;
                 csum = 1;
-                if( ndata < 20 ) 
+                if( ndata < 20 )
                     log_error("not enough bytes for SHA-1 checksum\n");
                 else {
                     gcry_md_hd_t h;
@@ -139,7 +141,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
                     gcry_md_write (h, data, ndata - 20);
                     gcry_md_final (h);
                     if (!memcmp (gcry_md_read (h, DIGEST_ALGO_SHA1),
-                                 data + ndata - 20, 20) ) 
+                                 data + ndata - 20, 20) )
                       {
                         /* Digest does match.  We have to keep the old
                            style checksum in sk->csum, so that the
@@ -147,7 +149,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
                            This test gets used when we are adding new
                            keys. */
                         sk->csum = csum = checksum (data, ndata-20);
-                      } 
+                      }
                     gcry_md_close (h);
                 }
             }
@@ -197,21 +199,28 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
 
                 assert (gcry_mpi_get_flag (sk->skey[i], GCRYMPI_FLAG_OPAQUE));
                 p = gcry_mpi_get_opaque (sk->skey[i], &ndatabits);
-                ndata = (ndatabits+7)/8;
-                assert (ndata >= 2);
-                assert (ndata == ((p[0] << 8 | p[1]) + 7)/8 + 2);
-                buffer = xmalloc_secure (ndata);
-		gcry_cipher_sync (cipher_hd);
-                buffer[0] = p[0];
-                buffer[1] = p[1];
-                gcry_cipher_decrypt (cipher_hd, buffer+2, ndata-2,
-                                     p+2, ndata-2);
-                csum += checksum (buffer, ndata);
-                gcry_mpi_release (sk->skey[i]);
-
-		err = gcry_mpi_scan( &sk->skey[i], GCRYMPI_FMT_PGP,
-				     buffer, ndata, &ndata );
-		xfree (buffer);
+                if (!p)
+                  err = -1;
+                else
+                  {
+                    byte *buffer;
+
+                    ndata = (ndatabits+7)/8;
+                    assert (ndata >= 2);
+                    assert (ndata == ((p[0] << 8 | p[1]) + 7)/8 + 2);
+                    buffer = xmalloc_secure (ndata);
+                    gcry_cipher_sync (cipher_hd);
+                    buffer[0] = p[0];
+                    buffer[1] = p[1];
+                    gcry_cipher_decrypt (cipher_hd, buffer+2, ndata-2,
+                                         p+2, ndata-2);
+                    csum += checksum (buffer, ndata);
+                    gcry_mpi_release (sk->skey[i]);
+
+                    err = gcry_mpi_scan( &sk->skey[i], GCRYMPI_FMT_PGP,
+                                         buffer, ndata, &ndata );
+                    xfree (buffer);
+                  }
                 if (err)
                   {
                     /* Checksum was okay, but not correctly
@@ -346,11 +355,11 @@ protect_secret_key( PKT_secret_key *sk, DEK *dek )
 
 	if ( openpgp_cipher_test_algo ( sk->protect.algo ) ) {
             /* Unsupport protection algorithm. */
-            rc = gpg_error (GPG_ERR_CIPHER_ALGO); 
+            rc = gpg_error (GPG_ERR_CIPHER_ALGO);
         }
 	else {
 	    print_cipher_algo_note( sk->protect.algo );
-	    
+
 	    if ( openpgp_cipher_open (&cipher_hd, sk->protect.algo,
 				      GCRY_CIPHER_MODE_CFB,
 				      (GCRY_CIPHER_SECURE
@@ -399,10 +408,10 @@ protect_secret_key( PKT_secret_key *sk, DEK *dek )
 		    p += narr[j];
 		    xfree(bufarr[j]);
 		}
-                
+
                 if (opt.simple_sk_checksum) {
                     log_info (_("generating the deprecated 16-bit checksum"
-                              " for secret key protection\n")); 
+                              " for secret key protection\n"));
                     csum = checksum( data, ndata-2);
                     sk->csum = csum;
                     *p++ =	csum >> 8;
@@ -458,7 +467,7 @@ protect_secret_key( PKT_secret_key *sk, DEK *dek )
 		    gcry_cipher_encrypt (cipher_hd, data+2, nbytes,
                                          buffer, nbytes);
 		    xfree( buffer );
-                    
+
                     gcry_mpi_release (sk->skey[i]);
                     sk->skey[i] = gcry_mpi_set_opaque (NULL,
                                                        data, (nbytes+2)*8 );

commit b2d9d105f717dc6c02ac81b5d987851279c4cd97
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Sat Feb 21 18:23:44 2015 -0500

    gpg: Fix segv due to NULL value stored as opaque MPI (BRANCH 2.0)
    
    * g10/build-packet.c (do_secret_key): Check for NULL return from
    gcry_mpi_get_opaque.
    * g10/keyid.c (hash_public_key): Ditto.
    --
    
    This is a backport of 76c8122adfed0f0f443cce7bda702ba2b39661b3 from
    master to the STABLE-BRANCH-2-0
    
    On the STABLE-BRANCH-2-0, we may also want to patch g10/seckey-cert.c,
    but that has not been done in this patch.
    
    This fix extends commmit 0835d2f44ef62eab51fce6a927908f544e01cf8f.
    
      gpg2 --export --no-default-keyring --keyring TESTDATA
    
    With TESTDATA being below after unpacking.
    
    -----BEGIN PGP ARMORED FILE-----
    
    mBMEhdkMmS8BcX8F//8F5voEhQAQmBMEnAAAZwAAo4D/f/8EhQAAAIAEnP8EhQAQ
    iBMEnP8AAAAABf8jIID///8EhQYQmBMEnIUAEIgTBKT/AAAAAAUAACCA/f//BIUA
    EJgTBJx/AP8ABPPzBJx/AP8ABPPz
    =2yE0
    -----END PGP ARMORED FILE-----
    
    Reported-by: Jodie Cunningham
    Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>

diff --git a/g10/build-packet.c b/g10/build-packet.c
index e986987..5cc03cf 100644
--- a/g10/build-packet.c
+++ b/g10/build-packet.c
@@ -398,7 +398,8 @@ do_secret_key( IOBUF out, int ctb, PKT_secret_key *sk )
 
       assert (gcry_mpi_get_flag (sk->skey[npkey], GCRYMPI_FLAG_OPAQUE));
       p = gcry_mpi_get_opaque (sk->skey[npkey], &ndatabits );
-      iobuf_write (a, p, (ndatabits+7)/8 );
+      if (p)
+        iobuf_write (a, p, (ndatabits+7)/8 );
     }
   else if ( sk->is_protected )
     {
@@ -410,7 +411,8 @@ do_secret_key( IOBUF out, int ctb, PKT_secret_key *sk )
 
           assert (gcry_mpi_get_flag (sk->skey[i], GCRYMPI_FLAG_OPAQUE));
           p = gcry_mpi_get_opaque (sk->skey[i], &ndatabits);
-          iobuf_write (a, p, (ndatabits+7)/8);
+          if (p)
+            iobuf_write (a, p, (ndatabits+7)/8);
         }
       write_16(a, sk->csum );
     }
diff --git a/g10/keyid.c b/g10/keyid.c
index 6af0f48..ef6ee1c 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -115,14 +115,18 @@ hash_public_key( gcry_md_hd_t md, PKT_public_key *pk )
   if(npkey==0 && pk->pkey[0]
      && gcry_mpi_get_flag (pk->pkey[0], GCRYMPI_FLAG_OPAQUE))
     {
-      gcry_md_write (md, pp[0], nn[0]);
+      if (pp[0])
+        gcry_md_write (md, pp[0], nn[0]);
     }
   else
-    for(i=0; i < npkey; i++ )
-      {
-	gcry_md_write ( md, pp[i], nn[i] );
-	xfree(pp[i]);
-      }
+    {
+      for(i=0; i < npkey; i++ )
+        {
+          if (pp[i])
+            gcry_md_write ( md, pp[i], nn[i] );
+          xfree(pp[i]);
+        }
+    }
 }
 
 static gcry_md_hd_t

commit 9dcf345a845c87e3beea1f757cd93ce229423972
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jun 2 17:20:56 2015 +0200

    doc: Typo fix for "Creation-Date".
    
    --
    
    Debian-bug-id: 760273
    
    This has already been fixed in master.

diff --git a/doc/gpg.texi b/doc/gpg.texi
index 06e772e..f5ffc04 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -3473,7 +3473,7 @@ sense.  Although OpenPGP works with time intervals, GnuPG uses an
 absolute value internally and thus the last year we can represent is
 2105.
 
- at item  Ceation-Date: @var{iso-date}
+ at item Creation-Date: @var{iso-date}
 Set the creation date of the key as stored in the key information and
 which is also part of the fingerprint calculation.  Either a date like
 "1986-04-26" or a full timestamp like "19860426T042640" may be used.

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

Summary of changes:
 doc/DETAILS        |  6 +++---
 doc/gpg-agent.texi |  2 +-
 doc/gpg.texi       | 10 ++++-----
 g10/build-packet.c |  6 ++++--
 g10/keyid.c        | 16 ++++++++------
 g10/seckey-cert.c  | 61 +++++++++++++++++++++++++++++++-----------------------
 6 files changed, 58 insertions(+), 43 deletions(-)


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




More information about the Gnupg-commits mailing list