1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-05-19 09:02:22 +02:00

* mainproc.c (proc_pubkey_enc, print_pkenc_list, list_node):

--keyid-format conversion.
This commit is contained in:
David Shaw 2004-03-18 02:56:41 +00:00
parent f0e0c301b2
commit ba3f9044d3
2 changed files with 51 additions and 49 deletions

View File

@ -1,3 +1,8 @@
2004-03-17 David Shaw <dshaw@jabberwocky.com>
* mainproc.c (proc_pubkey_enc, print_pkenc_list, list_node):
--keyid-format conversion.
2004-03-16 David Shaw <dshaw@jabberwocky.com> 2004-03-16 David Shaw <dshaw@jabberwocky.com>
* getkey.c (skip_unusable, merge_selfsigs_main, * getkey.c (skip_unusable, merge_selfsigs_main,

View File

@ -363,7 +363,7 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
/* Hmmm: why do I have this algo check here - anyway there is /* Hmmm: why do I have this algo check here - anyway there is
* function to check it. */ * function to check it. */
if( opt.verbose ) if( opt.verbose )
log_info(_("public key is %08lX\n"), (ulong)enc->keyid[1] ); log_info(_("public key is %s\n"), keystr(enc->keyid) );
if( is_status_enabled() ) { if( is_status_enabled() ) {
char buf[50]; char buf[50];
@ -448,11 +448,12 @@ print_pkenc_list( struct kidlist_item *list, int failed )
if( !algstr ) if( !algstr )
algstr = "[?]"; algstr = "[?]";
pk->pubkey_algo = list->pubkey_algo; pk->pubkey_algo = list->pubkey_algo;
if( !get_pubkey( pk, list->kid ) ) { if( !get_pubkey( pk, list->kid ) )
{
size_t n; size_t n;
char *p; char *p;
log_info( _("encrypted with %u-bit %s key, ID %08lX, created %s\n"), log_info( _("encrypted with %u-bit %s key, ID %s, created %s\n"),
nbits_from_pk( pk ), algstr, (ulong)list->kid[1], nbits_from_pk( pk ), algstr, keystr_from_pk(pk),
strtimestamp(pk->timestamp) ); strtimestamp(pk->timestamp) );
fputs(" \"", log_stream() ); fputs(" \"", log_stream() );
p = get_user_id( list->kid, &n ); p = get_user_id( list->kid, &n );
@ -460,10 +461,10 @@ print_pkenc_list( struct kidlist_item *list, int failed )
m_free(p); m_free(p);
fputs("\"\n", log_stream() ); fputs("\"\n", log_stream() );
} }
else { else
log_info(_("encrypted with %s key, ID %08lX\n"), log_info(_("encrypted with %s key, ID %s\n"),
algstr, (ulong) list->kid[1] ); algstr,keystr(list->kid));
}
free_public_key( pk ); free_public_key( pk );
if( list->reason == G10ERR_NO_SECKEY ) { if( list->reason == G10ERR_NO_SECKEY ) {
@ -839,7 +840,8 @@ list_node( CTX c, KBNODE node )
|| node->pkt->pkttype == PKT_PUBLIC_SUBKEY ) { || node->pkt->pkttype == PKT_PUBLIC_SUBKEY ) {
PKT_public_key *pk = node->pkt->pkt.public_key; PKT_public_key *pk = node->pkt->pkt.public_key;
if( opt.with_colons ) { if( opt.with_colons )
{
u32 keyid[2]; u32 keyid[2];
keyid_from_pk( pk, keyid ); keyid_from_pk( pk, keyid );
if( mainkey ) if( mainkey )
@ -866,13 +868,10 @@ list_node( CTX c, KBNODE node )
} }
} }
else else
printf("%s %4u%c/%08lX %s%s", printf("%s %4u%c/%s %s%s",
mainkey? "pub":"sub", mainkey? "pub":"sub", nbits_from_pk( pk ),
nbits_from_pk( pk ), pubkey_letter( pk->pubkey_algo ), keystr_from_pk( pk ),
pubkey_letter( pk->pubkey_algo ), datestr_from_pk( pk ), mainkey?" ":"");
(ulong)keyid_from_pk( pk, NULL ),
datestr_from_pk( pk ),
mainkey?" ":"");
if( mainkey ) { if( mainkey ) {
/* and now list all userids with their signatures */ /* and now list all userids with their signatures */
@ -935,7 +934,8 @@ list_node( CTX c, KBNODE node )
|| node->pkt->pkttype == PKT_SECRET_SUBKEY ) { || node->pkt->pkttype == PKT_SECRET_SUBKEY ) {
PKT_secret_key *sk = node->pkt->pkt.secret_key; PKT_secret_key *sk = node->pkt->pkt.secret_key;
if( opt.with_colons ) { if( opt.with_colons )
{
u32 keyid[2]; u32 keyid[2];
keyid_from_sk( sk, keyid ); keyid_from_sk( sk, keyid );
printf("%s::%u:%d:%08lX%08lX:%s:%s:::", printf("%s::%u:%d:%08lX%08lX:%s:%s:::",
@ -948,12 +948,9 @@ list_node( CTX c, KBNODE node )
/* fixme: add LID */ ); /* fixme: add LID */ );
} }
else else
printf("%s %4u%c/%08lX %s ", printf("%s %4u%c/%s %s ", mainkey? "sec":"ssb",
mainkey? "sec":"ssb", nbits_from_sk( sk ), pubkey_letter( sk->pubkey_algo ),
nbits_from_sk( sk ), keystr_from_sk( sk ), datestr_from_sk( sk ));
pubkey_letter( sk->pubkey_algo ),
(ulong)keyid_from_sk( sk, NULL ),
datestr_from_sk( sk ) );
if( mainkey ) { if( mainkey ) {
/* and now list all userids with their signatures */ /* and now list all userids with their signatures */
for( node = node->next; node; node = node->next ) { for( node = node->next; node; node = node->next ) {
@ -1055,8 +1052,8 @@ list_node( CTX c, KBNODE node )
printf(":"); printf(":");
} }
else else
printf("%c %08lX %s ", printf("%c %s %s ",
sigrc, (ulong)sig->keyid[1], datestr_from_sig(sig)); sigrc, keystr(sig->keyid), datestr_from_sig(sig));
if( sigrc == '%' ) if( sigrc == '%' )
printf("[%s] ", g10_errstr(rc2) ); printf("[%s] ", g10_errstr(rc2) );
else if( sigrc == '?' ) else if( sigrc == '?' )