[git] GnuPG - branch, master, updated. gnupg-2.1.19-11-g1813f3b

by Werner Koch cvs at cvs.gnupg.org
Fri Mar 3 09:38:39 CET 2017


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  1813f3be23bdab5a42070424c47cb8daa9d9e6b7 (commit)
      from  b1f48da02b474e985161aa2778d7b602a13c4292 (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 1813f3be23bdab5a42070424c47cb8daa9d9e6b7
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Mar 3 09:22:40 2017 +0100

    gpg: Add new variables to the import and export filters.
    
    * g10/import.c (impex_filter_getval): Add new variables "expired",
    "revoked", and "disabled".
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/gpg.texi b/doc/gpg.texi
index 20a2d12..55482b1 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -2359,14 +2359,25 @@ The available properties are:
   @item primary
   Boolean indicating whether the user id is the primary one.  (keep-uid)
 
+  @item expired
+  Boolean indicating whether a user id (keep-uid), a key (drop-subkey), or a
+  signature (drop-sig) expired.
+
+  @item revoked
+  Boolean indicating whether a user id (keep-uid) or a key (drop-subkey) has
+  been revoked.
+
+  @item disabled
+  Boolean indicating whether a primary key is disabled. (not used)
+
   @item secret
   Boolean indicating whether a key or subkey is a secret one.
-  drop-subkey)
+  (drop-subkey)
 
   @item sig_created
   @itemx sig_created_d
   The first is the timestamp a signature packet was created.  The
-  second is the same but given as an ISO string,
+  second is the same but given as an ISO date string,
   e.g. "2016-08-17". (drop-sig)
 
   @item sig_algo
diff --git a/g10/export.c b/g10/export.c
index 4138261..323bf17 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -1377,7 +1377,7 @@ apply_drop_subkey_filter (kbnode_t keyblock, recsel_expr_t selector)
         {
           if (recsel_select (selector, impex_filter_getval, node))
             {
-              log_debug ("drop-subkey: deleting a key\n");
+              /*log_debug ("drop-subkey: deleting a key\n");*/
               /* The subkey packet and all following packets up to the
                * next subkey.  */
               delete_kbnode (node);
diff --git a/g10/import.c b/g10/import.c
index 45ec07a..9fd16c8 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -1164,7 +1164,7 @@ check_prefs (ctrl_t ctrl, kbnode_t keyblock)
 }
 
 
-/* Helper for apply_*_filter in im,port.c and export.c.  */
+/* Helper for apply_*_filter in import.c and export.c.  */
 const char *
 impex_filter_getval (void *cookie, const char *propname)
 {
@@ -1175,19 +1175,30 @@ impex_filter_getval (void *cookie, const char *propname)
 
   if (node->pkt->pkttype == PKT_USER_ID)
     {
+      PKT_user_id *uid = node->pkt->pkt.user_id;
+
       if (!strcmp (propname, "uid"))
-        result = node->pkt->pkt.user_id->name;
+        result = uid->name;
       else if (!strcmp (propname, "mbox"))
         {
-          if (!node->pkt->pkt.user_id->mbox)
+          if (!uid->mbox)
             {
-              node->pkt->pkt.user_id->mbox
-                = mailbox_from_userid (node->pkt->pkt.user_id->name);
+              uid->mbox = mailbox_from_userid (uid->name);
             }
-          result = node->pkt->pkt.user_id->mbox;
+          result = uid->mbox;
         }
       else if (!strcmp (propname, "primary"))
-        result = node->pkt->pkt.user_id->is_primary? "1":"0";
+        {
+          result = uid->is_primary? "1":"0";
+        }
+      else if (!strcmp (propname, "expired"))
+        {
+          result = uid->is_expired? "1":"0";
+        }
+      else if (!strcmp (propname, "revoked"))
+        {
+          result = uid->is_revoked? "1":"0";
+        }
       else
         result = NULL;
     }
@@ -1215,6 +1226,10 @@ impex_filter_getval (void *cookie, const char *propname)
           snprintf (numbuf, sizeof numbuf, "%d", sig->digest_algo);
           result = numbuf;
         }
+      else if (!strcmp (propname, "expired"))
+        {
+          result = sig->flags.expired? "1":"0";
+        }
       else
         result = NULL;
     }
@@ -1244,6 +1259,18 @@ impex_filter_getval (void *cookie, const char *propname)
         {
           result = datestr_from_pk (pk);
         }
+      else if (!strcmp (propname, "expired"))
+        {
+          result = pk->has_expired? "1":"0";
+        }
+      else if (!strcmp (propname, "revoked"))
+        {
+          result = pk->flags.revoked? "1":"0";
+        }
+      else if (!strcmp (propname, "disabled"))
+        {
+          result = pk_is_disabled (pk)? "1":"0";
+        }
       else
         result = NULL;
     }

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

Summary of changes:
 doc/gpg.texi | 15 +++++++++++++--
 g10/export.c |  2 +-
 g10/import.c | 41 ++++++++++++++++++++++++++++++++++-------
 3 files changed, 48 insertions(+), 10 deletions(-)


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




More information about the Gnupg-commits mailing list