aboutsummaryrefslogtreecommitdiffstats
path: root/g10/main.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-01-23 18:08:16 +0000
committerWerner Koch <[email protected]>2018-01-23 18:08:16 +0000
commitf3ef8b0dcaede1c85da0dff8eeceda6a994f0b28 (patch)
tree26438580bccad14556dd29a97591baa26cef217e /g10/main.h
parentgpg: Copy the AEAD prefs to the user ID struct. (diff)
downloadgnupg-f3ef8b0dcaede1c85da0dff8eeceda6a994f0b28.tar.gz
gnupg-f3ef8b0dcaede1c85da0dff8eeceda6a994f0b28.zip
gpg: New option --chunk-size.
* g10/gpg.c (opts): New option --chunk-size. (oChunkSize): New const. (build_list_aead_test_algo, build_list_aead_algo_name): New. (my_strusage): List AEAD algos. (main): Implement --chunk-size.. * g10/options.h (struct opt): Add field 'chunk_size'. (DBG_IPC): Remove duplicated macro. * g10/main.h (DEFAULT_AEAD_ALGO): Depend on Libgcrypt version. * g10/misc.c (openpgp_aead_test_algo): Ditto. * g10/cipher-aead.c: Silence if not in debug mode. * g10/decrypt-data.c: Ditto. -- And that new option immediatley revealed bugs in our chunking code :-(.
Diffstat (limited to 'g10/main.h')
-rw-r--r--g10/main.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/g10/main.h b/g10/main.h
index a02c5740f..2f7c159a9 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -41,7 +41,11 @@
# define DEFAULT_CIPHER_ALGO CIPHER_ALGO_3DES
#endif
-#define DEFAULT_AEAD_ALGO AEAD_ALGO_EAX
+#if GCRYPT_VERSION_NUMBER < 0x019000
+# define DEFAULT_AEAD_ALGO AEAD_ALGO_OCB
+#else
+# define DEFAULT_AEAD_ALGO AEAD_ALGO_EAX
+#endif
#define DEFAULT_DIGEST_ALGO ((GNUPG)? DIGEST_ALGO_SHA256:DIGEST_ALGO_SHA1)
#define DEFAULT_S2K_DIGEST_ALGO DIGEST_ALGO_SHA1