[git] GPGME - branch, master, updated. gpgme-1.11.1-314-g7b86194

by Werner Koch cvs at cvs.gnupg.org
Tue Oct 2 11:28:05 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  7b861945fdc71fd3c82c91f824172dadd2220fa0 (commit)
      from  76bdfabb057f4ffc56beee15b48d8fa836ba7cce (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 7b861945fdc71fd3c82c91f824172dadd2220fa0
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Oct 2 11:18:00 2018 +0200

    core: add experimental GPGME_EXPORT_MODE_NOUID.
    
    * src/gpgme.h.in (GPGME_EXPORT_MODE_NOUID): New.
    * src/export.c (export_start): Adjust option check.
    * src/engine-gpg.c (export_common): Implement option.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 426ae7a..d99e9bb 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -4663,6 +4663,10 @@ If this flag is used with @code{GPGME_EXPORT_MODE_SECRET} for an X.509
 key the export format will be changed to PKCS#12 which also includes
 the certificate.  This flag may not be used with OpenPGP.
 
+ at item GPGME_EXPORT_MODE_NOUID
+ at since{1.12.0 - experimental}
+Do not export user ids.  Works only with certain gpg version.
+
 @end table
 
 
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index be78957..9a5927c 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -2241,7 +2241,14 @@ export_common (engine_gpg_t gpg, gpgme_export_mode_t mode,
     return gpg_error (GPG_ERR_NOT_SUPPORTED);
 
   if ((mode & GPGME_EXPORT_MODE_MINIMAL))
-    err = add_arg (gpg, "--export-options=export-minimal");
+    {
+      if ((mode & GPGME_EXPORT_MODE_NOUID))
+        err = add_arg (gpg, "--export-options=export-minimal,export-drop-uids");
+      else
+        err = add_arg (gpg, "--export-options=export-minimal");
+    }
+  else if ((mode & GPGME_EXPORT_MODE_NOUID))
+    err = add_arg (gpg, "--export-options=export-drop-uids");
 
   if (err)
     ;
diff --git a/src/export.c b/src/export.c
index cd94050..f460e85 100644
--- a/src/export.c
+++ b/src/export.c
@@ -123,6 +123,7 @@ export_start (gpgme_ctx_t ctx, int synchronous, const char *pattern,
                 |GPGME_EXPORT_MODE_MINIMAL
                 |GPGME_EXPORT_MODE_SECRET
                 |GPGME_EXPORT_MODE_RAW
+                |GPGME_EXPORT_MODE_NOUID
                 |GPGME_EXPORT_MODE_PKCS12)))
     return gpg_error (GPG_ERR_INV_VALUE); /* Invalid flags in MODE.  */
 
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 9c9ea5a..1731593 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -405,6 +405,7 @@ gpgme_pinentry_mode_t;
 #define GPGME_EXPORT_MODE_SECRET               16
 #define GPGME_EXPORT_MODE_RAW                  32
 #define GPGME_EXPORT_MODE_PKCS12               64
+#define GPGME_EXPORT_MODE_NOUID               128
 
 typedef unsigned int gpgme_export_mode_t;
 

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

Summary of changes:
 doc/gpgme.texi   | 4 ++++
 src/engine-gpg.c | 9 ++++++++-
 src/export.c     | 1 +
 src/gpgme.h.in   | 1 +
 4 files changed, 14 insertions(+), 1 deletion(-)


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




More information about the Gnupg-commits mailing list