From 28c12508c53cefdd86b7eafcb748a67aafd282d4 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Sun, 20 Nov 2005 15:02:03 +0000 Subject: [PATCH] * 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. --- g10/ChangeLog | 10 ++++++++++ g10/keyedit.c | 19 +------------------ g10/keylist.c | 28 ++++++++++++++++++++++++++-- g10/main.h | 1 + 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index ca5d8d8bb..d6bf03c2c 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,13 @@ +2005-11-20 David Shaw + + * 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 * free-packet.c (copy_secret_key): Copy secret key into secure diff --git a/g10/keyedit.c b/g10/keyedit.c index 174fef90c..52025ce27 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -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); } } diff --git a/g10/keylist.c b/g10/keylist.c index 610a83911..295e6dca5 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -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; diff --git a/g10/main.h b/g10/main.h index b9b6f400d..a67c2ff3f 100644 --- a/g10/main.h +++ b/g10/main.h @@ -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);