diff options
author | David Shaw <[email protected]> | 2002-06-15 12:25:54 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-06-15 12:25:54 +0000 |
commit | 492f05f5b92974d711718313eebb37e03a5c9b92 (patch) | |
tree | e583d30ed40062576ffc989b01f9eb87844663f2 | |
parent | * keygen.c (keygen_add_revkey): Remove unused code. (diff) | |
download | gnupg-492f05f5b92974d711718313eebb37e03a5c9b92.tar.gz gnupg-492f05f5b92974d711718313eebb37e03a5c9b92.zip |
* keyedit.c (show_key_with_all_names), keylist.c (list_keyblock_print):
Show "[expired]" before expired uids.
* keyedit.c (show_key_with_all_names_colon), mainproc.c (list_node),
keylist.c (list_keyblock_colon): Use "uat" for user attribute packets
instead of "uid". Also use '<count> <length>' rather than the fake user
id string.
-rw-r--r-- | g10/ChangeLog | 8 | ||||
-rw-r--r-- | g10/keyedit.c | 19 | ||||
-rw-r--r-- | g10/keylist.c | 20 | ||||
-rw-r--r-- | g10/mainproc.c | 17 |
4 files changed, 51 insertions, 13 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index eb4feec56..7e58c653a 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,13 @@ 2002-06-15 David Shaw <[email protected]> + * keyedit.c (show_key_with_all_names), keylist.c + (list_keyblock_print): Show "[expired]" before expired uids. + + * keyedit.c (show_key_with_all_names_colon), mainproc.c + (list_node), keylist.c (list_keyblock_colon): Use "uat" for user + attribute packets instead of "uid". Also use '<count> <length>' + rather than the fake user id string. + * keygen.c (keygen_add_revkey): Remove unused code. * misc.c (check_permissions): Check directory permissions diff --git a/g10/keyedit.c b/g10/keyedit.c index ffbb7d03c..6462b1d13 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1587,8 +1587,6 @@ show_key_with_all_names_colon (KBNODE keyblock) keyid_from_pk (pk, keyid); - - fputs (node->pkt->pkttype == PKT_PUBLIC_KEY?"pub:":"sub:", stdout); if (!pk->is_valid) putchar ('i'); @@ -1643,8 +1641,16 @@ show_key_with_all_names_colon (KBNODE keyblock) int trustletter = '?'; ++i; - printf ("uid:%c::::::::", trustletter); - print_string (stdout, uid->name, uid->len, ':'); + if(uid->attrib_data) + { + printf ("uat:%c::::::::%u %lu", trustletter, + uid->numattribs,uid->attrib_len); + } + else + { + printf ("uid:%c::::::::", trustletter); + print_string (stdout, uid->name, uid->len, ':'); + } putchar (':'); /* signature class */ putchar (':'); @@ -1674,6 +1680,8 @@ show_key_with_all_names_colon (KBNODE keyblock) putchar ('p'); if (uid->is_revoked) putchar ('r'); + if (uid->is_expired) + putchar ('e'); if ((node->flag & NODFLG_SELUID)) putchar ('s'); if ((node->flag & NODFLG_MARK_A)) @@ -1819,6 +1827,8 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker, tty_printf("(%d) ", i); if ( uid->is_revoked ) tty_printf ("[revoked] "); + if ( uid->is_expired ) + tty_printf ("[expired] "); tty_print_utf8_string( uid->name, uid->len ); tty_printf("\n"); if( with_prefs ) @@ -2256,6 +2266,7 @@ menu_addrevoker( KBNODE pub_keyblock, KBNODE sec_keyblock ) "key as a designated revoker? (y/N): ")) continue; + /* todo: handle 0x40 sensitive flag here */ revkey.class=0x80; revkey.algid=revoker_pk->pubkey_algo; free_public_key(revoker_pk); diff --git a/g10/keylist.c b/g10/keylist.c index 83fc19964..e226ee071 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -439,6 +439,8 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) if ( node->pkt->pkt.user_id->is_revoked ) fputs ("[revoked] ", stdout); + if ( node->pkt->pkt.user_id->is_expired ) + fputs ("[expired] ", stdout); print_utf8_string( stdout, node->pkt->pkt.user_id->name, node->pkt->pkt.user_id->len ); putchar('\n'); @@ -676,10 +678,13 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr ) * Fixme: We need a is_valid flag here too */ if( any ) { + char *str=node->pkt->pkt.user_id->attrib_data?"uat":"uid"; if ( node->pkt->pkt.user_id->is_revoked ) - printf("uid:r::::::::"); + printf("%s:r::::::::",str); + else if ( node->pkt->pkt.user_id->is_expired ) + printf("%s:e::::::::",str); else if ( opt.no_expensive_trust_checks ) { - printf("uid:::::::::"); + printf("%s:::::::::",str); } else { byte namehash[20]; @@ -697,11 +702,16 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr ) } else trustletter = 'u'; - printf("uid:%c::::::::", trustletter); + printf("%s:%c::::::::",str,trustletter); } } - print_string( stdout, node->pkt->pkt.user_id->name, - node->pkt->pkt.user_id->len, ':' ); + if(node->pkt->pkt.user_id->attrib_data) + printf("%u %lu", + node->pkt->pkt.user_id->numattribs, + node->pkt->pkt.user_id->attrib_len); + else + print_string( stdout, node->pkt->pkt.user_id->name, + node->pkt->pkt.user_id->len, ':' ); putchar(':'); if (any) putchar('\n'); diff --git a/g10/mainproc.c b/g10/mainproc.c index 40ea26ffb..bcd1c1c01 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -732,8 +732,15 @@ print_userid( PACKET *pkt ) return; } if( opt.with_colons ) - print_string( stdout, pkt->pkt.user_id->name, - pkt->pkt.user_id->len, ':'); + { + if(pkt->pkt.user_id->attrib_data) + printf("%u %lu", + pkt->pkt.user_id->numattribs, + pkt->pkt.user_id->attrib_len); + else + print_string( stdout, pkt->pkt.user_id->name, + pkt->pkt.user_id->len, ':'); + } else print_utf8_string( stdout, pkt->pkt.user_id->name, pkt->pkt.user_id->len ); @@ -857,7 +864,8 @@ list_node( CTX c, KBNODE node ) else if( node->pkt->pkttype == PKT_USER_ID ) { if( any ) { if( opt.with_colons ) - printf("uid:::::::::"); + printf("%s:::::::::", + node->pkt->pkt.user_id->attrib_data?"uat":"uid"); else printf( "uid%*s", 28, "" ); } @@ -931,7 +939,8 @@ list_node( CTX c, KBNODE node ) else if( node->pkt->pkttype == PKT_USER_ID ) { if( any ) { if( opt.with_colons ) - printf("uid:::::::::"); + printf("%s:::::::::", + node->pkt->pkt.user_id->attrib_data?"uat":"uid"); else printf( "uid%*s", 28, "" ); } |