aboutsummaryrefslogtreecommitdiffstats
path: root/agent/protect.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-04-02 18:02:55 +0000
committerWerner Koch <[email protected]>2017-04-02 18:02:55 +0000
commitd24375271b97e45deaeb1ef0a8434c64066ba2e8 (patch)
tree610e0d18703b6727935a72afcae6e8785714680b /agent/protect.c
parentkbx: Unify blob reading functions. (diff)
downloadgnupg-d24375271b97e45deaeb1ef0a8434c64066ba2e8.tar.gz
gnupg-d24375271b97e45deaeb1ef0a8434c64066ba2e8.zip
agent: Use OCB for key protection with --enable-extended-key-format.
* agent/protect.c (PROT_DEFAULT_TO_OCB): Remove macro. (agent_protect): Make the default protection mode depend on the extend key format option. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'agent/protect.c')
-rw-r--r--agent/protect.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/agent/protect.c b/agent/protect.c
index 09aa50352..a9de732a1 100644
--- a/agent/protect.c
+++ b/agent/protect.c
@@ -42,11 +42,6 @@
#include "../common/sexp-parse.h"
-/* To use the openpgp-s2k3-ocb-aes scheme by default set the value of
- * this macro to 1. Note that the caller of agent_protect may
- * override this default. */
-#define PROT_DEFAULT_TO_OCB 0
-
/* The protection mode for encryption. The supported modes for
decryption are listed in agent_unprotect(). */
#define PROT_CIPHER GCRY_CIPHER_AES128
@@ -580,7 +575,7 @@ agent_protect (const unsigned char *plainkey, const char *passphrase,
int have_curve = 0;
if (use_ocb == -1)
- use_ocb = PROT_DEFAULT_TO_OCB;
+ use_ocb = opt.enable_extended_key_format;
/* Create an S-expression with the protected-at timestamp. */
memcpy (timestamp_exp, "(12:protected-at15:", 19);