summaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-08-18 11:45:00 +0200
committerWerner Koch <wk@gnupg.org>2014-08-18 11:45:00 +0200
commit57df1121c18b004dd763b35eabf7b51fc9e8ec38 (patch)
tree27650b4baab0966f55fe409f8697d0be485b234a /g10
parentyat2m: Support @set and @value. (diff)
downloadgnupg2-57df1121c18b004dd763b35eabf7b51fc9e8ec38.tar.xz
gnupg2-57df1121c18b004dd763b35eabf7b51fc9e8ec38.zip
gpg: Change default cipher for --symmetric from CAST5 to AES-128.
* g10/main.h (DEFAULT_CIPHER_ALGO): Chhange to AES or CAST5 or 3DES depending on configure option. * g10/gpg.c (main): Set opt.s2k_cipher_algo to DEFAULT_CIPHER_ALGO.
Diffstat (limited to 'g10')
-rw-r--r--g10/gpg.c2
-rw-r--r--g10/main.h11
2 files changed, 10 insertions, 3 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index 7ba193b6f..ce1a87fbd 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -2072,7 +2072,7 @@ main (int argc, char **argv)
opt.compress_algo = -1; /* defaults to DEFAULT_COMPRESS_ALGO */
opt.s2k_mode = 3; /* iterated+salted */
opt.s2k_count = 0; /* Auto-calibrate when needed. */
- opt.s2k_cipher_algo = CIPHER_ALGO_CAST5;
+ opt.s2k_cipher_algo = DEFAULT_CIPHER_ALGO;
opt.completes_needed = 1;
opt.marginals_needed = 3;
opt.max_cert_depth = 5;
diff --git a/g10/main.h b/g10/main.h
index b2efaae3b..4eb1b5f31 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -26,11 +26,18 @@
#include "util.h"
/* It could be argued that the default cipher should be 3DES rather
- than CAST5, and the default compression should be 0
+ than AES128, and the default compression should be 0
(i.e. uncompressed) rather than 1 (zip). However, the real world
issues of speed and size come into play here. */
-#define DEFAULT_CIPHER_ALGO CIPHER_ALGO_CAST5
+#if GPG_USE_AES128
+# define DEFAULT_CIPHER_ALGO CIPHER_ALGO_AES
+#elif GPG_USE_CAST5
+# define DEFAULT_CIPHER_ALGO CIPHER_ALGO_CAST5
+#else
+# define DEFAULT_CIPHER_ALGO CIPHER_ALGO_3DES
+#endif
+
#define DEFAULT_DIGEST_ALGO DIGEST_ALGO_SHA1
#define DEFAULT_S2K_DIGEST_ALGO DIGEST_ALGO_SHA1
#ifdef HAVE_ZIP