1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* options.h, g10.c (main): Add a more flexible --keyid-format option to

replace the list-option (and eventually verify-option) show-long-keyids.
The format can be short, long, 0xshort, and 0xlong.

* keydb.h, keyid.c (keystr, keystrlen): New functions to generate a
printable keyid.

* keyedit.c (print_and_check_one_sig, show_key_with_all_names), keylist.c
(list_keyblock_print): Use new keystr() function here to print keyids.
This commit is contained in:
David Shaw 2004-03-03 05:47:51 +00:00
parent c57262fd57
commit 2d7fe1d3a1
7 changed files with 133 additions and 81 deletions

View file

@ -134,7 +134,7 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node,
break;
}
if( sigrc != '?' || print_without_key ) {
tty_printf("%s%c%c %c%c%c%c%c%c ",
tty_printf("%s%c%c %c%c%c%c%c%c %s %s",
is_rev? "rev":"sig",sigrc,
(sig->sig_class-0x10>0 &&
sig->sig_class-0x10<4)?'0'+sig->sig_class-0x10:' ',
@ -144,12 +144,8 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node,
sig->flags.notation?'N':' ',
sig->flags.expired?'X':' ',
(sig->trust_depth>9)?'T':
(sig->trust_depth>0)?'0'+sig->trust_depth:' ');
if(opt.list_options&LIST_SHOW_LONG_KEYIDS)
tty_printf("%08lX%08lX",(ulong)sig->keyid[0],(ulong)sig->keyid[1]);
else
tty_printf("%08lX",(ulong)sig->keyid[1]);
tty_printf(" %s", datestr_from_sig(sig));
(sig->trust_depth>0)?'0'+sig->trust_depth:' ',
keystr(sig->keyid),datestr_from_sig(sig));
if(opt.list_options&LIST_SHOW_SIG_EXPIRE)
tty_printf(" %s",expirestr_from_sig(sig));
tty_printf(" ");
@ -161,12 +157,13 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node,
tty_printf( is_rev? _("[revocation]")
: _("[self-signature]") );
}
else {
else
{
size_t n;
char *p = get_user_id( sig->keyid, &n );
tty_print_utf8_string2( p, n, opt.screen_columns-37 );
tty_print_utf8_string2( p, n, opt.screen_columns-keystrlen()-26 );
m_free(p);
}
}
tty_printf("\n");
if(sig->flags.policy_url && (opt.list_options&LIST_SHOW_POLICY_URLS))
@ -2052,16 +2049,13 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
}
keyid_from_pk(pk,NULL);
tty_printf("%s%c %4u%c/",
tty_printf("%s%c %4u%c/%s ",
node->pkt->pkttype == PKT_PUBLIC_KEY? "pub":"sub",
(node->flag & NODFLG_SELKEY)? '*':' ',
nbits_from_pk( pk ),
pubkey_letter( pk->pubkey_algo ));
pubkey_letter( pk->pubkey_algo ),
keystr(pk->keyid));
if(opt.list_options&LIST_SHOW_LONG_KEYIDS)
tty_printf("%08lX",(ulong)pk->keyid[0]);
tty_printf("%08lX ",(ulong)pk->keyid[1]);
tty_printf(_("created: %s"),datestr_from_pk(pk));
tty_printf(" ");
if(pk->is_revoked)
@ -2076,9 +2070,7 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
{
if(opt.trust_model!=TM_ALWAYS)
{
tty_printf(" ");
if(opt.list_options&LIST_SHOW_LONG_KEYIDS)
tty_printf(" ");
tty_printf("%*s",keystrlen()+13,"");
/* Ownertrust is only meaningful for the PGP or
classic trust models */
if(opt.trust_model==TM_PGP || opt.trust_model==TM_CLASSIC)