summaryrefslogtreecommitdiffstats
path: root/agent/agent.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-04-12 14:37:26 +0200
committerWerner Koch <wk@gnupg.org>2016-04-12 14:38:44 +0200
commit4159567f7ed7a1139fdc3a6c92988e1648ad84ab (patch)
tree8a5261826bcbd8252763d9ae5724a53ffb9f6cfe /agent/agent.h
parentdoc: Note that the persistant passphrase format is unimplemented. (diff)
downloadgnupg2-4159567f7ed7a1139fdc3a6c92988e1648ad84ab.tar.xz
gnupg2-4159567f7ed7a1139fdc3a6c92988e1648ad84ab.zip
agent: Implement new protection mode openpgp-s2k3-ocb-aes.
* agent/protect.c (agent_protect): Add arg use_ocb. Change all caller to pass -1 for default. * agent/protect-tool.c: New option --debug-use-ocb. (oDebugUseOCB): New. (opt_debug_use_ocb): New. (main): Set option. (read_and_protect): Implement option. * agent/protect.c (OCB_MODE_SUPPORTED): New macro. (PROT_DEFAULT_TO_OCB): New macro. (do_encryption): Add args use_ocb, hashbegin, hashlen, timestamp_exp, and timestamp_exp_len. Implement OCB. (agent_protect): Change to support OCB. (do_decryption): Add new args is_ocb, aadhole_begin, and aadhole_len. Implement OCB. (merge_lists): Allow NULL for sha1hash. (agent_unprotect): Change to support OCB. (agent_private_key_type): Remove debug output. -- Instead of using the old OpenPGP way of appending a hash of the plaintext and encrypt that along with the plaintext, the new scheme uses a proper authenticated encryption mode. See keyformat.txt for a description. Libgcrypt 1.7 is required. This mode is not yet enabled because there would be no way to return to an older GnuPG version. To test the new scheme use gpg-protect-tool: ./gpg-protect-tool -av -P abc -p --debug-use-ocb <plain.key >prot.key ./gpg-protect-tool -av -P abc -u <prot.key Any key from the private key storage should work. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'agent/agent.h')
-rw-r--r--agent/agent.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/agent/agent.h b/agent/agent.h
index c2726bbbc..0dcb20107 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -471,7 +471,7 @@ unsigned long get_standard_s2k_count (void);
unsigned char get_standard_s2k_count_rfc4880 (void);
int agent_protect (const unsigned char *plainkey, const char *passphrase,
unsigned char **result, size_t *resultlen,
- unsigned long s2k_count);
+ unsigned long s2k_count, int use_ocb);
int agent_unprotect (ctrl_t ctrl,
const unsigned char *protectedkey, const char *passphrase,
gnupg_isotime_t protected_at,