summaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-10-08 13:11:08 +0200
committerWerner Koch <wk@gnupg.org>2010-10-08 13:11:08 +0200
commita78335c9ce3956a1e6d6f1a17e60673b3ebce5fb (patch)
tree36bca72ac73e36d6564485685e1245787b39884d /sm
parentImport fixes. (diff)
downloadgnupg2-a78335c9ce3956a1e6d6f1a17e60673b3ebce5fb.tar.xz
gnupg2-a78335c9ce3956a1e6d6f1a17e60673b3ebce5fb.zip
Add new option --with-keygrip
Diffstat (limited to 'sm')
-rw-r--r--sm/ChangeLog6
-rw-r--r--sm/gpgsm.c6
-rw-r--r--sm/gpgsm.h2
-rw-r--r--sm/keylist.c10
4 files changed, 24 insertions, 0 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 9a68f8d43..e10bd3458 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-08 Werner Koch <wk@g10code.com>
+
+ * gpgsm.c: Add option --with-keygrip.
+ * gpgsm.h (struct opt): Add WITH_KEYGRIP.
+ * keylist.c (list_cert_std): Implement option.
+
2010-09-16 Werner Koch <wk@g10code.com>
* certchain.c (gpgsm_walk_cert_chain): Use GPG_ERR_MISSING_ISSUER_CERT.
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index 226704a98..d1b09f422 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -143,6 +143,7 @@ enum cmd_and_opt_values {
oWithFingerprint,
oWithMD5Fingerprint,
+ oWithKeygrip,
oAnswerYes,
oAnswerNo,
oKeyring,
@@ -371,6 +372,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oWithEphemeralKeys, "with-ephemeral-keys", "@"),
ARGPARSE_s_n (oSkipVerify, "skip-verify", "@"),
ARGPARSE_s_n (oWithFingerprint, "with-fingerprint", "@"),
+ ARGPARSE_s_n (oWithKeygrip, "with-keygrip", "@"),
ARGPARSE_s_s (oDisableCipherAlgo, "disable-cipher-algo", "@"),
ARGPARSE_s_s (oDisablePubkeyAlgo, "disable-pubkey-algo", "@"),
ARGPARSE_s_n (oIgnoreTimeConflict, "ignore-time-conflict", "@"),
@@ -1244,6 +1246,10 @@ main ( int argc, char **argv)
opt.fingerprint++;
break;
+ case oWithKeygrip:
+ opt.with_keygrip = 1;
+ break;
+
case oOptions:
/* config files may not be nested (silently ignore them) */
if (!configfp)
diff --git a/sm/gpgsm.h b/sm/gpgsm.h
index 4643fd168..9b7945f81 100644
--- a/sm/gpgsm.h
+++ b/sm/gpgsm.h
@@ -80,6 +80,8 @@ struct
int with_md5_fingerprint; /* Also print an MD5 fingerprint for
standard key listings. */
+ int with_keygrip; /* Option --with-keygrip active. */
+
int armor; /* force base64 armoring (see also ctrl.with_base64) */
int no_armor; /* don't try to figure out whether data is base64 armored*/
diff --git a/sm/keylist.c b/sm/keylist.c
index feb117d10..4f876ff60 100644
--- a/sm/keylist.c
+++ b/sm/keylist.c
@@ -1216,6 +1216,16 @@ list_cert_std (ctrl_t ctrl, ksba_cert_t cert, estream_t fp, int have_secret,
es_fprintf (fp, " fingerprint: %s\n", dn?dn:"error");
xfree (dn);
+ if (opt.with_keygrip)
+ {
+ dn = gpgsm_get_keygrip_hexstring (cert);
+ if (dn)
+ {
+ es_fprintf (fp, " keygrip: %s\n", dn);
+ xfree (dn);
+ }
+ }
+
if (have_secret)
{
char *cardsn;