1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

gpg: Change default cipher for --symmetric from CAST5 to AES-128.

* g10/main.h (DEFAULT_CIPHER_ALGO): Change to AES or CAST5 or 3DES
depending on configure options.
* g10/gpg.c (main): Set opt.s2k_cipher_algo to DEFAULT_CIPHER_ALGO.

--

(cherry picked from commit 57df1121c18b004dd763b35eabf7b51fc9e8ec38)
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2014-08-18 11:45:00 +02:00
parent 751b287179
commit fc30a414d8
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
3 changed files with 11 additions and 8 deletions

View File

@ -11,7 +11,7 @@
@c Begin algorithm defaults @c Begin algorithm defaults
@set DEFSYMENCALGO CAST5 @set DEFSYMENCALGO AES128
@c End algorithm defaults @c End algorithm defaults

View File

@ -1883,11 +1883,7 @@ main (int argc, char **argv )
opt.compress_algo = -1; /* defaults to DEFAULT_COMPRESS_ALGO */ opt.compress_algo = -1; /* defaults to DEFAULT_COMPRESS_ALGO */
opt.s2k_mode = 3; /* iterated+salted */ opt.s2k_mode = 3; /* iterated+salted */
opt.s2k_count = 96; /* 65536 iterations */ opt.s2k_count = 96; /* 65536 iterations */
#ifdef USE_CAST5 opt.s2k_cipher_algo = DEFAULT_CIPHER_ALGO;
opt.s2k_cipher_algo = CIPHER_ALGO_CAST5;
#else
opt.s2k_cipher_algo = CIPHER_ALGO_3DES;
#endif
opt.completes_needed = 1; opt.completes_needed = 1;
opt.marginals_needed = 3; opt.marginals_needed = 3;
opt.max_cert_depth = 5; opt.max_cert_depth = 5;

View File

@ -26,11 +26,18 @@
#include "keydb.h" #include "keydb.h"
/* It could be argued that the default cipher should be 3DES rather /* 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 (i.e. uncompressed) rather than 1 (zip). However, the real world
issues of speed and size come into play here. */ issues of speed and size come into play here. */
#define DEFAULT_CIPHER_ALGO CIPHER_ALGO_CAST5 #if USE_AES
# define DEFAULT_CIPHER_ALGO CIPHER_ALGO_AES
#elif 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_DIGEST_ALGO DIGEST_ALGO_SHA1
#define DEFAULT_COMPRESS_ALGO COMPRESS_ALGO_ZIP #define DEFAULT_COMPRESS_ALGO COMPRESS_ALGO_ZIP
#define DEFAULT_S2K_DIGEST_ALGO DIGEST_ALGO_SHA1 #define DEFAULT_S2K_DIGEST_ALGO DIGEST_ALGO_SHA1