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

* main.h, keylist.c (print_revokers): New. Print the "rvk" designated

revoker record.  Moved from keyedit.c:show_key_with_all_names_colon.

* keylist.c (list_keyblock_colon): Use it here ...

* keyedit.c (show_key_with_all_names_colon): ... and here.
This commit is contained in:
David Shaw 2005-11-20 15:02:03 +00:00
parent f7c138d9e7
commit 28c12508c5
4 changed files with 38 additions and 20 deletions

View file

@ -1009,6 +1009,29 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque )
putchar('\n');
}
void
print_revokers(PKT_public_key *pk)
{
/* print the revoker record */
if( !pk->revkey && pk->numrevkeys )
BUG();
else
{
int i,j;
for (i=0; i < pk->numrevkeys; i++)
{
byte *p;
printf ("rvk:::%d::::::", pk->revkey[i].algid);
p = pk->revkey[i].fpr;
for (j=0; j < 20; j++, p++ )
printf ("%02X", *p);
printf (":%02x%s:\n", pk->revkey[i].class,
(pk->revkey[i].class&0x40)?"s":"");
}
}
}
static void
list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
@ -1073,7 +1096,7 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
putchar( get_ownertrust_info(pk) );
putchar(':');
}
if (opt.fixed_list_mode) {
/* do not merge the first uid with the primary key */
putchar(':');
@ -1094,6 +1117,8 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
putchar(':'); /* End of field 15. */
}
putchar('\n');
if(pk)
print_revokers(pk);
if( fpr )
print_fingerprint( pk, sk, 0 );
if( opt.with_key_data )
@ -1101,7 +1126,6 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
any = 1;
}
for( kbctx=NULL; (node=walk_kbnode( keyblock, &kbctx, 0)) ; ) {
if( node->pkt->pkttype == PKT_USER_ID && !opt.fast_list_mode ) {
PKT_user_id *uid=node->pkt->pkt.user_id;