mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Split "--set-policy-url" into "--cert-policy-url" and "--sig-policy-url"
so the user can set different policies for key and data signing. For backwards compatibility, "--set-policy-url" sets both, as before.
This commit is contained in:
parent
e245123907
commit
0c3e409fa3
5 changed files with 42 additions and 8 deletions
18
g10/g10.c
18
g10/g10.c
|
@ -195,6 +195,8 @@ enum cmd_and_opt_values { aNull = 0,
|
|||
oForYourEyesOnly,
|
||||
oNoForYourEyesOnly,
|
||||
oSetPolicyURL,
|
||||
oSigPolicyURL,
|
||||
oCertPolicyURL,
|
||||
oShowPolicyURL,
|
||||
oNoShowPolicyURL,
|
||||
oUseEmbeddedFilename,
|
||||
|
@ -460,6 +462,8 @@ static ARGPARSE_OPTS opts[] = {
|
|||
{ oForYourEyesOnly, "for-your-eyes-only", 0, "@" },
|
||||
{ oNoForYourEyesOnly, "no-for-your-eyes-only", 0, "@" },
|
||||
{ oSetPolicyURL, "set-policy-url", 2, "@" },
|
||||
{ oSigPolicyURL, "sig-policy-url", 2, "@" },
|
||||
{ oCertPolicyURL, "cert-policy-url", 2, "@" },
|
||||
{ oShowPolicyURL, "show-policy-url", 0, "@" },
|
||||
{ oNoShowPolicyURL, "no-show-policy-url", 0, "@" },
|
||||
{ oShowNotation, "show-notation", 0, "@" },
|
||||
|
@ -1088,7 +1092,9 @@ main( int argc, char **argv )
|
|||
case oSetFilename: opt.set_filename = pargs.r.ret_str; break;
|
||||
case oForYourEyesOnly: eyes_only = 1; break;
|
||||
case oNoForYourEyesOnly: eyes_only = 0; break;
|
||||
case oSetPolicyURL: opt.set_policy_url = pargs.r.ret_str; break;
|
||||
case oSetPolicyURL: opt.sig_policy_url = opt.cert_policy_url = pargs.r.ret_str; break;
|
||||
case oSigPolicyURL: opt.sig_policy_url = pargs.r.ret_str; break;
|
||||
case oCertPolicyURL: opt.cert_policy_url = pargs.r.ret_str; break;
|
||||
case oShowPolicyURL: opt.show_policy_url=1; break;
|
||||
case oNoShowPolicyURL: opt.show_policy_url=0; break;
|
||||
case oUseEmbeddedFilename: opt.use_embedded_filename = 1; break;
|
||||
|
@ -1408,9 +1414,13 @@ main( int argc, char **argv )
|
|||
if( check_digest_algo(opt.s2k_digest_algo) )
|
||||
log_error(_("selected digest algorithm is invalid\n"));
|
||||
}
|
||||
if( opt.set_policy_url ) {
|
||||
if( check_policy_url( opt.set_policy_url ) )
|
||||
log_error(_("the given policy URL is invalid\n"));
|
||||
if( opt.sig_policy_url ) {
|
||||
if( check_policy_url( opt.sig_policy_url ) )
|
||||
log_error(_("the given signature policy URL is invalid\n"));
|
||||
}
|
||||
if( opt.cert_policy_url ) {
|
||||
if( check_policy_url( opt.cert_policy_url ) )
|
||||
log_error(_("the given certification policy URL is invalid\n"));
|
||||
}
|
||||
if( opt.def_compress_algo < 0 || opt.def_compress_algo > 2 )
|
||||
log_error(_("compress algorithm must be in range %d..%d\n"), 0, 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue