[git] GPGME - branch, master, updated. gpgme-1.11.1-86-g40471ec

by Andre Heinecke cvs at cvs.gnupg.org
Mon Jul 9 11:39:39 CEST 2018


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 "GnuPG Made Easy".

The branch, master has been updated
       via  40471ec12f7b4ba37922813a02ebb2aaaa963b51 (commit)
       via  c287f09ac0f090a65299ac7c15e3c9b4947d4b67 (commit)
       via  31bc51e2aff0a28b551410c9def2f578d0d28cea (commit)
      from  7bc5d3c7e41c6e42a583a61a4c9504058fbb2976 (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 40471ec12f7b4ba37922813a02ebb2aaaa963b51
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jul 9 11:36:28 2018 +0200

    json: Add with-secret without secret only
    
    * src/gpgme-json.c (op_keylist, hlp_keylist): Add "with-secret"
    as a flag to do a public keylist with secret information.

diff --git a/src/gpgme-json.c b/src/gpgme-json.c
index 8d534c6..1604d2f 100644
--- a/src/gpgme-json.c
+++ b/src/gpgme-json.c
@@ -2117,7 +2117,8 @@ static const char hlp_keylist[] =
   "protocol:      Either \"openpgp\" (default) or \"cms\".\n"
   "\n"
   "Optional boolean flags (default is false):\n"
-  "secret:        List secret keys.\n"
+  "secret:        List only secret keys.\n"
+  "with-secret:   Add KEYLIST_MODE_WITH_SECRET.\n"
   "extern:        Add KEYLIST_MODE_EXTERN.\n"
   "local:         Add KEYLIST_MODE_LOCAL. (default mode).\n"
   "sigs:          Add KEYLIST_MODE_SIGS.\n"
@@ -2242,6 +2243,7 @@ op_keylist (cjson_t request, cjson_t result)
   gpgme_protocol_t protocol;
   char **patterns = NULL;
   int abool;
+  int secret_only = 0;
   gpgme_keylist_mode_t mode = 0;
   gpgme_key_t key = NULL;
   cjson_t keyarray = xjson_CreateArray ();
@@ -2254,8 +2256,14 @@ op_keylist (cjson_t request, cjson_t result)
   if ((err = get_boolean_flag (request, "secret", 0, &abool)))
     goto leave;
   if (abool)
+    {
+      mode |= GPGME_KEYLIST_MODE_WITH_SECRET;
+      secret_only = 1;
+    }
+  if ((err = get_boolean_flag (request, "with-secret", 0, &abool)))
+    goto leave;
+  if (abool)
     mode |= GPGME_KEYLIST_MODE_WITH_SECRET;
-
   if ((err = get_boolean_flag (request, "extern", 0, &abool)))
     goto leave;
   if (abool)
@@ -2309,8 +2317,7 @@ op_keylist (cjson_t request, cjson_t result)
   gpgme_set_keylist_mode (ctx, mode);
 
   err = gpgme_op_keylist_ext_start (ctx, (const char **) patterns,
-                                    (mode & GPGME_KEYLIST_MODE_WITH_SECRET),
-                                    0);
+                                    secret_only, 0);
   if (err)
     {
       gpg_error_object (result, err, "Error listing keys: %s",

commit c287f09ac0f090a65299ac7c15e3c9b4947d4b67
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jul 9 11:17:27 2018 +0200

    tests: Add --with-secret to run-keylist.c
    
    * run-keylist.c (show_usage, main): Add --with-secret.

diff --git a/tests/run-keylist.c b/tests/run-keylist.c
index 9725fa3..9206b50 100644
--- a/tests/run-keylist.c
+++ b/tests/run-keylist.c
@@ -47,6 +47,7 @@ show_usage (int ex)
          "  --openpgp        use the OpenPGP protocol (default)\n"
          "  --cms            use the CMS protocol\n"
          "  --secret         list only secret keys\n"
+         "  --with-secret    list pubkeys with secret info filled\n"
          "  --local          use GPGME_KEYLIST_MODE_LOCAL\n"
          "  --extern         use GPGME_KEYLIST_MODE_EXTERN\n"
          "  --sigs           use GPGME_KEYLIST_MODE_SIGS\n"
@@ -173,6 +174,11 @@ main (int argc, char **argv)
           mode |= GPGME_KEYLIST_MODE_VALIDATE;
           argc--; argv++;
         }
+      else if (!strcmp (*argv, "--with-secret"))
+        {
+          mode |= GPGME_KEYLIST_MODE_WITH_SECRET;
+          argc--; argv++;
+        }
       else if (!strcmp (*argv, "--import"))
         {
           import = 1;

commit 31bc51e2aff0a28b551410c9def2f578d0d28cea
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Jul 9 11:10:19 2018 +0200

    doc: More explicit doc for EXTERN and LOCAL modes.
    
    * doc/gpgme.texi (GPGME_KEYLIST_MODE_EXTERN),
    (GPGME_KEYLIST_MODE_LOCATE, GPGME_KEYLIST_MODE_LOCAL): Mention
    command line flags for CMS and OpenPGP Protocol.
    
    --
    This might help new users coming to gnupg to understand what
    the flags do.

diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 6e328e6..38d3480 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -2763,6 +2763,8 @@ The @code{GPGME_KEYLIST_MODE_LOCAL} symbol specifies that the local
 keyring should be searched for keys in the keylisting operation.  This
 is the default.
 
+Using only this option results in a @code{--list-keys}.
+
 @item GPGME_KEYLIST_MODE_EXTERN
 The @code{GPGME_KEYLIST_MODE_EXTERN} symbol specifies that an external
 source should be searched for keys in the keylisting operation.  The
@@ -2770,10 +2772,14 @@ type of external source is dependent on the crypto engine used and
 whether it is combined with @code{GPGME_KEYLIST_MODE_LOCAL}.  For
 example, it can be a remote keyserver or LDAP certificate server.
 
+Using only this option results in a @code{--search-keys} for
+ at code{GPGME_PROTOCOL_OpenPGP} and something similar to
+ at code{--list-external-keys} for @code{GPGME_PROTOCOL_CMS}.
+
 @item GPGME_KEYLIST_MODE_LOCATE
 This is a shortcut for the combination of
- at code{GPGME_KEYLIST_MODE_LOCAL} and @code{GPGME_KEYLIST_MODE_EXTERN}
-and convenient when the --locate-key feature of OpenPGP is desired.
+ at code{GPGME_KEYLIST_MODE_LOCAL} and @code{GPGME_KEYLIST_MODE_EXTERN}, which
+results in a @code{--locate-keys} for @code{GPGME_PROTOCOL_OpenPGP}.
 
 @item GPGME_KEYLIST_MODE_SIGS
 The @code{GPGME_KEYLIST_MODE_SIGS} symbol specifies that the key

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

Summary of changes:
 doc/gpgme.texi      | 10 ++++++++--
 src/gpgme-json.c    | 15 +++++++++++----
 tests/run-keylist.c |  6 ++++++
 3 files changed, 25 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list