mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
* keylist.c (show_notation): Use bits to select which sort of notation to
show. Don't allow a not-shown notation to prevent us from issuing the proper --status-fd message. * options.h, g10.c (main): Add show-std/standard-notations and show-user-notations. show-notations is both. Default is to show standard notations only during verify. Change all callers.
This commit is contained in:
parent
0bfa710643
commit
f106448a7d
@ -1,3 +1,13 @@
|
|||||||
|
2004-05-04 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* keylist.c (show_notation): Use bits to select which sort of
|
||||||
|
notation to show. Don't allow a not-shown notation to prevent us
|
||||||
|
from issuing the proper --status-fd message.
|
||||||
|
|
||||||
|
* options.h, g10.c (main): Add show-std/standard-notations and
|
||||||
|
show-user-notations. show-notations is both. Default is to show
|
||||||
|
standard notations only during verify. Change all callers.
|
||||||
|
|
||||||
2004-04-28 David Shaw <dshaw@jabberwocky.com>
|
2004-04-28 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* main.h, keylist.c (show_notation): Add argument to show only
|
* main.h, keylist.c (show_notation): Add argument to show only
|
||||||
|
@ -1447,7 +1447,7 @@ main( int argc, char **argv )
|
|||||||
opt.keyserver_options.options=
|
opt.keyserver_options.options=
|
||||||
KEYSERVER_INCLUDE_SUBKEYS|KEYSERVER_INCLUDE_REVOKED|KEYSERVER_TRY_DNS_SRV|KEYSERVER_HONOR_KEYSERVER_URL;
|
KEYSERVER_INCLUDE_SUBKEYS|KEYSERVER_INCLUDE_REVOKED|KEYSERVER_TRY_DNS_SRV|KEYSERVER_HONOR_KEYSERVER_URL;
|
||||||
opt.verify_options=
|
opt.verify_options=
|
||||||
VERIFY_SHOW_POLICY_URLS|VERIFY_SHOW_NOTATIONS|VERIFY_SHOW_KEYSERVER_URLS;
|
VERIFY_SHOW_POLICY_URLS|VERIFY_SHOW_STD_NOTATIONS|VERIFY_SHOW_KEYSERVER_URLS;
|
||||||
opt.trust_model=TM_AUTO;
|
opt.trust_model=TM_AUTO;
|
||||||
opt.mangle_dos_filenames=0;
|
opt.mangle_dos_filenames=0;
|
||||||
opt.min_cert_level=2;
|
opt.min_cert_level=2;
|
||||||
@ -2126,6 +2126,9 @@ main( int argc, char **argv )
|
|||||||
{"show-photos",LIST_SHOW_PHOTOS,NULL},
|
{"show-photos",LIST_SHOW_PHOTOS,NULL},
|
||||||
{"show-policy-urls",LIST_SHOW_POLICY_URLS,NULL},
|
{"show-policy-urls",LIST_SHOW_POLICY_URLS,NULL},
|
||||||
{"show-notations",LIST_SHOW_NOTATIONS,NULL},
|
{"show-notations",LIST_SHOW_NOTATIONS,NULL},
|
||||||
|
{"show-std-notations",LIST_SHOW_STD_NOTATIONS,NULL},
|
||||||
|
{"show-standard-notations",LIST_SHOW_STD_NOTATIONS,NULL},
|
||||||
|
{"show-user-notations",LIST_SHOW_USER_NOTATIONS,NULL},
|
||||||
{"show-keyserver-urls",LIST_SHOW_KEYSERVER_URLS,NULL},
|
{"show-keyserver-urls",LIST_SHOW_KEYSERVER_URLS,NULL},
|
||||||
{"show-validity",LIST_SHOW_VALIDITY,NULL},
|
{"show-validity",LIST_SHOW_VALIDITY,NULL},
|
||||||
{"show-unusable-uids",LIST_SHOW_UNUSABLE_UIDS,NULL},
|
{"show-unusable-uids",LIST_SHOW_UNUSABLE_UIDS,NULL},
|
||||||
@ -2152,6 +2155,9 @@ main( int argc, char **argv )
|
|||||||
{"show-photos",VERIFY_SHOW_PHOTOS,NULL},
|
{"show-photos",VERIFY_SHOW_PHOTOS,NULL},
|
||||||
{"show-policy-urls",VERIFY_SHOW_POLICY_URLS,NULL},
|
{"show-policy-urls",VERIFY_SHOW_POLICY_URLS,NULL},
|
||||||
{"show-notations",VERIFY_SHOW_NOTATIONS,NULL},
|
{"show-notations",VERIFY_SHOW_NOTATIONS,NULL},
|
||||||
|
{"show-std-notations",VERIFY_SHOW_STD_NOTATIONS,NULL},
|
||||||
|
{"show-standard-notations",VERIFY_SHOW_STD_NOTATIONS,NULL},
|
||||||
|
{"show-user-notations",VERIFY_SHOW_USER_NOTATIONS,NULL},
|
||||||
{"show-keyserver-urls",VERIFY_SHOW_KEYSERVER_URLS,NULL},
|
{"show-keyserver-urls",VERIFY_SHOW_KEYSERVER_URLS,NULL},
|
||||||
{"show-validity",VERIFY_SHOW_VALIDITY,NULL},
|
{"show-validity",VERIFY_SHOW_VALIDITY,NULL},
|
||||||
{"show-unusable-uids",VERIFY_SHOW_UNUSABLE_UIDS,NULL},
|
{"show-unusable-uids",VERIFY_SHOW_UNUSABLE_UIDS,NULL},
|
||||||
|
@ -170,7 +170,9 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node,
|
|||||||
show_policy_url(sig,3,0);
|
show_policy_url(sig,3,0);
|
||||||
|
|
||||||
if(sig->flags.notation && (opt.list_options&LIST_SHOW_NOTATIONS))
|
if(sig->flags.notation && (opt.list_options&LIST_SHOW_NOTATIONS))
|
||||||
show_notation(sig,3,0,0);
|
show_notation(sig,3,0,
|
||||||
|
((opt.list_options&LIST_SHOW_STD_NOTATIONS)?1:0)+
|
||||||
|
((opt.list_options&LIST_SHOW_USER_NOTATIONS)?2:0));
|
||||||
|
|
||||||
if(sig->flags.pref_ks && (opt.list_options&LIST_SHOW_KEYSERVER_URLS))
|
if(sig->flags.pref_ks && (opt.list_options&LIST_SHOW_KEYSERVER_URLS))
|
||||||
show_keyserver_url(sig,3,0);
|
show_keyserver_url(sig,3,0);
|
||||||
|
@ -237,9 +237,9 @@ show_keyserver_url(PKT_signature *sig,int indent,int mode)
|
|||||||
mode=1 for log_info + status messages
|
mode=1 for log_info + status messages
|
||||||
mode=2 for status messages only
|
mode=2 for status messages only
|
||||||
|
|
||||||
which=0 for both standard and user notations
|
which bits:
|
||||||
which=1 for standard notations only
|
1 == standard notations
|
||||||
which=2 for user notations only
|
2 == user notations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -250,6 +250,9 @@ show_notation(PKT_signature *sig,int indent,int mode,int which)
|
|||||||
int seq=0,crit;
|
int seq=0,crit;
|
||||||
FILE *fp=mode?log_stream():stdout;
|
FILE *fp=mode?log_stream():stdout;
|
||||||
|
|
||||||
|
if(which==0)
|
||||||
|
which=3;
|
||||||
|
|
||||||
/* There may be multiple notations in the same sig. */
|
/* There may be multiple notations in the same sig. */
|
||||||
|
|
||||||
while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_NOTATION,&len,&seq,&crit)))
|
while((p=enum_sig_subpkt(sig->hashed,SIGSUBPKT_NOTATION,&len,&seq,&crit)))
|
||||||
@ -266,37 +269,37 @@ show_notation(PKT_signature *sig,int indent,int mode,int which)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(which==1 && memchr(p+8,'@',n1))
|
|
||||||
continue;
|
|
||||||
else if(which==2 && !memchr(p+8,'@',n1))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(mode!=2)
|
if(mode!=2)
|
||||||
{
|
{
|
||||||
int i;
|
int has_at=!!memchr(p+8,'@',n1);
|
||||||
char *str;
|
|
||||||
|
|
||||||
for(i=0;i<indent;i++)
|
if((which&1 && !has_at) || (which&2 && has_at))
|
||||||
putchar(' ');
|
{
|
||||||
|
int i;
|
||||||
|
char *str;
|
||||||
|
|
||||||
/* This is UTF8 */
|
for(i=0;i<indent;i++)
|
||||||
if(crit)
|
putchar(' ');
|
||||||
str=_("Critical signature notation: ");
|
|
||||||
else
|
|
||||||
str=_("Signature notation: ");
|
|
||||||
if(mode)
|
|
||||||
log_info("%s",str);
|
|
||||||
else
|
|
||||||
printf("%s",str);
|
|
||||||
print_utf8_string(fp,p+8,n1);
|
|
||||||
fprintf(fp,"=");
|
|
||||||
|
|
||||||
if(*p&0x80)
|
/* This is UTF8 */
|
||||||
print_utf8_string(fp,p+8+n1,n2);
|
if(crit)
|
||||||
else
|
str=_("Critical signature notation: ");
|
||||||
fprintf(fp,"[ %s ]",_("not human readable"));
|
else
|
||||||
|
str=_("Signature notation: ");
|
||||||
|
if(mode)
|
||||||
|
log_info("%s",str);
|
||||||
|
else
|
||||||
|
printf("%s",str);
|
||||||
|
print_utf8_string(fp,p+8,n1);
|
||||||
|
fprintf(fp,"=");
|
||||||
|
|
||||||
fprintf(fp,"\n");
|
if(*p&0x80)
|
||||||
|
print_utf8_string(fp,p+8+n1,n2);
|
||||||
|
else
|
||||||
|
fprintf(fp,"[ %s ]",_("not human readable"));
|
||||||
|
|
||||||
|
fprintf(fp,"\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mode)
|
if(mode)
|
||||||
@ -770,8 +773,8 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque )
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("ssb%c %4u%c/%s %s",
|
printf("ssb%c %4u%c/%s %s",
|
||||||
(sk->protect.s2k.mode==1001)?'#':
|
(sk2->protect.s2k.mode==1001)?'#':
|
||||||
(sk->protect.s2k.mode==1002)?'>':' ',
|
(sk2->protect.s2k.mode==1002)?'>':' ',
|
||||||
nbits_from_sk( sk2 ),pubkey_letter( sk2->pubkey_algo ),
|
nbits_from_sk( sk2 ),pubkey_letter( sk2->pubkey_algo ),
|
||||||
keystr_from_sk(sk2),datestr_from_sk( sk2 ) );
|
keystr_from_sk(sk2),datestr_from_sk( sk2 ) );
|
||||||
if( sk2->expiredate )
|
if( sk2->expiredate )
|
||||||
@ -871,9 +874,10 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque )
|
|||||||
&& (opt.list_options&LIST_SHOW_POLICY_URLS))
|
&& (opt.list_options&LIST_SHOW_POLICY_URLS))
|
||||||
show_policy_url(sig,3,0);
|
show_policy_url(sig,3,0);
|
||||||
|
|
||||||
if(sig->flags.notation
|
if(sig->flags.notation && (opt.list_options&LIST_SHOW_NOTATIONS))
|
||||||
&& (opt.list_options&LIST_SHOW_NOTATIONS))
|
show_notation(sig,3,0,
|
||||||
show_notation(sig,3,0,0);
|
((opt.list_options&LIST_SHOW_STD_NOTATIONS)?1:0)+
|
||||||
|
((opt.list_options&LIST_SHOW_USER_NOTATIONS)?2:0));
|
||||||
|
|
||||||
if(sig->flags.pref_ks
|
if(sig->flags.pref_ks
|
||||||
&& (opt.list_options&LIST_SHOW_KEYSERVER_URLS))
|
&& (opt.list_options&LIST_SHOW_KEYSERVER_URLS))
|
||||||
|
@ -1539,7 +1539,9 @@ check_sig_and_print( CTX c, KBNODE node )
|
|||||||
show_keyserver_url(sig,0,2);
|
show_keyserver_url(sig,0,2);
|
||||||
|
|
||||||
if(opt.verify_options&VERIFY_SHOW_NOTATIONS)
|
if(opt.verify_options&VERIFY_SHOW_NOTATIONS)
|
||||||
show_notation(sig,0,1,0);
|
show_notation(sig,0,1,
|
||||||
|
((opt.verify_options&VERIFY_SHOW_STD_NOTATIONS)?1:0)+
|
||||||
|
((opt.verify_options&VERIFY_SHOW_USER_NOTATIONS)?2:0));
|
||||||
else
|
else
|
||||||
show_notation(sig,0,2,0);
|
show_notation(sig,0,2,0);
|
||||||
}
|
}
|
||||||
|
@ -245,20 +245,24 @@ struct
|
|||||||
|
|
||||||
#define LIST_SHOW_PHOTOS (1<<0)
|
#define LIST_SHOW_PHOTOS (1<<0)
|
||||||
#define LIST_SHOW_POLICY_URLS (1<<1)
|
#define LIST_SHOW_POLICY_URLS (1<<1)
|
||||||
#define LIST_SHOW_NOTATIONS (1<<2)
|
#define LIST_SHOW_STD_NOTATIONS (1<<2)
|
||||||
#define LIST_SHOW_KEYSERVER_URLS (1<<3)
|
#define LIST_SHOW_USER_NOTATIONS (1<<3)
|
||||||
#define LIST_SHOW_VALIDITY (1<<4)
|
#define LIST_SHOW_NOTATIONS (LIST_SHOW_STD_NOTATIONS|LIST_SHOW_USER_NOTATIONS)
|
||||||
#define LIST_SHOW_UNUSABLE_UIDS (1<<5)
|
#define LIST_SHOW_KEYSERVER_URLS (1<<4)
|
||||||
#define LIST_SHOW_UNUSABLE_SUBKEYS (1<<6)
|
#define LIST_SHOW_VALIDITY (1<<5)
|
||||||
#define LIST_SHOW_KEYRING (1<<7)
|
#define LIST_SHOW_UNUSABLE_UIDS (1<<6)
|
||||||
#define LIST_SHOW_SIG_EXPIRE (1<<8)
|
#define LIST_SHOW_UNUSABLE_SUBKEYS (1<<7)
|
||||||
|
#define LIST_SHOW_KEYRING (1<<8)
|
||||||
|
#define LIST_SHOW_SIG_EXPIRE (1<<9)
|
||||||
|
|
||||||
#define VERIFY_SHOW_PHOTOS (1<<0)
|
#define VERIFY_SHOW_PHOTOS (1<<0)
|
||||||
#define VERIFY_SHOW_POLICY_URLS (1<<1)
|
#define VERIFY_SHOW_POLICY_URLS (1<<1)
|
||||||
#define VERIFY_SHOW_NOTATIONS (1<<2)
|
#define VERIFY_SHOW_STD_NOTATIONS (1<<2)
|
||||||
#define VERIFY_SHOW_KEYSERVER_URLS (1<<3)
|
#define VERIFY_SHOW_USER_NOTATIONS (1<<3)
|
||||||
#define VERIFY_SHOW_VALIDITY (1<<4)
|
#define VERIFY_SHOW_NOTATIONS (VERIFY_SHOW_STD_NOTATIONS|VERIFY_SHOW_USER_NOTATIONS)
|
||||||
#define VERIFY_SHOW_UNUSABLE_UIDS (1<<5)
|
#define VERIFY_SHOW_KEYSERVER_URLS (1<<4)
|
||||||
|
#define VERIFY_SHOW_VALIDITY (1<<5)
|
||||||
|
#define VERIFY_SHOW_UNUSABLE_UIDS (1<<6)
|
||||||
|
|
||||||
#define KEYSERVER_INCLUDE_REVOKED (1<<0)
|
#define KEYSERVER_INCLUDE_REVOKED (1<<0)
|
||||||
#define KEYSERVER_INCLUDE_DISABLED (1<<1)
|
#define KEYSERVER_INCLUDE_DISABLED (1<<1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user