aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keydb.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-02-07 13:25:58 +0000
committerWerner Koch <[email protected]>2023-02-07 13:50:03 +0000
commit103acfe9ca6e314049671f5b5a760a620046788f (patch)
treea0ab9b3ea0a9503a3fdb2fe31bb1f61eef914f76 /g10/keydb.h
parentssh: Allow to define the order in which keys are returned. (diff)
downloadgnupg-103acfe9ca6e314049671f5b5a760a620046788f.tar.gz
gnupg-103acfe9ca6e314049671f5b5a760a620046788f.zip
gpg: New list-option --show-unusable-sigs.
* g10/options.h (LIST_SHOW_UNUSABLE_SIGS): New. * g10/gpg.c (parse_list_options): Add "show-unusable-sigs". * g10/keydb.h (keyid_eq): New. (pk_is_primary): New. * g10/keylist.c (list_signature_print): Early return for weak key signatures. Print "self-signature" instead of user-id. (list_keyblock_print): Simplify and always set self-sig node flag. -- This patch avoid the printing of often hundreds of "Invalid digest algorithm" notices during key signature listings if those key signatures were done with SHA1. The new option can be used to revert the behaviour. We now also print "[self-signature]" with --check-sigs or --list-sigs instead of the primary user id. This makes such listing easier to read.
Diffstat (limited to 'g10/keydb.h')
-rw-r--r--g10/keydb.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/g10/keydb.h b/g10/keydb.h
index 771bc8e16..28b61d4a1 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -511,11 +511,18 @@ keyid_cmp (const u32 *a, const u32 *b)
return 0;
}
+/* Return true if both keyids are equal. */
+static int GPGRT_ATTR_UNUSED
+keyid_eq (const u32 *a, const u32 *b)
+{
+ return a[0] == b[0] && a[1] == b[1];
+}
+
/* Return whether PK is a primary key. */
static int GPGRT_ATTR_UNUSED
pk_is_primary (PKT_public_key *pk)
{
- return keyid_cmp (pk_keyid (pk), pk_main_keyid (pk)) == 0;
+ return keyid_eq (pk_keyid (pk), pk_main_keyid (pk));
}
/* Copy the keyid in SRC to DEST and return DEST. */