[git] GPGME - branch, master, updated. gpgme-1.10.0-191-g4bba3b8
by Werner Koch
cvs at cvs.gnupg.org
Tue Apr 17 10:11:34 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 4bba3b8e2c350b8ff0d562ec63cc03a096448d84 (commit)
from 86efba2be270d2cdd0bc66c9d3fe190495b7af2f (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 4bba3b8e2c350b8ff0d562ec63cc03a096448d84
Author: Werner Koch <wk at gnupg.org>
Date: Tue Apr 17 10:04:20 2018 +0200
core: Allow for --hidden keyword in OpenPGP recpstrings.
* src/engine-gpg.c (append_args_from_recipients_string): Add special
keywords.
--
GnuPG-bug-id: 3775
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 330b167..3975a97 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -6180,8 +6180,16 @@ This is an extended version of @code{gpgme_op_encrypt} with
@var{recpstring} is not NULL, the latter is expected to be a linefeed
delimited string with the set of key specifications. In contrast to
@var{recp} the keys are given directly as strings and there is no need
-to first create key objects. The keys are passed verbatim to the
-backend engine.
+to first create key objects. Leading and trailing white space is
+remove from each line in @var{recpstring}. The keys are then passed
+verbatim to the backend engine.
+
+For the OpenPGP backend two special keywords are supported to modify
+the operation: If the keyword "--hidden" is given as a recipient, it
+is skipped but will trun all following key specifications to be hidden
+recipients. If the keyword "--" is given as a recipient, it will be
+skipped but no keywords will be detected in all following key
+specifications.
@end deftypefun
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 90e3b89..49a1c75 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -1985,6 +1985,8 @@ append_args_from_recipients_string (engine_gpg_t gpg,
{
gpg_error_t err = 0;
int any = 0;
+ int ignore = 0;
+ int hidden = 0;
const char *s;
int n;
@@ -2005,10 +2007,14 @@ append_args_from_recipients_string (engine_gpg_t gpg,
while (n && (string[n-1] == ' ' || string[n-1] == '\t'))
n--;
- /* Add arg if it is not empty. */
- if (n)
+ if (!ignore && n == 2 && !memcmp (string, "--", 2))
+ ignore = 1;
+ else if (!ignore && n == 8 && !memcmp (string, "--hidden", 8))
+ hidden = 1;
+ else if (n)
{
- err = add_arg (gpg, "-r");
+ /* Add arg if it is not empty. */
+ err = add_arg (gpg, hidden? "-R":"-r");
if (!err)
err = add_arg_recipient_string (gpg, flags, string, n);
if (!err)
-----------------------------------------------------------------------
Summary of changes:
doc/gpgme.texi | 12 ++++++++++--
src/engine-gpg.c | 12 +++++++++---
2 files changed, 19 insertions(+), 5 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list