aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine-gpg.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-08-04 14:17:01 +0000
committerWerner Koch <[email protected]>2016-08-04 14:17:01 +0000
commit6f3dc66634e30d86aa6250c4ac22f9b8f7ec1be9 (patch)
treef10502a42129cc102ed61e2932f4983d1dd0f534 /src/engine-gpg.c
parentpython: Add a nicer interface to list keys. (diff)
downloadgpgme-6f3dc66634e30d86aa6250c4ac22f9b8f7ec1be9.tar.gz
gpgme-6f3dc66634e30d86aa6250c4ac22f9b8f7ec1be9.zip
core: Extend gpgme_subkey_t to carry the keygrip.
* src/gpgme.h.in (struct _gpgme_subkey): Add file 'keygrip'. * src/key.c (gpgme_key_unref): Free KEYGRIP. * src/keylist.c (keylist_colon_handler): Parse GRP records. * src/engine-gpg.c (gpg_keylist_build_options): Do not use --with-fingerprint options for gpg versions >= 2.1.15. * tests/run-keylist.c (main): Print subkeys and keygrips. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/engine-gpg.c')
-rw-r--r--src/engine-gpg.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 16571a5a..942711f9 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -2283,12 +2283,19 @@ gpg_keylist_build_options (engine_gpg_t gpg, int secret_only,
gpg_error_t err;
err = add_arg (gpg, "--with-colons");
- if (!err)
- err = add_arg (gpg, "--fixed-list-mode");
- if (!err)
- err = add_arg (gpg, "--with-fingerprint");
- if (!err)
- err = add_arg (gpg, "--with-fingerprint");
+
+ /* Since gpg 2.1.15 fingerprints are always printed, thus there is
+ * no more need to explictly reqeust them. */
+ if (!have_gpg_version (gpg, "2.1.15"))
+ {
+ if (!err)
+ err = add_arg (gpg, "--fixed-list-mode");
+ if (!err)
+ err = add_arg (gpg, "--with-fingerprint");
+ if (!err)
+ err = add_arg (gpg, "--with-fingerprint");
+ }
+
if (!err && (mode & GPGME_KEYLIST_MODE_WITH_SECRET))
err = add_arg (gpg, "--with-secret");
if (!err