From 789d240cb40ab36406a7c57ad49897e0bafbb41e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 11 Apr 2018 20:35:40 +0200 Subject: gpg: New option --no-symkey-cache. * g10/gpg.c (oNoSymkeyCache): New. (opts): Add that option. (main): Set var. * g10/options.h (struct opt): New field no_symkey_cache. * g10/passphrase.c (passphrase_to_dek): Implement that feature. Signed-off-by: Werner Koch --- g10/gpg.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'g10/gpg.c') diff --git a/g10/gpg.c b/g10/gpg.c index 2c93a8380..fbbdd92ba 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -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; -- cgit v1.2.3 From e2bd152a928d79ddfb95fd2f7911c80a1a8d5a21 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Apr 2018 11:49:36 +0200 Subject: gpg: Relax printing of STATUS_FAILURE. * g10/gpg.c (g10_exit): Print STATUS_FAILURE only based on passed return code and not on the presence of any call to log_error. -- This fixes an actual regression in GPGME where FAILURE is considered for example by a signature verify operation. The operation will simply fail and not just record that that a signature could not be verified. In particular for files with more than one signature a log_error if often called to show that a pubkey is missing for one of the signatures. Using that log_error is correct in that case. Fixes-commit: 0336e5d1a7b9d46e06c838e6a98aecfcc9542882 Signed-off-by: Werner Koch --- g10/gpg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'g10/gpg.c') diff --git a/g10/gpg.c b/g10/gpg.c index fbbdd92ba..aaeddeee2 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -5111,7 +5111,7 @@ g10_exit( int rc ) /* If we had an error but not printed an error message, do it now. * Note that write_status_failure will never print a second failure * status line. */ - if (log_get_errorcount (0)) + if (rc) write_status_failure ("gpg-exit", gpg_error (GPG_ERR_GENERAL)); gcry_control (GCRYCTL_UPDATE_RANDOM_SEED_FILE); -- cgit v1.2.3