aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpg.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-09-04 14:34:55 +0000
committerWerner Koch <[email protected]>2023-09-04 14:35:19 +0000
commit1be7882344c5b3eae35539f6c3f490df197574bf (patch)
tree782259db4ec603329ee4ba1fd19f0cd0db280835 /g10/gpg.c
parentagent: Fix timer round-up check when inserting an entry into cache. (diff)
downloadgnupg-1be7882344c5b3eae35539f6c3f490df197574bf.tar.gz
gnupg-1be7882344c5b3eae35539f6c3f490df197574bf.zip
gpg: Add option --with-v5-fingerprint
* g10/gpg.c (oWithV5Fingerprint): New. (opts): Add new option. (main): Set option. * g10/options.h (opt): Add with_v5_fingerprint. * g10/keyid.c (hash_public_key): Factor out to ... (do_hash_public_key): this. Add new arg to foce v5 style hashing. (v5_fingerprint_from_pk): New. (v5hexfingerprint): New. * g10/keylist.c (print_fingerprint): Print v5 fingerprint for v4 keys if the option is set. -- GnuPG-bug-id: 6705
Diffstat (limited to 'g10/gpg.c')
-rw-r--r--g10/gpg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 54e74f5b1..ec6af0eb9 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -203,6 +203,7 @@ enum cmd_and_opt_values
oAskCertLevel,
oNoAskCertLevel,
oFingerprint,
+ oWithV5Fingerprint,
oWithFingerprint,
oWithSubkeyFingerprint,
oWithICAOSpelling,
@@ -816,6 +817,7 @@ static gpgrt_opt_t opts[] = {
ARGPARSE_s_n (oWithKeyData,"with-key-data", "@"),
ARGPARSE_s_n (oWithSigList,"with-sig-list", "@"),
ARGPARSE_s_n (oWithSigCheck,"with-sig-check", "@"),
+ ARGPARSE_s_n (oWithV5Fingerprint, "with-v5-fingerprint", "@"),
ARGPARSE_s_n (oWithFingerprint, "with-fingerprint", "@"),
ARGPARSE_s_n (oWithSubkeyFingerprint, "with-subkey-fingerprint", "@"),
ARGPARSE_s_n (oWithSubkeyFingerprint, "with-subkey-fingerprints", "@"),
@@ -2887,6 +2889,9 @@ main (int argc, char **argv)
opt_log_time = 1;
break;
+ case oWithV5Fingerprint:
+ opt.with_v5_fingerprint = 1;
+ break;
case oWithFingerprint:
opt.with_fingerprint = 1;
opt.fingerprint++;
@@ -3791,6 +3796,14 @@ main (int argc, char **argv)
g10_exit(2);
}
+ /* Set depended fingerprint options. */
+ if (opt.with_v5_fingerprint && !opt.with_fingerprint)
+ {
+ opt.with_fingerprint = 1;
+ if (!opt.fingerprint)
+ opt.fingerprint = 1;
+ }
+
/* Process common component options. */
if (parse_comopt (GNUPG_MODULE_NAME_GPG, debug_argparser))
{