mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-25 15:27:03 +01:00
* options.h, g10.c (main), trustdb.c (ask_ownertrust): Add
--force-ownertrust option for debugging purposes. This allows setting a whole keyring to a given trust during an --update-trustdb. Not for normal use - it's just easier than hitting "4" all the time to test a large trustdb.
This commit is contained in:
parent
d771dd272d
commit
bf4a893586
@ -1,5 +1,11 @@
|
|||||||
2002-11-06 David Shaw <dshaw@jabberwocky.com>
|
2002-11-06 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* options.h, g10.c (main), trustdb.c (ask_ownertrust): Add
|
||||||
|
--force-ownertrust option for debugging purposes. This allows
|
||||||
|
setting a whole keyring to a given trust during an
|
||||||
|
--update-trustdb. Not for normal use - it's just easier than
|
||||||
|
hitting "4" all the time to test a large trustdb.
|
||||||
|
|
||||||
* pubkey-enc.c (get_session_key): With hidden recipients or try a
|
* pubkey-enc.c (get_session_key): With hidden recipients or try a
|
||||||
given passphrase against all secret keys rather than trying all
|
given passphrase against all secret keys rather than trying all
|
||||||
secret keys in turn. Don't if --try-all-secrets or --status-fd is
|
secret keys in turn. Don't if --try-all-secrets or --status-fd is
|
||||||
|
11
g10/g10.c
11
g10/g10.c
@ -206,6 +206,7 @@ enum cmd_and_opt_values { aNull = 0,
|
|||||||
oCompressSigs,
|
oCompressSigs,
|
||||||
oAlwaysTrust,
|
oAlwaysTrust,
|
||||||
oTrustModel,
|
oTrustModel,
|
||||||
|
oForceOwnertrust,
|
||||||
oEmuChecksumBug,
|
oEmuChecksumBug,
|
||||||
oRunAsShmCP,
|
oRunAsShmCP,
|
||||||
oSetFilename,
|
oSetFilename,
|
||||||
@ -524,6 +525,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
{ oDefCertCheckLevel, "default-cert-check-level", 1, "@"},
|
{ oDefCertCheckLevel, "default-cert-check-level", 1, "@"},
|
||||||
{ oAlwaysTrust, "always-trust", 0, "@"},
|
{ oAlwaysTrust, "always-trust", 0, "@"},
|
||||||
{ oTrustModel, "trust-model", 2, "@"},
|
{ oTrustModel, "trust-model", 2, "@"},
|
||||||
|
{ oForceOwnertrust, "force-ownertrust", 1, "@"},
|
||||||
{ oEmuChecksumBug, "emulate-checksum-bug", 0, "@"},
|
{ oEmuChecksumBug, "emulate-checksum-bug", 0, "@"},
|
||||||
{ oRunAsShmCP, "run-as-shm-coprocess", 4, "@" },
|
{ oRunAsShmCP, "run-as-shm-coprocess", 4, "@" },
|
||||||
{ oSetFilename, "set-filename", 2, "@" },
|
{ oSetFilename, "set-filename", 2, "@" },
|
||||||
@ -1460,6 +1462,15 @@ main( int argc, char **argv )
|
|||||||
else
|
else
|
||||||
log_error("unknown trust model \"%s\"\n",pargs.r.ret_str);
|
log_error("unknown trust model \"%s\"\n",pargs.r.ret_str);
|
||||||
break;
|
break;
|
||||||
|
case oForceOwnertrust:
|
||||||
|
log_info(_("NOTE: %s is not for normal use!\n"),
|
||||||
|
"--force-ownertrust");
|
||||||
|
if(pargs.r.ret_int>=TRUST_UNDEFINED
|
||||||
|
&& pargs.r.ret_int<=TRUST_ULTIMATE)
|
||||||
|
opt.force_ownertrust=pargs.r.ret_int;
|
||||||
|
else
|
||||||
|
log_error("invalid ownertrust %d\n",pargs.r.ret_int);
|
||||||
|
break;
|
||||||
case oLoadExtension:
|
case oLoadExtension:
|
||||||
#ifndef __riscos__
|
#ifndef __riscos__
|
||||||
#if defined(USE_DYNAMIC_LINKING) || defined(__MINGW32__)
|
#if defined(USE_DYNAMIC_LINKING) || defined(__MINGW32__)
|
||||||
|
@ -89,6 +89,7 @@ struct {
|
|||||||
int compress_keys;
|
int compress_keys;
|
||||||
int compress_sigs;
|
int compress_sigs;
|
||||||
enum {TM_OPENPGP, TM_CLASSIC, TM_ALWAYS} trust_model;
|
enum {TM_OPENPGP, TM_CLASSIC, TM_ALWAYS} trust_model;
|
||||||
|
unsigned int force_ownertrust;
|
||||||
int pgp2;
|
int pgp2;
|
||||||
int pgp6;
|
int pgp6;
|
||||||
int pgp7; /* if we get any more of these, it's time to look at a
|
int pgp7; /* if we get any more of these, it's time to look at a
|
||||||
|
@ -1075,6 +1075,15 @@ ask_ownertrust (u32 *kid,int minimum)
|
|||||||
return TRUST_UNKNOWN;
|
return TRUST_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(opt.force_ownertrust)
|
||||||
|
{
|
||||||
|
log_info("force trust for key %08lX to %s\n",(ulong)kid[1],
|
||||||
|
trust_string(opt.force_ownertrust));
|
||||||
|
update_ownertrust(pk,opt.force_ownertrust);
|
||||||
|
ot=opt.force_ownertrust;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
ot=edit_ownertrust(pk,0);
|
ot=edit_ownertrust(pk,0);
|
||||||
if(ot>0)
|
if(ot>0)
|
||||||
ot = get_ownertrust (pk);
|
ot = get_ownertrust (pk);
|
||||||
@ -1082,6 +1091,8 @@ ask_ownertrust (u32 *kid,int minimum)
|
|||||||
ot = minimum?minimum:TRUST_UNDEFINED;
|
ot = minimum?minimum:TRUST_UNDEFINED;
|
||||||
else
|
else
|
||||||
ot = -1; /* quit */
|
ot = -1; /* quit */
|
||||||
|
}
|
||||||
|
|
||||||
free_public_key( pk );
|
free_public_key( pk );
|
||||||
|
|
||||||
return ot;
|
return ot;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user