gpg: Make invalid primary key algos obvious in key listings.
authorWerner Koch <wk@gnupg.org>
Tue, 5 Mar 2019 11:39:11 +0000 (12:39 +0100)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 1 Jul 2022 16:06:43 +0000 (17:06 +0100)
commit3dd7226f653fe4d3203b14c364324a72e3fa70e5
tree6696fa99db8df622939a209ff041de3f0fd98299
parentc0c99d3a69174d6da0a080b00931cec0cd212605
gpg: Make invalid primary key algos obvious in key listings.

* g10/keylist.c (print_key_line): Print a warning for invalid algos.
--

Non-OpenPGP compliant keys now show a warning flag on the sec or pub
line like in:

  gpg: can't encode a 256 bit MD into a 88 bits frame, algo=8
  sec   cv25519 2019-01-30 [INVALID_ALGO]
        4239F3D606A19258E7A88C3F9A3F4F909C5034C5
  uid           [ultimate] ffffff

Instead of showing the usage flags "[CE]".  Without this patch only
the error message is printed and the reason for it was not immediately
obvious (cv25519 is encryption only but we always consider the primary
key as having the "C" flag).

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit db87132b10664718b7db6ec1dad584b54d1fb265)
(cherry picked from commit d2a7f9078a4673ec53733e4f69fd17a8f1ac962d)

Gbp-Pq: Topic from-2.2.14
Gbp-Pq: Name gpg-Make-invalid-primary-key-algos-obvious-in-key-listing.patch
g10/keylist.c