mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpgsm: Add --always-trust feature.
* sm/gpgsm.h (opt): Re-purpose unused flag always_trust. (struct server_control_s): Add "always_trust". (VALIDATE_FLAG_BYPASS): New. * sm/gpgsm.c (oAlwaysTrust): New. (opts): Add "--always-trust" (main): Set option. * sm/server.c (option_handler): Add option "always-trust". (reset_notify): Clear that option. (cmd_encrypt): Ditto. (cmd_getinfo): Add sub-command always-trust. * sm/certchain.c (gpgsm_validate_chain): Handle VALIDATE_FLAG_BYPASS. * sm/certlist.c (gpgsm_add_to_certlist): Set that flag for recipients in always-trust mode. -- GnuPG-bug-id: 6559
This commit is contained in:
parent
4d7361d923
commit
cdd6747e1e
6 changed files with 78 additions and 7 deletions
12
sm/gpgsm.c
12
sm/gpgsm.c
|
@ -203,6 +203,7 @@ enum cmd_and_opt_values {
|
|||
oRequireCompliance,
|
||||
oCompatibilityFlags,
|
||||
oKbxBufferSize,
|
||||
oAlwaysTrust,
|
||||
oNoAutostart
|
||||
};
|
||||
|
||||
|
@ -394,6 +395,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||
ARGPARSE_s_n (oIgnoreTimeConflict, "ignore-time-conflict", "@"),
|
||||
ARGPARSE_s_n (oNoRandomSeedFile, "no-random-seed-file", "@"),
|
||||
ARGPARSE_s_n (oRequireCompliance, "require-compliance", "@"),
|
||||
ARGPARSE_s_n (oAlwaysTrust, "always-trust", "@"),
|
||||
|
||||
|
||||
ARGPARSE_header (NULL, N_("Options for unattended use")),
|
||||
|
@ -1441,6 +1443,7 @@ main ( int argc, char **argv)
|
|||
case oMinRSALength: opt.min_rsa_length = pargs.r.ret_ulong; break;
|
||||
|
||||
case oRequireCompliance: opt.require_compliance = 1; break;
|
||||
case oAlwaysTrust: opt.always_trust = 1; break;
|
||||
|
||||
case oKbxBufferSize:
|
||||
keybox_set_buffersize (pargs.r.ret_ulong, 0);
|
||||
|
@ -1505,6 +1508,15 @@ main ( int argc, char **argv)
|
|||
if (may_coredump && !opt.quiet)
|
||||
log_info (_("WARNING: program may create a core file!\n"));
|
||||
|
||||
if (opt.require_compliance && opt.always_trust)
|
||||
{
|
||||
opt.always_trust = 0;
|
||||
if (opt.quiet)
|
||||
log_info (_("WARNING: %s overrides %s\n"),
|
||||
"--require-compliance","--always-trust");
|
||||
}
|
||||
|
||||
|
||||
/* if (opt.qualsig_approval && !opt.quiet) */
|
||||
/* log_info (_("This software has officially been approved to " */
|
||||
/* "create and verify\n" */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue