1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-02-08 17:43:04 +01:00

add option --fixed-list-mode

This commit is contained in:
Werner Koch 2001-03-14 06:56:11 +00:00
parent 19ea3e3d99
commit fb7e532861
8 changed files with 62 additions and 18 deletions

2
TODO
View File

@ -40,6 +40,8 @@
* New option --file-remove path-to-wipe-program ? * New option --file-remove path-to-wipe-program ?
* Add an is_valid flag to each user ID.
Scheduled for 1.1 Scheduled for 1.1
----------------- -----------------
* David C Niemi pointed out that the code for --no-default-keyring does not * David C Niemi pointed out that the code for --no-default-keyring does not

View File

@ -1,3 +1,7 @@
2001-03-13 Werner Koch <wk@gnupg.org>
* gpg.sgml: Described --fixed-list-mode.
2001-03-06 Werner Koch <wk@gnupg.org> 2001-03-06 Werner Koch <wk@gnupg.org>
* gpgv.sgml: Changed some gpg to gpgv. Thanks to John A. Murdie. * gpgv.sgml: Changed some gpg to gpgv. Thanks to John A. Murdie.

View File

@ -18,6 +18,7 @@ ssb::1536:20:5CE086B5B5A18FF4:1998-07-07:0:::
letter, but be prepared that additional information may follow letter, but be prepared that additional information may follow
in some future versions. (not used for secret keys) in some future versions. (not used for secret keys)
o = Unknown (this key is new to the system) o = Unknown (this key is new to the system)
i = The key is invalid (e.g. due to a missing self-signature)
d = The key has been disabled d = The key has been disabled
r = The key has been revoked r = The key has been revoked
e = The key has expired e = The key has expired

View File

@ -1352,6 +1352,12 @@ can get a faster listing. The excact behaviour of this option may change
in future versions. in future versions.
</para></listitem></varlistentry> </para></listitem></varlistentry>
<varlistentry>
<term>--fixed-list-mode</term>
<listitem><para>
Do not merge user ID and primary key in --with-colon listing mode.
</para></listitem></varlistentry>
<varlistentry> <varlistentry>
<term>--list-only</term> <term>--list-only</term>
<listitem><para> <listitem><para>

View File

@ -1,5 +1,8 @@
2001-03-13 Werner Koch <wk@gnupg.org> 2001-03-13 Werner Koch <wk@gnupg.org>
* main.c, options.h: New option fixed_list_mode.
* keylist.c (list_keyblock_colon): use it here.
* getkey.c (merge_keys_and_selfsig): Divert merging of public keys * getkey.c (merge_keys_and_selfsig): Divert merging of public keys
to the function used in key selection.. to the function used in key selection..
* keylist.c (is_uid_valid): Removed. * keylist.c (is_uid_valid): Removed.

View File

@ -203,6 +203,7 @@ enum cmd_and_opt_values { aNull = 0,
oTryAllSecrets, oTryAllSecrets,
oTrustedKey, oTrustedKey,
oNoExpensiveTrustChecks, oNoExpensiveTrustChecks,
oFixedListMode,
oEmu3DESS2KBug, /* will be removed in 1.1 */ oEmu3DESS2KBug, /* will be removed in 1.1 */
oEmuMDEncodeBug, oEmuMDEncodeBug,
aTest }; aTest };
@ -385,6 +386,7 @@ static ARGPARSE_OPTS opts[] = {
{ oSetFilesize, "set-filesize", 20, "@" }, { oSetFilesize, "set-filesize", 20, "@" },
{ oHonorHttpProxy,"honor-http-proxy", 0, "@" }, { oHonorHttpProxy,"honor-http-proxy", 0, "@" },
{ oFastListMode,"fast-list-mode", 0, "@" }, { oFastListMode,"fast-list-mode", 0, "@" },
{ oFixedListMode,"fixed-list-mode", 0, "@" },
{ oListOnly, "list-only", 0, "@"}, { oListOnly, "list-only", 0, "@"},
{ oIgnoreTimeConflict, "ignore-time-conflict", 0, "@" }, { oIgnoreTimeConflict, "ignore-time-conflict", 0, "@" },
{ oIgnoreCrcError, "ignore-crc-error", 0,"@" }, { oIgnoreCrcError, "ignore-crc-error", 0,"@" },
@ -965,6 +967,7 @@ main( int argc, char **argv )
case oSetFilesize: opt.set_filesize = pargs.r.ret_ulong; break; case oSetFilesize: opt.set_filesize = pargs.r.ret_ulong; break;
case oHonorHttpProxy: opt.honor_http_proxy = 1; break; case oHonorHttpProxy: opt.honor_http_proxy = 1; break;
case oFastListMode: opt.fast_list_mode = 1; break; case oFastListMode: opt.fast_list_mode = 1; break;
case oFixedListMode: opt.fixed_list_mode = 1; break;
case oListOnly: opt.list_only=1; break; case oListOnly: opt.list_only=1; break;
case oIgnoreTimeConflict: opt.ignore_time_conflict = 1; break; case oIgnoreTimeConflict: opt.ignore_time_conflict = 1; break;
case oIgnoreCrcError: opt.ignore_crc_error = 1; break; case oIgnoreCrcError: opt.ignore_crc_error = 1; break;

View File

@ -322,7 +322,6 @@ list_keyblock_print ( KBNODE keyblock, int secret )
} }
/* FIXME: print info about revoked keys. */
static void static void
list_keyblock_colon( KBNODE keyblock, int secret ) list_keyblock_colon( KBNODE keyblock, int secret )
{ {
@ -360,17 +359,23 @@ list_keyblock_colon( KBNODE keyblock, int secret )
pk = node->pkt->pkt.public_key; pk = node->pkt->pkt.public_key;
sk = NULL; sk = NULL;
keyid_from_pk( pk, keyid ); keyid_from_pk( pk, keyid );
if ( opt.fast_list_mode || opt.no_expensive_trust_checks ) { fputs( "pub:", stdout );
fputs( "pub::", stdout ); trustletter = 0;
trustletter = 0; if ( !pk->is_valid )
} putchar ('i');
else if ( pk->is_revoked )
putchar ('r');
else if ( pk->has_expired )
putchar ('e');
else if ( opt.fast_list_mode || opt.no_expensive_trust_checks )
;
else { else {
trustletter = query_trust_info( pk, NULL ); trustletter = query_trust_info( pk, NULL );
if( trustletter == 'u' ) if( trustletter == 'u' )
ulti_hack = 1; ulti_hack = 1;
printf("pub:%c:", trustletter ); putchar(trustletter);
} }
printf("%u:%d:%08lX%08lX:%s:%s:", printf(":%u:%d:%08lX%08lX:%s:%s:",
nbits_from_pk( pk ), nbits_from_pk( pk ),
pk->pubkey_algo, pk->pubkey_algo,
(ulong)keyid[0],(ulong)keyid[1], (ulong)keyid[0],(ulong)keyid[1],
@ -384,11 +389,27 @@ list_keyblock_colon( KBNODE keyblock, int secret )
putchar( get_ownertrust_info( pk->local_id ) ); putchar( get_ownertrust_info( pk->local_id ) );
putchar(':'); putchar(':');
} }
if (opt.fixed_list_mode) {
/* do not merge the first uid with the primary key */
putchar(':');
putchar('\n');
if( opt.fingerprint )
fingerprint( pk, sk );
if( opt.with_key_data )
print_key_data( pk, keyid );
any = 1;
}
for( kbctx=NULL; (node=walk_kbnode( keyblock, &kbctx, 0)) ; ) { for( kbctx=NULL; (node=walk_kbnode( keyblock, &kbctx, 0)) ; ) {
if( node->pkt->pkttype == PKT_USER_ID && !opt.fast_list_mode ) { if( node->pkt->pkttype == PKT_USER_ID && !opt.fast_list_mode ) {
/*
* Fixme: We need a is_valid flag here too
*/
if( any ) { if( any ) {
if ( opt.no_expensive_trust_checks ) { if ( node->pkt->pkt.user_id->is_revoked )
printf("uid:r::::::::");
else if ( opt.no_expensive_trust_checks ) {
printf("uid:::::::::"); printf("uid:::::::::");
} }
else { else {
@ -397,8 +418,8 @@ list_keyblock_colon( KBNODE keyblock, int secret )
if( pk && !ulti_hack ) { if( pk && !ulti_hack ) {
if( node->pkt->pkt.user_id->photo ) if( node->pkt->pkt.user_id->photo )
rmd160_hash_buffer( namehash, rmd160_hash_buffer( namehash,
node->pkt->pkt.user_id->name, node->pkt->pkt.user_id->photo,
node->pkt->pkt.user_id->len ); node->pkt->pkt.user_id->photolen);
else else
rmd160_hash_buffer( namehash, rmd160_hash_buffer( namehash,
node->pkt->pkt.user_id->name, node->pkt->pkt.user_id->name,
@ -410,7 +431,6 @@ list_keyblock_colon( KBNODE keyblock, int secret )
printf("uid:%c::::::::", trustletter); printf("uid:%c::::::::", trustletter);
} }
} }
/* FIXME: check that uID is valid here too */
print_string( stdout, node->pkt->pkt.user_id->name, print_string( stdout, node->pkt->pkt.user_id->name,
node->pkt->pkt.user_id->len, ':' ); node->pkt->pkt.user_id->len, ':' );
putchar(':'); putchar(':');
@ -434,16 +454,20 @@ list_keyblock_colon( KBNODE keyblock, int secret )
any = 1; any = 1;
} }
keyid_from_pk( pk2, keyid2 ); keyid_from_pk( pk2, keyid2 );
if ( opt.fast_list_mode || opt.no_expensive_trust_checks ) { fputs ("sub:", stdout );
fputs( "sub::", stdout ); if ( !pk2->is_valid )
} putchar ('i');
else if ( pk2->is_revoked )
putchar ('r');
else if ( pk2->has_expired )
putchar ('e');
else if ( opt.fast_list_mode || opt.no_expensive_trust_checks )
;
else { else {
printf("sub:%c:", trustletter ); printf("%c", trustletter );
} }
printf("%u:%d:%08lX%08lX:%s:%s:", printf(":%u:%d:%08lX%08lX:%s:%s:",
nbits_from_pk( pk2 ), nbits_from_pk( pk2 ),
pk2->pubkey_algo, pk2->pubkey_algo,
(ulong)keyid2[0],(ulong)keyid2[1], (ulong)keyid2[0],(ulong)keyid2[1],

View File

@ -89,6 +89,7 @@ struct {
ulong set_filesize; ulong set_filesize;
int honor_http_proxy; int honor_http_proxy;
int fast_list_mode; int fast_list_mode;
int fixed_list_mode;
int ignore_time_conflict; int ignore_time_conflict;
int ignore_crc_error; int ignore_crc_error;
int command_fd; int command_fd;