[git] GnuPG - branch, master, updated. gnupg-2.1.15-305-geec365a

by Neal H. Walfield cvs at cvs.gnupg.org
Sun Oct 30 19:06:14 CET 2016


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, master has been updated
       via  eec365a02bd35d2d5c9e4d2c8d18bcd9180cf859 (commit)
       via  614ca00676bb8ca12b5107fec0e4ef8818445254 (commit)
      from  b6f08dbb0b45059cdbbb5d9be9725e437f42a8cc (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 eec365a02bd35d2d5c9e4d2c8d18bcd9180cf859
Author: Neal H. Walfield <neal at g10code.com>
Date:   Sun Oct 30 11:03:51 2016 -0700

    g10: Avoid reading in keys when possible.
    
    * g10/tofu.c (build_conflict_set): If CONFLICT_SET contains a single
    element, don't bother to check for cross sigs.  Add parameter PK.
    Update callers.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>

diff --git a/g10/tofu.c b/g10/tofu.c
index 6156bcc..a0f80b3 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -1821,7 +1821,9 @@ ask_about_binding (ctrl_t ctrl,
    email> (including the binding itself, which will be first in the
    list).  For each returned key also sets BINDING_NEW, etc.  */
 static strlist_t
-build_conflict_set (tofu_dbs_t dbs, const char *fingerprint, const char *email)
+build_conflict_set (tofu_dbs_t dbs,
+                    PKT_public_key *pk, const char *fingerprint,
+                    const char *email)
 {
   gpg_error_t rc;
   char *sqerr;
@@ -1898,6 +1900,18 @@ build_conflict_set (tofu_dbs_t dbs, const char *fingerprint, const char *email)
 
   /* Eliminate false conflicts.  */
 
+  if (conflict_set_count == 1)
+    /* We only have a single key.  There are no false conflicts to
+       eliminate.  But, we do need to set the flags.  */
+    {
+      if (pk->has_expired)
+        conflict_set->flags |= BINDING_EXPIRED;
+      if (pk->flags.revoked)
+        conflict_set->flags |= BINDING_REVOKED;
+
+      return conflict_set;
+    }
+
   /* If two keys have cross signatures, then they are controlled by
    * the same person and thus are not in conflict.  */
   kb_all = xcalloc (sizeof (kb_all[0]), conflict_set_count);
@@ -2267,7 +2281,7 @@ get_trust (ctrl_t ctrl, PKT_public_key *pk,
 
 
   /* Look for conflicts.  This is needed in all 3 cases.  */
-  conflict_set = build_conflict_set (dbs, fingerprint, email);
+  conflict_set = build_conflict_set (dbs, pk, fingerprint, email);
   conflict_set_count = strlist_length (conflict_set);
   if (conflict_set_count == 0)
     {

commit 614ca00676bb8ca12b5107fec0e4ef8818445254
Author: Neal H. Walfield <neal at g10code.com>
Date:   Sun Oct 30 10:54:21 2016 -0700

    g10: Fix bit setting.
    
    * g10/tofu.c (build_conflict_set): Fix bit setting.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>
    Fixes-commit: 1f1f56e606c1cb28eec68c60bd8bcb7ab30805de

diff --git a/g10/tofu.c b/g10/tofu.c
index d437c5a..6156bcc 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -1963,9 +1963,9 @@ build_conflict_set (tofu_dbs_t dbs, const char *fingerprint, const char *email)
       /* The binding is always expired/revoked if the key is
        * expired/revoked.  */
       if (binding_pk->has_expired)
-        iter->flags &= BINDING_EXPIRED;
+        iter->flags |= BINDING_EXPIRED;
       if (binding_pk->flags.revoked)
-        iter->flags &= BINDING_REVOKED;
+        iter->flags |= BINDING_REVOKED;
 
       /* The binding is also expired/revoked if the user id is
        * expired/revoked.  */
@@ -1986,9 +1986,9 @@ build_conflict_set (tofu_dbs_t dbs, const char *fingerprint, const char *email)
               found_user_id = 1;
 
               if (user_id2->is_revoked)
-                iter->flags &= BINDING_REVOKED;
+                iter->flags |= BINDING_REVOKED;
               if (user_id2->is_expired)
-                iter->flags &= BINDING_EXPIRED;
+                iter->flags |= BINDING_EXPIRED;
             }
 
           xfree (email2);

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

Summary of changes:
 g10/tofu.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)


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




More information about the Gnupg-commits mailing list