aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine-gpg.c5
-rw-r--r--src/gpgme-json.c6
-rw-r--r--src/gpgme.h.in3
3 files changed, 13 insertions, 1 deletions
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 73e5245a..c343e80e 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -3001,6 +3001,11 @@ gpg_keylist_build_options (engine_gpg_t gpg, int secret_only,
err = add_arg (gpg, "--with-secret");
err = add_arg (gpg, "--with-keygrip");
}
+ else if (!err && (mode & GPGME_KEYLIST_MODE_WITH_KEYGRIP))
+ {
+ /* Explicitly requests the keygrip. */
+ err = add_arg (gpg, "--with-keygrip");
+ }
if (!err
&& (mode & GPGME_KEYLIST_MODE_SIGS)
diff --git a/src/gpgme-json.c b/src/gpgme-json.c
index 7957659d..bcaa1fc0 100644
--- a/src/gpgme-json.c
+++ b/src/gpgme-json.c
@@ -2298,6 +2298,7 @@ static const char hlp_keylist[] =
"sigs: Add KEYLIST_MODE_SIGS.\n"
"notations: Add KEYLIST_MODE_SIG_NOTATIONS.\n"
"tofu: Add KEYLIST_MODE_WITH_TOFU.\n"
+ "keygrip: Add KEYLIST_MODE_WITH_KEYGRIP.\n"
"ephemeral: Add KEYLIST_MODE_EPHEMERAL.\n"
"validate: Add KEYLIST_MODE_VALIDATE.\n"
"locate: Add KEYLIST_MODE_LOCATE.\n"
@@ -2463,6 +2464,11 @@ op_keylist (cjson_t request, cjson_t result)
if (abool)
mode |= GPGME_KEYLIST_MODE_WITH_TOFU;
+ if ((err = get_boolean_flag (request, "keygrip", 0, &abool)))
+ goto leave;
+ if (abool)
+ mode |= GPGME_KEYLIST_MODE_WITH_KEYGRIP;
+
if ((err = get_boolean_flag (request, "ephemeral", 0, &abool)))
goto leave;
if (abool)
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index a52901bb..4efa325d 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -379,6 +379,7 @@ gpgme_protocol_t;
#define GPGME_KEYLIST_MODE_SIG_NOTATIONS 8
#define GPGME_KEYLIST_MODE_WITH_SECRET 16
#define GPGME_KEYLIST_MODE_WITH_TOFU 32
+#define GPGME_KEYLIST_MODE_WITH_KEYGRIP 64
#define GPGME_KEYLIST_MODE_EPHEMERAL 128
#define GPGME_KEYLIST_MODE_VALIDATE 256
@@ -600,7 +601,7 @@ struct _gpgme_subkey
/* The name of the curve for ECC algorithms or NULL. */
char *curve;
- /* The keygrip of the subkey in hex digit form or NULL if not availabale. */
+ /* The keygrip of the subkey in hex digit form or NULL if not available. */
char *keygrip;
};
typedef struct _gpgme_subkey *gpgme_subkey_t;