1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg: Show revocation reason with a standard -k listing.

* g10/packet.h (struct revoke_info): Extend to carry the recocation
reason.
* g10/getkey.c (sig_to_revoke_info): Extend to strore the reason.
(merge_selfsigs): Extend to also store the reason in the public key.
* g10/keylist.c (list_signature_print): Factor some code out to ...
(print_revocation_reason_comment): new function.
(print_revocation_reason): New.
(print_key_line): Call new function to print the reason.
* g10/import.c (get_revocation_reason): Use
print_revocation_reason_comment and factor some code out to ...
(revocation_reason_code_to_str): new function.

* g10/gpgv.c (revocation_reason_code_to_str): Add stub.
* g10/test-stubs.c (revocation_reason_code_to_str): Ditto.
--

With this change the revocation reason of a revoked key (but not for a
revoked uid or subkey) is now displayed in "gpg -k" listing right
below the primary key fingerprint.  Before that "gpg --checks-sigs"
was required to do show this info.

GnuPG-bug-id: 7083
This commit is contained in:
Werner Koch 2025-06-20 15:17:19 +02:00
parent 22fc07640a
commit 3f825b044b
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
8 changed files with 188 additions and 74 deletions

View file

@ -339,12 +339,20 @@ typedef struct
struct revoke_info
{
/* revoked at this date */
/* Revoked at this date */
u32 date;
/* the keyid of the revoking key (selfsig or designated revoker) */
/* The keyid of the revoking key (selfsig or designated revoker) */
u32 keyid[2];
/* the algo of the revoking key */
/* A malloced string of len reason_comment_len with the raw reason
* string or NULL if not given. */
char *reason_comment;
size_t reason_comment_len;
/* The algo of the revoking key */
byte algo;
/* The reason code. */
byte reason_code;
/* Whether the above reason fields are valid. */
byte got_reason;
};