mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Print designated revokers also in a standard listing.
* g10/keylist.c (print_revokers): Add arg with_colon, adjust callers, add human printable format. (list_keyblock_print): Call print_revokers. -- Designated revokers were only printed in --with-colons mode. For quick inspection of a key it is useful to see them right away.
This commit is contained in:
parent
465ea9116d
commit
9d618d1273
4 changed files with 67 additions and 31 deletions
|
@ -1555,6 +1555,8 @@ list_keyblock_print (ctrl_t ctrl, kbnode_t keyblock, int secret, int fpr,
|
|||
es_putc ('\n', es_stdout);
|
||||
}
|
||||
|
||||
print_revokers (es_stdout, 0, pk);
|
||||
|
||||
for (node = keyblock; node; node = node->next)
|
||||
{
|
||||
if (is_deleted_kbnode (node))
|
||||
|
@ -1784,28 +1786,43 @@ list_keyblock_simple (ctrl_t ctrl, kbnode_t keyblock)
|
|||
}
|
||||
|
||||
|
||||
/* Print the revoker records. */
|
||||
void
|
||||
print_revokers (estream_t fp, PKT_public_key * pk)
|
||||
print_revokers (estream_t fp, int colon_mode, PKT_public_key * pk)
|
||||
{
|
||||
/* print the revoker record */
|
||||
int i, j;
|
||||
const byte *p;
|
||||
|
||||
if (!pk->revkey && pk->numrevkeys)
|
||||
BUG ();
|
||||
else
|
||||
|
||||
for (i = 0; i < pk->numrevkeys; i++)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < pk->numrevkeys; i++)
|
||||
{
|
||||
byte *p;
|
||||
|
||||
es_fprintf (fp, "rvk:::%d::::::", pk->revkey[i].algid);
|
||||
p = pk->revkey[i].fpr;
|
||||
for (j = 0; j < pk->revkey[i].fprlen; j++, p++)
|
||||
es_fprintf (fp, "%02X", *p);
|
||||
es_fprintf (fp, ":%02x%s:\n",
|
||||
if (colon_mode)
|
||||
{
|
||||
es_fprintf (fp, "rvk:::%d::::::", pk->revkey[i].algid);
|
||||
p = pk->revkey[i].fpr;
|
||||
for (j = 0; j < pk->revkey[i].fprlen; j++, p++)
|
||||
es_fprintf (fp, "%02X", *p);
|
||||
es_fprintf (fp, ":%02x%s:\n",
|
||||
pk->revkey[i].class,
|
||||
(pk->revkey[i].class & 0x40) ? "s" : "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
es_fprintf (fp, "%*s%s", 6, "", _("Revocable by: "));
|
||||
p = pk->revkey[i].fpr;
|
||||
es_write_hexstring (fp, pk->revkey[i].fpr, pk->revkey[i].fprlen,
|
||||
0, NULL);
|
||||
if ((pk->revkey[i].class & 0x40))
|
||||
es_fprintf (fp, " %s", _("(sensitive)"));
|
||||
/* Class bit 7 must always be set, bit 6 indicates sensitive
|
||||
* and all others bits are reserved. */
|
||||
if (!(pk->revkey[i].class & ~0x40)
|
||||
|| (pk->revkey[i].class & ~(0x40|0x80)))
|
||||
es_fprintf (fp, " (unknown class %02x)", pk->revkey[i].class);
|
||||
es_fprintf (fp, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1967,7 +1984,7 @@ list_keyblock_colon (ctrl_t ctrl, kbnode_t keyblock,
|
|||
es_putc (':', es_stdout); /* End of field 20 (origin). */
|
||||
es_putc ('\n', es_stdout);
|
||||
|
||||
print_revokers (es_stdout, pk);
|
||||
print_revokers (es_stdout, 1, pk);
|
||||
print_fingerprint (ctrl, NULL, pk, 0);
|
||||
if (hexgrip)
|
||||
es_fprintf (es_stdout, "grp:::::::::%s:\n", hexgrip);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue