diff options
-rw-r--r-- | g10/ChangeLog | 5 | ||||
-rw-r--r-- | g10/g10.c | 50 | ||||
-rw-r--r-- | g10/keyedit.c | 12 | ||||
-rw-r--r-- | g10/keylist.c | 31 | ||||
-rw-r--r-- | g10/mainproc.c | 8 | ||||
-rw-r--r-- | g10/options.h | 48 |
6 files changed, 81 insertions, 73 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index b1c3488b0..fbcacbf9c 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2003-11-13 David Shaw <[email protected]> + + * options.h, g10.c, keyedit.c, keylist.c, mainproc.c: Clarify the + plurarility (or not) of various list and verify options. + 2003-11-12 David Shaw <[email protected]> * g10.c (main): Add --symmetric --sign --encrypt. @@ -1224,7 +1224,7 @@ main( int argc, char **argv ) opt.keyserver_options.include_revoked=1; opt.keyserver_options.try_dns_srv=1; opt.verify_options= - VERIFY_SHOW_POLICY|VERIFY_SHOW_NOTATION|VERIFY_SHOW_KEYSERVER; + VERIFY_SHOW_POLICY_URLS|VERIFY_SHOW_NOTATIONS|VERIFY_SHOW_KEYSERVER_URLS; opt.trust_model=TM_AUTO; opt.mangle_dos_filenames = 0; #if defined (_WIN32) @@ -1691,19 +1691,19 @@ main( int argc, char **argv ) case oCertPolicyURL: add_policy_url(pargs.r.ret_str,1); break; case oShowPolicyURL: deprecated_warning(configname,configlineno,"--show-policy-url", - "--list-options ","show-policy-url"); + "--list-options ","show-policy-urls"); deprecated_warning(configname,configlineno,"--show-policy-url", - "--verify-options ","show-policy-url"); - opt.list_options|=LIST_SHOW_POLICY; - opt.verify_options|=VERIFY_SHOW_POLICY; + "--verify-options ","show-policy-urls"); + opt.list_options|=LIST_SHOW_POLICY_URLS; + opt.verify_options|=VERIFY_SHOW_POLICY_URLS; break; case oNoShowPolicyURL: deprecated_warning(configname,configlineno,"--no-show-policy-url", - "--list-options ","no-show-policy-url"); + "--list-options ","no-show-policy-urls"); deprecated_warning(configname,configlineno,"--no-show-policy-url", - "--verify-options ","no-show-policy-url"); - opt.list_options&=~LIST_SHOW_POLICY; - opt.verify_options&=~VERIFY_SHOW_POLICY; + "--verify-options ","no-show-policy-urls"); + opt.list_options&=~LIST_SHOW_POLICY_URLS; + opt.verify_options&=~VERIFY_SHOW_POLICY_URLS; break; case oSigKeyserverURL: add_keyserver_url(pargs.r.ret_str,0); break; case oUseEmbeddedFilename: opt.use_embedded_filename = 1; break; @@ -1878,11 +1878,11 @@ main( int argc, char **argv ) struct parse_options lopts[]= { {"show-photos",LIST_SHOW_PHOTOS}, - {"show-policy-url",LIST_SHOW_POLICY}, - {"show-notation",LIST_SHOW_NOTATION}, - {"show-keyserver-url",LIST_SHOW_KEYSERVER}, + {"show-policy-urls",LIST_SHOW_POLICY_URLS}, + {"show-notations",LIST_SHOW_NOTATIONS}, + {"show-keyserver-urls",LIST_SHOW_KEYSERVER_URLS}, {"show-validity",LIST_SHOW_VALIDITY}, - {"show-long-keyid",LIST_SHOW_LONG_KEYID}, + {"show-long-keyids",LIST_SHOW_LONG_KEYIDS}, {"show-unusable-uids",LIST_SHOW_UNUSABLE_UIDS}, {"show-keyring",LIST_SHOW_KEYRING}, {"show-sig-expire",LIST_SHOW_SIG_EXPIRE}, @@ -1904,11 +1904,11 @@ main( int argc, char **argv ) struct parse_options vopts[]= { {"show-photos",VERIFY_SHOW_PHOTOS}, - {"show-policy-url",VERIFY_SHOW_POLICY}, - {"show-notation",VERIFY_SHOW_NOTATION}, - {"show-keyserver-url",VERIFY_SHOW_KEYSERVER}, + {"show-policy-urls",VERIFY_SHOW_POLICY_URLS}, + {"show-notations",VERIFY_SHOW_NOTATIONS}, + {"show-keyserver-urls",VERIFY_SHOW_KEYSERVER_URLS}, {"show-validity",VERIFY_SHOW_VALIDITY}, - {"show-long-keyid",VERIFY_SHOW_LONG_KEYID}, + {"show-long-keyids",VERIFY_SHOW_LONG_KEYIDS}, {"show-unusable-uids",VERIFY_SHOW_UNUSABLE_UIDS}, {NULL,0} }; @@ -1938,19 +1938,19 @@ main( int argc, char **argv ) case oCertNotation: add_notation_data( pargs.r.ret_str, 1 ); break; case oShowNotation: deprecated_warning(configname,configlineno,"--show-notation", - "--list-options ","show-notation"); + "--list-options ","show-notations"); deprecated_warning(configname,configlineno,"--show-notation", - "--verify-options ","show-notation"); - opt.list_options|=LIST_SHOW_NOTATION; - opt.verify_options|=VERIFY_SHOW_NOTATION; + "--verify-options ","show-notations"); + opt.list_options|=LIST_SHOW_NOTATIONS; + opt.verify_options|=VERIFY_SHOW_NOTATIONS; break; case oNoShowNotation: deprecated_warning(configname,configlineno,"--no-show-notation", - "--list-options ","no-show-notation"); + "--list-options ","no-show-notations"); deprecated_warning(configname,configlineno,"--no-show-notation", - "--verify-options ","no-show-notation"); - opt.list_options&=~LIST_SHOW_NOTATION; - opt.verify_options&=~VERIFY_SHOW_NOTATION; + "--verify-options ","no-show-notations"); + opt.list_options&=~LIST_SHOW_NOTATIONS; + opt.verify_options&=~VERIFY_SHOW_NOTATIONS; break; case oUtf8Strings: utf8_strings = 1; break; case oNoUtf8Strings: utf8_strings = 0; break; diff --git a/g10/keyedit.c b/g10/keyedit.c index 6b9d8fd91..d3d1640a9 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -145,7 +145,7 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node, sig->flags.expired?'X':' ', (sig->trust_depth>9)?'T': (sig->trust_depth>0)?'0'+sig->trust_depth:' '); - if(opt.list_options&LIST_SHOW_LONG_KEYID) + 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]); @@ -169,13 +169,13 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node, } tty_printf("\n"); - if(sig->flags.policy_url && (opt.list_options&LIST_SHOW_POLICY)) + if(sig->flags.policy_url && (opt.list_options&LIST_SHOW_POLICY_URLS)) show_policy_url(sig,3,0); - if(sig->flags.notation && (opt.list_options&LIST_SHOW_NOTATION)) + if(sig->flags.notation && (opt.list_options&LIST_SHOW_NOTATIONS)) show_notation(sig,3,0); - if(sig->flags.pref_ks && (opt.list_options&LIST_SHOW_KEYSERVER)) + if(sig->flags.pref_ks && (opt.list_options&LIST_SHOW_KEYSERVER_URLS)) show_keyserver_url(sig,3,0); } @@ -2068,7 +2068,7 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker, nbits_from_pk( pk ), pubkey_letter( pk->pubkey_algo )); - if(opt.list_options&LIST_SHOW_LONG_KEYID) + if(opt.list_options&LIST_SHOW_LONG_KEYIDS) tty_printf("%08lX",(ulong)pk->keyid[0]); tty_printf("%08lX ",(ulong)pk->keyid[1]); @@ -2082,7 +2082,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_KEYID) + if(opt.list_options&LIST_SHOW_LONG_KEYIDS) tty_printf(" "); /* Ownertrust is only meaningful for the PGP or classic trust models */ diff --git a/g10/keylist.c b/g10/keylist.c index 90bc54289..1cc9720e2 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -1,6 +1,6 @@ /* keylist.c - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 - * Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002 + * 2003 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -605,7 +605,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) struct sig_stats *stats=opaque; int skip_sigs=0; int newformat=((opt.list_options&LIST_SHOW_VALIDITY) && !secret) - || (opt.list_options & (LIST_SHOW_LONG_KEYID | LIST_SHOW_UNUSABLE_UIDS)); + || (opt.list_options & (LIST_SHOW_LONG_KEYIDS|LIST_SHOW_UNUSABLE_UIDS)); /* get the keyid from the keyblock */ node = find_kbnode( keyblock, secret? PKT_SECRET_KEY : PKT_PUBLIC_KEY ); @@ -625,7 +625,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) (sk->protect.s2k.mode==1002)?'>':' ', nbits_from_sk( sk ),pubkey_letter( sk->pubkey_algo )); - if(opt.list_options&LIST_SHOW_LONG_KEYID) + if(opt.list_options&LIST_SHOW_LONG_KEYIDS) printf("%08lX%08lX",(ulong)keyid[0],(ulong)keyid[1]); else printf("%08lX",(ulong)keyid[1]); @@ -653,7 +653,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) printf("pub %4u%c/", nbits_from_pk(pk),pubkey_letter(pk->pubkey_algo)); - if(opt.list_options&LIST_SHOW_LONG_KEYID) + if(opt.list_options&LIST_SHOW_LONG_KEYIDS) printf("%08lX%08lX",(ulong)keyid[0],(ulong)keyid[1]); else printf("%08lX",(ulong)keyid[1]); @@ -696,7 +696,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) if(uid->is_revoked || uid->is_expired) printf("uid%*s[%s] ", - (opt.list_options&LIST_SHOW_LONG_KEYID)?16:8,"", + (opt.list_options&LIST_SHOW_LONG_KEYIDS)?16:8,"", uid->is_revoked?"revoked":"expired"); else if((opt.list_options&LIST_SHOW_VALIDITY) && pk) { @@ -704,7 +704,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) trust_value_to_string(get_validity(pk,uid)); /* Includes the 3 spaces for [, ], and " ". */ - indent=((opt.list_options&LIST_SHOW_LONG_KEYID)?23:15) + indent=((opt.list_options&LIST_SHOW_LONG_KEYIDS)?23:15) -strlen(validity); if(indent<0) @@ -714,7 +714,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) } else if(newformat) printf("uid%*s", - (opt.list_options&LIST_SHOW_LONG_KEYID)?26:18,""); + (opt.list_options&LIST_SHOW_LONG_KEYIDS)?26:18,""); else if(any) printf("uid%*s",29,""); @@ -745,7 +745,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) keyid_from_pk( pk2, keyid2 ); printf("sub %4u%c/", nbits_from_pk( pk2 ),pubkey_letter( pk2->pubkey_algo )); - if(opt.list_options&LIST_SHOW_LONG_KEYID) + if(opt.list_options&LIST_SHOW_LONG_KEYIDS) printf("%08lX%08lX",(ulong)keyid2[0],(ulong)keyid2[1]); else printf("%08lX",(ulong)keyid2[1]); @@ -774,7 +774,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) (sk->protect.s2k.mode==1001)?'#': (sk->protect.s2k.mode==1002)?'>':' ', nbits_from_sk( sk2 ),pubkey_letter( sk2->pubkey_algo )); - if(opt.list_options&LIST_SHOW_LONG_KEYID) + if(opt.list_options&LIST_SHOW_LONG_KEYIDS) printf("%08lX%08lX",(ulong)keyid2[0],(ulong)keyid2[1]); else printf("%08lX",(ulong)keyid2[1]); @@ -857,7 +857,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) sig->flags.expired?'X':' ', (sig->trust_depth>9)?'T': (sig->trust_depth>0)?'0'+sig->trust_depth:' '); - if(opt.list_options&LIST_SHOW_LONG_KEYID) + if(opt.list_options&LIST_SHOW_LONG_KEYIDS) printf("%08lX%08lX",(ulong)sig->keyid[0],(ulong)sig->keyid[1]); else printf("%08lX",(ulong)sig->keyid[1]); @@ -877,13 +877,16 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque ) } putchar('\n'); - if(sig->flags.policy_url && (opt.list_options&LIST_SHOW_POLICY)) + if(sig->flags.policy_url + && (opt.list_options&LIST_SHOW_POLICY_URLS)) show_policy_url(sig,3,0); - if(sig->flags.notation && (opt.list_options&LIST_SHOW_NOTATION)) + if(sig->flags.notation + && (opt.list_options&LIST_SHOW_NOTATIONS)) show_notation(sig,3,0); - if(sig->flags.pref_ks && (opt.list_options&LIST_SHOW_KEYSERVER)) + if(sig->flags.pref_ks + && (opt.list_options&LIST_SHOW_KEYSERVER_URLS)) show_keyserver_url(sig,3,0); /* fixme: check or list other sigs here */ diff --git a/g10/mainproc.c b/g10/mainproc.c index 62881d651..05c1a5c28 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -1306,7 +1306,7 @@ check_sig_and_print( CTX c, KBNODE node ) tstr = asctimestamp(sig->timestamp); astr = pubkey_algo_to_string( sig->pubkey_algo ); - if(opt.verify_options&VERIFY_SHOW_LONG_KEYID) + if(opt.verify_options&VERIFY_SHOW_LONG_KEYIDS) { log_info(_("Signature made %.*s\n"),(int)strlen(tstr), tstr); log_info(_(" using %s key %08lX%08lX\n"), @@ -1499,17 +1499,17 @@ check_sig_and_print( CTX c, KBNODE node ) if( !rc ) { - if(opt.verify_options&VERIFY_SHOW_POLICY) + if(opt.verify_options&VERIFY_SHOW_POLICY_URLS) show_policy_url(sig,0,1); else show_policy_url(sig,0,2); - if(opt.verify_options&VERIFY_SHOW_KEYSERVER) + if(opt.verify_options&VERIFY_SHOW_KEYSERVER_URLS) show_keyserver_url(sig,0,1); else show_keyserver_url(sig,0,2); - if(opt.verify_options&VERIFY_SHOW_NOTATION) + if(opt.verify_options&VERIFY_SHOW_NOTATIONS) show_notation(sig,0,1); else show_notation(sig,0,2); diff --git a/g10/options.h b/g10/options.h index 64a803c22..b3738f524 100644 --- a/g10/options.h +++ b/g10/options.h @@ -227,32 +227,32 @@ struct { /* Various option flags */ -#define IMPORT_ALLOW_LOCAL_SIGS 1 -#define IMPORT_REPAIR_PKS_SUBKEY_BUG 2 -#define IMPORT_FAST_IMPORT 4 -#define IMPORT_SK2PK 8 +#define IMPORT_ALLOW_LOCAL_SIGS (1<<0) +#define IMPORT_REPAIR_PKS_SUBKEY_BUG (1<<1) +#define IMPORT_FAST_IMPORT (1<<2) +#define IMPORT_SK2PK (1<<3) -#define EXPORT_INCLUDE_NON_RFC 1 -#define EXPORT_INCLUDE_LOCAL_SIGS 2 -#define EXPORT_INCLUDE_ATTRIBUTES 4 -#define EXPORT_INCLUDE_SENSITIVE_REVKEYS 8 +#define EXPORT_INCLUDE_NON_RFC (1<<0) +#define EXPORT_INCLUDE_LOCAL_SIGS (1<<1) +#define EXPORT_INCLUDE_ATTRIBUTES (1<<2) +#define EXPORT_INCLUDE_SENSITIVE_REVKEYS (1<<3) -#define LIST_SHOW_PHOTOS (1<<0) -#define LIST_SHOW_POLICY (1<<1) -#define LIST_SHOW_NOTATION (1<<2) -#define LIST_SHOW_KEYSERVER (1<<3) -#define LIST_SHOW_VALIDITY (1<<4) -#define LIST_SHOW_LONG_KEYID (1<<5) -#define LIST_SHOW_UNUSABLE_UIDS (1<<6) -#define LIST_SHOW_KEYRING (1<<7) -#define LIST_SHOW_SIG_EXPIRE (1<<8) +#define LIST_SHOW_PHOTOS (1<<0) +#define LIST_SHOW_POLICY_URLS (1<<1) +#define LIST_SHOW_NOTATIONS (1<<2) +#define LIST_SHOW_KEYSERVER_URLS (1<<3) +#define LIST_SHOW_VALIDITY (1<<4) +#define LIST_SHOW_LONG_KEYIDS (1<<5) +#define LIST_SHOW_UNUSABLE_UIDS (1<<6) +#define LIST_SHOW_KEYRING (1<<7) +#define LIST_SHOW_SIG_EXPIRE (1<<8) -#define VERIFY_SHOW_PHOTOS (1<<0) -#define VERIFY_SHOW_POLICY (1<<1) -#define VERIFY_SHOW_NOTATION (1<<2) -#define VERIFY_SHOW_KEYSERVER (1<<3) -#define VERIFY_SHOW_VALIDITY (1<<4) -#define VERIFY_SHOW_LONG_KEYID (1<<5) -#define VERIFY_SHOW_UNUSABLE_UIDS (1<<6) +#define VERIFY_SHOW_PHOTOS (1<<0) +#define VERIFY_SHOW_POLICY_URLS (1<<1) +#define VERIFY_SHOW_NOTATIONS (1<<2) +#define VERIFY_SHOW_KEYSERVER_URLS (1<<3) +#define VERIFY_SHOW_VALIDITY (1<<4) +#define VERIFY_SHOW_LONG_KEYIDS (1<<5) +#define VERIFY_SHOW_UNUSABLE_UIDS (1<<6) #endif /*G10_OPTIONS_H*/ |