Home GnuPG
Diffusion GnuPG 7b6071a45fbf

gpg: Fix flaw in symmetric algorithm selection in mixed mode.

Description

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.

Backported-from-master: 6864bba78e76a1ff72aec140ae9f4e752454c463

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Jul 7 2020, 12:58 PM
Parents
rG34c9cfd3d772: po: Update Japanese Translation.
Branches
Unknown
Tags
Unknown