[git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.19-5-gb3fd304

by NIIBE Yutaka cvs at cvs.gnupg.org
Tue May 19 03:22:49 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-1-4 has been updated
       via  b3fd30451a5464b124b0296afbc341cb98b3977c (commit)
      from  04667cabef2d6aaa214b288482bb902c891893a5 (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 b3fd30451a5464b124b0296afbc341cb98b3977c
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Tue May 19 10:14:09 2015 +0900

    g10: Improve handling of no corresponding public key.
    
    * g10/getkey.c (get_seckey): Return G10ERR_NO_PUBKEY when it's not
    exact match.
    
    --
    
    In the situation of corrupted .gnupg/ where only private subkey is
    available but no corresponding public key of the subkey, the code
    returned public primary key which caused mysterious error (for a
    user).  This fix detects an error earlier.
    
    GnuPG-bug-id: 1422
    Debian-Bug-Id: #638619

diff --git a/g10/getkey.c b/g10/getkey.c
index d5d1135..fc3c179 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -498,7 +498,19 @@ get_seckey( PKT_secret_key *sk, u32 *keyid )
     ctx.req_usage = sk->req_usage;
     rc = lookup( &ctx, &kb, 1 );
     if ( !rc ) {
+        u32 skid[2];
+
         sk_from_block ( &ctx, sk, kb );
+        keyid_from_sk ( sk, skid );
+        /*
+         * Make sure it's exact match of keyid.
+         * If not, it's secret subkey with no public key.
+         */
+        if (!(keyid[0] == skid[0] && keyid[1] == skid[1])) {
+          log_error (_("key %s: secret key without public key"
+                       " - skipped\n"), keystr(keyid));
+          rc = G10ERR_NO_PUBKEY;
+        }
     }
     get_seckey_end( &ctx );
     release_kbnode ( kb );

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

Summary of changes:
 g10/getkey.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)


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




More information about the Gnupg-commits mailing list