aboutsummaryrefslogtreecommitdiffstats
path: root/g10/g10.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-11-03 20:18:56 +0000
committerDavid Shaw <[email protected]>2002-11-03 20:18:56 +0000
commit91a8e4a6fb15994eea58ff2bab9403c5456af6a1 (patch)
treee761564473a03432673c05f4fa8824384ebcadc8 /g10/g10.c
parent* gpg.sgml: Document "tsign", clarify "setpref", clarify --recipient, (diff)
downloadgnupg-91a8e4a6fb15994eea58ff2bab9403c5456af6a1.tar.gz
gnupg-91a8e4a6fb15994eea58ff2bab9403c5456af6a1.zip
* options.h, g10.c (main): Add --trust-model option. Current models are
"openpgp" which is classic+trustsigs, "classic" which is classic only, and "always" which is the same as the current option --always-trust (which still works). Default is "openpgp". * trustdb.c (validate_one_keyblock): Use "openpgp" trust model to enable trust sigs. * gpgv.c (main), mainproc.c (check_sig_and_print), pkclist.c (do_we_trust, do_we_trust_pre, check_signatures_trust): Use new --trust-model option in place of --always-trust.
Diffstat (limited to 'g10/g10.c')
-rw-r--r--g10/g10.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/g10/g10.c b/g10/g10.c
index 96696ae40..365d15fba 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -205,6 +205,7 @@ enum cmd_and_opt_values { aNull = 0,
oCompressKeys,
oCompressSigs,
oAlwaysTrust,
+ oTrustModel,
oEmuChecksumBug,
oRunAsShmCP,
oSetFilename,
@@ -522,6 +523,7 @@ static ARGPARSE_OPTS opts[] = {
{ oCompressSigs, "compress-sigs",0, "@"},
{ oDefCertCheckLevel, "default-cert-check-level", 1, "@"},
{ oAlwaysTrust, "always-trust", 0, "@"},
+ { oTrustModel, "trust-model", 2, "@"},
{ oEmuChecksumBug, "emulate-checksum-bug", 0, "@"},
{ oRunAsShmCP, "run-as-shm-coprocess", 4, "@" },
{ oSetFilename, "set-filename", 2, "@" },
@@ -1142,6 +1144,7 @@ main( int argc, char **argv )
EXPORT_INCLUDE_NON_RFC|EXPORT_INCLUDE_ATTRIBUTES;
opt.keyserver_options.include_subkeys=1;
opt.keyserver_options.include_revoked=1;
+ opt.trust_model=TM_OPENPGP;
#if defined (__MINGW32__) || defined (__CYGWIN32__)
set_homedir ( read_w32_registry_string( NULL,
"Software\\GNU\\GnuPG", "HomeDir" ));
@@ -1443,7 +1446,20 @@ main( int argc, char **argv )
case oCompressAlgo: opt.def_compress_algo = pargs.r.ret_int; break;
case oCompressKeys: opt.compress_keys = 1; break;
case aListSecretKeys: set_cmd( &cmd, aListSecretKeys); break;
- case oAlwaysTrust: opt.always_trust = 1; break;
+ /* There are many programs (like mutt) that call gpg with
+ --always-trust so keep this option around for a long
+ time. */
+ case oAlwaysTrust: opt.trust_model=TM_ALWAYS; break;
+ case oTrustModel:
+ if(ascii_strcasecmp(pargs.r.ret_str,"openpgp")==0)
+ opt.trust_model=TM_OPENPGP;
+ else if(ascii_strcasecmp(pargs.r.ret_str,"classic")==0)
+ opt.trust_model=TM_CLASSIC;
+ else if(ascii_strcasecmp(pargs.r.ret_str,"always")==0)
+ opt.trust_model=TM_ALWAYS;
+ else
+ log_error("unknown trust model \"%s\"\n",pargs.r.ret_str);
+ break;
case oLoadExtension:
#ifndef __riscos__
#if defined(USE_DYNAMIC_LINKING) || defined(__MINGW32__)