[git] GnuPG - branch, master, updated. gnupg-2.1.13-106-g1bfed0b

by Werner Koch cvs at cvs.gnupg.org
Sun Jul 3 10:29:40 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  1bfed0bbc5ec9d60d4fb3a0f5c865923ed3563e7 (commit)
      from  7705f310f1406fe49b45e16c371b09863313f24f (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 1bfed0bbc5ec9d60d4fb3a0f5c865923ed3563e7
Author: Werner Koch <wk at gnupg.org>
Date:   Sun Jul 3 10:27:39 2016 +0200

    wks: Let the client only export the requested UID.
    
    * tools/gpg-wks-client.c (get_key): Export only the requested uid.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/HACKING b/doc/HACKING
index d2168d6..94e65d8 100644
--- a/doc/HACKING
+++ b/doc/HACKING
@@ -46,6 +46,8 @@ are
  - scd     :: The scdaemon component
  - ccid    :: The CCID driver in scdaemon
  - dirmngr :: The dirmngr component
+ - wks     :: The web key service tools
+ - tools   :: Other code in tools
  - w32     :: Windows related code
  - po      :: Translations
  - build   :: Changes to the build system
diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c
index 25ee43f..312f58b 100644
--- a/tools/gpg-wks-client.c
+++ b/tools/gpg-wks-client.c
@@ -291,11 +291,10 @@ get_key (estream_t *r_key, const char *fingerprint, const char *addrspec)
 {
   gpg_error_t err;
   ccparray_t ccp;
-  const char **argv;
-  estream_t key;
+  const char **argv = NULL;
+  estream_t key = NULL;
   struct get_key_status_parm_s parm;
-
-  (void)addrspec;  /* FIXME - need to use it.  */
+  char *filterexp = NULL;
 
   memset (&parm, 0, sizeof parm);
 
@@ -306,7 +305,15 @@ get_key (estream_t *r_key, const char *fingerprint, const char *addrspec)
     {
       err = gpg_error_from_syserror ();
       log_error ("error allocating memory buffer: %s\n", gpg_strerror (err));
-      return err;
+      goto leave;
+    }
+
+  filterexp = es_bsprintf ("keep-uid=mbox = %s", addrspec);
+  if (!filterexp)
+    {
+      err = gpg_error_from_syserror ();
+      log_error ("error allocating memory buffer: %s\n", gpg_strerror (err));
+      goto leave;
     }
 
   ccparray_init (&ccp, 0);
@@ -321,6 +328,8 @@ get_key (estream_t *r_key, const char *fingerprint, const char *addrspec)
   ccparray_put (&ccp, "--always-trust");
   ccparray_put (&ccp, "--armor");
   ccparray_put (&ccp, "--export-options=export-minimal");
+  ccparray_put (&ccp, "--export-filter");
+  ccparray_put (&ccp, filterexp);
   ccparray_put (&ccp, "--export");
   ccparray_put (&ccp, "--");
   ccparray_put (&ccp, fingerprint);
@@ -353,6 +362,7 @@ get_key (estream_t *r_key, const char *fingerprint, const char *addrspec)
  leave:
   es_fclose (key);
   xfree (argv);
+  xfree (filterexp);
   return err;
 }
 
@@ -388,7 +398,6 @@ command_send (const char *fingerprint, char *userid)
   err = get_key (&key, fingerprint, addrspec);
   if (err)
     goto leave;
-  log_debug ("fixme: Check that the key has the requested user-id.\n");
 
   /* Get the submission address.  */
   err = wkd_get_submission_address (addrspec, &submission_to);

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

Summary of changes:
 doc/HACKING            |  2 ++
 tools/gpg-wks-client.c | 21 +++++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)


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




More information about the Gnupg-commits mailing list