1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-11 21:48:50 +01: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

@ -1,3 +1,13 @@
2005-11-20 David Shaw <dshaw@jabberwocky.com>
* 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.
2005-11-19 David Shaw <dshaw@jabberwocky.com>
* free-packet.c (copy_secret_key): Copy secret key into secure

View File

@ -2442,24 +2442,7 @@ show_key_with_all_names_colon (KBNODE keyblock)
putchar('\n');
print_fingerprint (pk, NULL, 0);
/* print the revoker record */
if( !pk->revkey && pk->numrevkeys )
BUG();
else
{
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":"");
}
}
print_revokers(pk);
}
}

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 )
@ -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;

View File

@ -250,6 +250,7 @@ void print_subpackets_colon(PKT_signature *sig);
void reorder_keyblock (KBNODE keyblock);
void list_keyblock( KBNODE keyblock, int secret, int fpr, void *opaque );
void print_fingerprint (PKT_public_key *pk, PKT_secret_key *sk, int mode);
void print_revokers(PKT_public_key *pk);
void show_policy_url(PKT_signature *sig,int indent,int mode);
void show_keyserver_url(PKT_signature *sig,int indent,int mode);
void show_notation(PKT_signature *sig,int indent,int mode,int which);