summaryrefslogtreecommitdiffstats
path: root/g10/passphrase.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-07-07 12:58:29 +0200
committerWerner Koch <wk@gnupg.org>2020-07-07 12:58:29 +0200
commit6864bba78e76a1ff72aec140ae9f4e752454c463 (patch)
tree237ee31079d3ce0fee59ae6bc3bce1b67738dda0 /g10/passphrase.c
parentsm: Exclude rsaPSS from de-vs compliance mode. (diff)
downloadgnupg2-6864bba78e76a1ff72aec140ae9f4e752454c463.tar.xz
gnupg2-6864bba78e76a1ff72aec140ae9f4e752454c463.zip
gpg: Fix flaw in symmetric algorithm selection in mixed mode.
* g10/encrypt.c (setup_symkey): Use default_cipher_algo function instead of the fallback s2k_cipher_algo. Fix error code. (encrypt_simple): Use setup_symkey. -- Aside of removing code duplication this patch fixes the flaw that the S2K cipher algorithm was used when mixing public key and symmetric encryption or signatures with symmetric encrypion. The default_algorithm function should be used here so that the command line option --cipher-algo and --personal-cipher-preferences have an effect. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/passphrase.c')
-rw-r--r--g10/passphrase.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c
index 54a183e54..7c2e34cc9 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -268,7 +268,7 @@ passphrase_to_dek (int cipher_algo, STRING2KEY *s2k,
*canceled = 0;
if (opt.no_symkey_cache)
- nocache = 1; /* Force no symmtric key caching. */
+ nocache = 1; /* Force no symmetric key caching. */
if ( !s2k )
{