[git] GnuPG - branch, master, updated. gnupg-2.1.15-6-g460568d

by Werner Koch cvs at cvs.gnupg.org
Wed Aug 24 15:51:32 CEST 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  460568d341851ac79dd100e00e4eafcac1318148 (commit)
       via  95e9a97b32623eeab03cb8e86a00f810c18bcd5f (commit)
      from  54245979e691129ed9d3a6c642087fb8d3227449 (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 460568d341851ac79dd100e00e4eafcac1318148
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Aug 24 15:48:21 2016 +0200

    wks: Add command --supported to gpg-wks-client.
    
    * tools/gpg-wks-client.c (aSupported): New.
    (opts): Add --supported.
    (parse_arguments): Ditto.
    (main): Call command_supported.
    (command_supported): New.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c
index 2c9cc4f..34b26ea 100644
--- a/tools/gpg-wks-client.c
+++ b/tools/gpg-wks-client.c
@@ -49,6 +49,7 @@ enum cmd_and_opt_values
 
     oDebug      = 500,
 
+    aSupported,
     aCreate,
     aReceive,
     aRead,
@@ -64,6 +65,8 @@ enum cmd_and_opt_values
 static ARGPARSE_OPTS opts[] = {
   ARGPARSE_group (300, ("@Commands:\n ")),
 
+  ARGPARSE_c (aSupported, "supported",
+              ("check whether provider supports WKS")),
   ARGPARSE_c (aCreate,   "create",
               ("create a publication request")),
   ARGPARSE_c (aReceive,   "receive",
@@ -98,6 +101,7 @@ static struct debug_flags_s debug_flags [] =
 
 
 static void wrong_args (const char *text) GPGRT_ATTR_NORETURN;
+static gpg_error_t command_supported (char *userid);
 static gpg_error_t command_send (const char *fingerprint, char *userid);
 static gpg_error_t process_confirmation_request (estream_t msg);
 static gpg_error_t command_receive_cb (void *opaque,
@@ -174,6 +178,7 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
           opt.output = pargs->r.ret_str;
           break;
 
+	case aSupported:
 	case aCreate:
 	case aReceive:
 	case aRead:
@@ -237,6 +242,14 @@ main (int argc, char **argv)
   /* Run the selected command.  */
   switch (cmd)
     {
+    case aSupported:
+      if (argc != 1)
+        wrong_args ("--supported USER-ID");
+      err = command_supported (argv[0]);
+      if (err && gpg_err_code (err) != GPG_ERR_FALSE)
+        log_error ("checking support failed: %s\n", gpg_strerror (err));
+      break;
+
     case aCreate:
       if (argc != 2)
         wrong_args ("--create FINGERPRINT USER-ID");
@@ -381,6 +394,48 @@ get_key (estream_t *r_key, const char *fingerprint, const char *addrspec)
 
 
 

+/* Check whether the  provider supports the WKS protocol.  */
+static gpg_error_t
+command_supported (char *userid)
+{
+  gpg_error_t err;
+  char *addrspec = NULL;
+  char *submission_to = NULL;
+
+  addrspec = mailbox_from_userid (userid);
+  if (!addrspec)
+    {
+      log_error (_("\"%s\" is not a proper mail address\n"), userid);
+      err = gpg_error (GPG_ERR_INV_USER_ID);
+      goto leave;
+    }
+
+  /* Get the submission address.  */
+  err = wkd_get_submission_address (addrspec, &submission_to);
+  if (err)
+    {
+      if (gpg_err_code (err) == GPG_ERR_NO_DATA
+          || gpg_err_code (err) == GPG_ERR_UNKNOWN_HOST)
+        {
+          if (opt.verbose)
+            log_info ("provider for '%s' does NOT support WKS (%s)\n",
+                      addrspec, gpg_strerror (err));
+          err = gpg_error (GPG_ERR_FALSE);
+          log_inc_errorcount ();
+        }
+      goto leave;
+    }
+  if (opt.verbose)
+    log_info ("provider for '%s' supports WKS\n", addrspec);
+
+ leave:
+  xfree (submission_to);
+  xfree (addrspec);
+  return err;
+}
+
+
+

 /* Locate the key by fingerprint and userid and send a publication
  * request.  */
 static gpg_error_t

commit 95e9a97b32623eeab03cb8e86a00f810c18bcd5f
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Aug 24 15:31:44 2016 +0200

    doc: Some additional source comments
    
    --

diff --git a/common/mbox-util.c b/common/mbox-util.c
index c451198..9072275 100644
--- a/common/mbox-util.c
+++ b/common/mbox-util.c
@@ -18,6 +18,10 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+/* NB: GPGME uses the same code to reflect our idea on how to extract
+ * a mail address from a user id.
+ */
+
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/doc/DETAILS b/doc/DETAILS
index dc8ba1f..332e686 100644
--- a/doc/DETAILS
+++ b/doc/DETAILS
@@ -701,7 +701,8 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB:
     This status identifies the key and the userid for all following
     Tofu information.  The fingerprint is the fingerprint of the
     primary key and the mbox is in general the addr-spec part of the
-    userid encoded in UTF-8 and percent escaped.
+    userid encoded in UTF-8 and percent escaped.  The fingerprint is
+    indentical for all TOFU_USER lines up to a NEWSIG line.
 
 *** TOFU_STATS <validity> <sign-count> 0 [<policy> [<tm1> <tm2>]]
 

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

Summary of changes:
 common/mbox-util.c     |  4 ++++
 doc/DETAILS            |  3 ++-
 tools/gpg-wks-client.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 1 deletion(-)


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




More information about the Gnupg-commits mailing list