diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/gpg.c | 3 | ||||
-rw-r--r-- | g10/options.h | 4 | ||||
-rw-r--r-- | g10/passphrase.c | 3 |
3 files changed, 9 insertions, 1 deletions
@@ -423,6 +423,7 @@ enum cmd_and_opt_values oSender, oKeyOrigin, oRequestOrigin, + oNoSymkeyCache, oNoop }; @@ -888,6 +889,7 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oAutoKeyLocate, "auto-key-locate", "@"), ARGPARSE_s_n (oNoAutoKeyLocate, "no-auto-key-locate", "@"), ARGPARSE_s_n (oNoAutostart, "no-autostart", "@"), + ARGPARSE_s_n (oNoSymkeyCache, "no-symkey-cache", "@"), /* Dummy options with warnings. */ ARGPARSE_s_n (oUseAgent, "use-agent", "@"), @@ -3556,6 +3558,7 @@ main (int argc, char **argv) break; case oNoAutostart: opt.autostart = 0; break; + case oNoSymkeyCache: opt.no_symkey_cache = 1; break; case oDefaultNewKeyAlgo: opt.def_new_key_algo = pargs.r.ret_str; diff --git a/g10/options.h b/g10/options.h index e1bf97fb1..96b76f8f2 100644 --- a/g10/options.h +++ b/g10/options.h @@ -242,7 +242,7 @@ struct unsigned int allow_weak_digest_algos:1; unsigned int large_rsa:1; unsigned int disable_signer_uid:1; - /* Flag to enbale experimental features from RFC4880bis. */ + /* Flag to enable experimental features from RFC4880bis. */ unsigned int rfc4880bis:1; } flags; @@ -275,6 +275,8 @@ struct int unwrap_encryption; int only_sign_text_ids; + + int no_symkey_cache; /* Disable the cache used for --symmetric. */ } opt; /* CTRL is used to keep some global variables we currently can't diff --git a/g10/passphrase.c b/g10/passphrase.c index a498f627b..ffdcdf2bd 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -317,6 +317,9 @@ passphrase_to_dek (int cipher_algo, STRING2KEY *s2k, canceled = &dummy_canceled; *canceled = 0; + if (opt.no_symkey_cache) + nocache = 1; /* Force no symmtric key caching. */ + if ( !s2k ) { log_assert (create && !nocache); |