Home GnuPG
Diffusion GnuPG 72e3fddbfe7b

gpg: Force the use of AES-256 in some cases

Description

gpg: Force the use of AES-256 in some cases

* g10/encrypt.c (create_dek_with_warnings): Forcefully use AES-256 if
PQC encryption was required or if all recipient keys are Kyber keys.

If --require-pqc-encryption was set, then it should be safe to always
force AES-256, without even checking if we are encrypting to Kyber keys
(if some recipients do not have Kyber keys, --require-pqc-encryption
will fail elsewhere).

Otherwise, we force AES-256 if we encrypt *only* to Kyber keys -- unless
the user explicitly requested another algo, in which case we assume they
know what they are doing.

Man page entry extended

  • GnuPG-bug-id: T7472
  • Signed-off-by: Werner Koch <wk@gnupg.org>