aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpgme.c
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-04-27 14:57:17 +0000
committerIngo Klöcker <[email protected]>2022-04-27 14:57:17 +0000
commitaff9aaac68450e76f84d0f9a3feabffe9e82dd7e (patch)
treeb51438e16dc0d2c8641f6f6ef43a0a230718b7c9 /src/gpgme.c
parentqt: Rely on the bad passphrase error reported by gpg (diff)
downloadgpgme-aff9aaac68450e76f84d0f9a3feabffe9e82dd7e.tar.gz
gpgme-aff9aaac68450e76f84d0f9a3feabffe9e82dd7e.zip
core: Support --locate-external-keys command of gpg
* src/gpgme.h.in (GPGME_KEYLIST_MODE_FORCE_EXTERN): New. (GPGME_KEYLIST_MODE_LOCATE_EXTERNAL): New. * src/gpgme.c (gpgme_set_keylist_mode): Check for invalid mode. * src/engine-gpg.c (gpg_keylist_build_options): Use "--locate-external-keys" instead of "--locate-keys" if flag is set. * src/gpgme-json.c (op_keylist): New flag "force-extern". * src/gpgme-tool.c (gt_get_keylist_mode, cmd_keylist_mode): Handle new mode. -- GnuPG-bug-id: 5951
Diffstat (limited to '')
-rw-r--r--src/gpgme.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gpgme.c b/src/gpgme.c
index 6a5232e1..2c5b51ea 100644
--- a/src/gpgme.c
+++ b/src/gpgme.c
@@ -782,6 +782,10 @@ gpgme_set_keylist_mode (gpgme_ctx_t ctx, gpgme_keylist_mode_t mode)
if (!ctx)
return gpg_error (GPG_ERR_INV_VALUE);
+ if ((mode & GPGME_KEYLIST_MODE_LOCATE_EXTERNAL) ==
+ (GPGME_KEYLIST_MODE_LOCAL|GPGME_KEYLIST_MODE_FORCE_EXTERN))
+ return gpg_error (GPG_ERR_INV_VALUE);
+
ctx->keylist_mode = mode;
return 0;
}