aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-09-09 15:33:29 +0000
committerWerner Koch <[email protected]>2024-09-09 15:33:29 +0000
commitcd79fc39736fda6ce38f1f79700cf658c47372f9 (patch)
treee4da5d060c6d487dbe7897ec7bf9441814b69e27 /tests
parentcore: Treat email-only user IDs with upper case letters as email address (diff)
downloadgpgme-cd79fc39736fda6ce38f1f79700cf658c47372f9.tar.gz
gpgme-cd79fc39736fda6ce38f1f79700cf658c47372f9.zip
core: New encryption flags GPGME_ENCRYPT_ADD_RECP and _CHG_RECP.
* src/gpgme.h.in (GPGME_ENCRYPT_ADD_RECP, GPGME_ENCRYPT_CHG_RECP): New flag values. * src/engine-gpg.c (have_cmd_modify_recipients): New. (gpg_encrypt): Check availability of the feature and prepare command. * tests/run-encrypt.c (main): New options --add-recipients and --change-recipients. -- GnuPG-bug-id: 1825
Diffstat (limited to 'tests')
-rw-r--r--tests/run-encrypt.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/run-encrypt.c b/tests/run-encrypt.c
index 8e8b559c..5a10e593 100644
--- a/tests/run-encrypt.c
+++ b/tests/run-encrypt.c
@@ -143,6 +143,8 @@ show_usage (int ex)
" --openpgp use the OpenPGP protocol (default)\n"
" --cms use the CMS protocol\n"
" --uiserver use the UI server\n"
+ " --add-recipients use the re-encrypt feature\n"
+ " --change-recipients ditto, but clear existing keys\n"
" --loopback use a loopback pinentry\n"
" --key NAME encrypt to key NAME\n"
" --keystring NAMES encrypt to ';' delimited NAMES\n"
@@ -240,6 +242,18 @@ main (int argc, char **argv)
protocol = GPGME_PROTOCOL_UISERVER;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--add-recipients"))
+ {
+ flags |= GPGME_ENCRYPT_ADD_RECP;
+ flags &= ~GPGME_ENCRYPT_CHG_RECP;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--change-recipients"))
+ {
+ flags |= GPGME_ENCRYPT_CHG_RECP;
+ flags &= ~GPGME_ENCRYPT_ADD_RECP;
+ argc--; argv++;
+ }
else if (!strcmp (*argv, "--key"))
{
argc--; argv++;