From 1f76cbca35133969ccccfa324d633556e19a386c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 4 Sep 2023 16:34:55 +0200 Subject: 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 --- g10/gpg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'g10/gpg.c') diff --git a/g10/gpg.c b/g10/gpg.c index 2ae3750a9..cb6e42e3c 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", "@"), @@ -2890,6 +2892,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++; @@ -3794,6 +3799,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)) { -- cgit v1.2.3 From 2a2846959f11053cb63c48626d6eda333868d033 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 18 Sep 2023 11:26:56 +0200 Subject: gpg: Fix --no-utf8-strings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * g10/gpg.c (main): Ignore --no-utf8-strings only on Windows. -- Fixes-commit: 8c41b8aac3efb78178fe1eaf52d8d1bbc44941a8 Reported-by: Ingo Klöcker --- g10/gpg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'g10/gpg.c') diff --git a/g10/gpg.c b/g10/gpg.c index cb6e42e3c..18df7de67 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -3489,7 +3489,7 @@ main (int argc, char **argv) break; case oUtf8Strings: utf8_strings = 1; break; case oNoUtf8Strings: -#ifdef HAVE_W32_SYSTEM +#ifndef HAVE_W32_SYSTEM utf8_strings = 0; #endif break; -- cgit v1.2.3