diff options
author | Werner Koch <[email protected]> | 2020-07-07 10:58:29 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-07-07 10:58:29 +0000 |
commit | 6864bba78e76a1ff72aec140ae9f4e752454c463 (patch) | |
tree | 237ee31079d3ce0fee59ae6bc3bce1b67738dda0 /g10/main.h | |
parent | sm: Exclude rsaPSS from de-vs compliance mode. (diff) | |
download | gnupg-6864bba78e76a1ff72aec140ae9f4e752454c463.tar.gz gnupg-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 <[email protected]>
Diffstat (limited to 'g10/main.h')
-rw-r--r-- | g10/main.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/g10/main.h b/g10/main.h index dedd60e73..f7f6d0dd1 100644 --- a/g10/main.h +++ b/g10/main.h @@ -234,7 +234,7 @@ int cpr_get_answer_okay_cancel (const char *keyword, void display_online_help( const char *keyword ); /*-- encode.c --*/ -int setup_symkey (STRING2KEY **symkey_s2k,DEK **symkey_dek); +gpg_error_t setup_symkey (STRING2KEY **symkey_s2k,DEK **symkey_dek); gpg_error_t encrypt_seskey (DEK *dek, aead_algo_t aead_algo, DEK **r_seskey, void **r_enckey, size_t *r_enckeylen); aead_algo_t use_aead (pk_list_t pk_list, int algo); |