openssl/crypto
Pauli 0df4063085 evp: process key length and iv length early if present
evp_cipher_init_internal() takes a params array argument and this is processed
late in the initialisation process for some ciphers (AEAD ones).

This means that changing the IV length as a parameter will either truncate the
IV (very bad if SP 800-38d section 8.2.1 is used) or grab extra uninitialised
bytes.

Truncation is very bad if SP 800-38d section 8.2.1 is being used to
contruct a deterministic IV.  This leads to an instant loss of confidentiality.

Grabbing extra bytes isn't so serious, it will most likely result in a bad
decryption.

Problem reported by Tony Battersby of Cybernetics.com but earlier discovered
and raised as issue #19822.

Fixes CVE-2023-5363
Fixes #19822

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 5f69f5c65e)
2023-10-24 14:35:55 +01:00
..
aes Don't use __ARMEL__/__ARMEB__ in aarch64 assembly 2023-10-05 20:04:29 +02:00
aria Update copyright year 2021-04-08 13:04:41 +01:00
asn1 Copyright year updates 2023-09-19 14:58:35 +02:00
async Update copyright year 2022-03-15 13:52:58 +00:00
bf Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
bio Update copyright year 2023-05-30 14:29:35 +02:00
bn BN_gcd(): Avoid shifts of negative values 2023-10-05 12:05:57 +02:00
buffer Update copyright year 2021-06-17 13:24:59 +01:00
camellia Rename x86-32 assembly files from .s to .S. 2022-05-24 13:17:03 +10:00
cast Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
chacha Fix ChaCha assembly code on 32-bit HPUX itanium systems 2023-08-09 12:23:06 +02:00
cmac Update copyright year 2022-06-21 14:03:39 +01:00
cmp Copyright year updates 2023-09-19 14:58:35 +02:00
cms cms_enc.c: Include crypto/asn1.h for struct asn1_object_st 2023-10-19 10:17:10 +02:00
comp Fix coverity 1493364 & 1493375: unchecked return value 2021-11-08 08:56:38 +10:00
conf OPENSSL_init_crypto load config into initial global default library context 2023-08-31 17:07:44 +02:00
crmf Fix the check of EVP_PKEY_decrypt_init 2022-12-05 13:06:00 +01:00
ct Update copyright year 2022-06-21 14:03:39 +01:00
des Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
dh DH_check_pub_key() should not fail when setting result code 2023-10-11 16:23:06 +02:00
dsa DH_check_pub_key() should not fail when setting result code 2023-10-11 16:23:06 +02:00
dso Update copyright year 2021-12-14 14:41:27 +00:00
ec Update copyright year 2023-05-30 14:29:35 +02:00
encode_decode Copyright year updates 2023-09-19 14:58:35 +02:00
engine Improved detection of engine-provided private "classic" keys 2023-10-04 11:03:15 +11:00
err CMS_add1_signer(): add missing ERR_raise() calls 2023-10-17 22:06:32 +02:00
ess err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
evp evp: process key length and iv length early if present 2023-10-24 14:35:55 +01:00
ffc DH_check_pub_key() should not fail when setting result code 2023-10-11 16:23:06 +02:00
hmac Adapt other parts of the source to the changed EVP_Q_digest() and EVP_Q_mac() 2021-06-23 23:00:36 +02:00
http OSSL_HTTP_{REQ_CTX_set_request_line(),_set1_request()}: backward compat w.r.t. path parameter 2023-08-10 17:30:16 +02:00
idea Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
kdf
lhash Fix error handling in lhash contract 2023-09-21 14:51:25 +02:00
md2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
md4 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
md5 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
mdc2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
modes Don't use __ARMEL__/__ARMEB__ in aarch64 assembly 2023-10-05 20:04:29 +02:00
objects fix: LINEAR search doesn't work properly (if CHARSET_EBCDIC is defined) 2023-10-18 16:40:19 +02:00
ocsp Update copyright year 2023-02-07 12:59:59 +01:00
pem Copyright year updates 2023-09-19 14:58:35 +02:00
perlasm Copyright year updates 2023-09-19 14:58:35 +02:00
pkcs7 Update copyright year 2023-02-07 12:59:59 +01:00
pkcs12 Copyright year updates 2023-09-19 14:58:35 +02:00
poly1305 Don't use __ARMEL__/__ARMEB__ in aarch64 assembly 2023-10-05 20:04:29 +02:00
property ossl_property_list_to_string: handle quoted strings 2023-10-05 08:10:19 +11:00
rand rand_lib: RAND_poll: Reseed in non-"no-deprecated" builds. 2023-06-14 09:03:55 +10:00
rc2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
rc4 Set RC4 defines on libcrypto/liblegacy 2023-06-10 13:02:11 +02:00
rc5 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
ripemd Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
rsa Dont require CRT params on ossl_rsa_set0_all_params 2023-10-18 18:11:57 +02:00
seed Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
sha Copyright year updates 2023-08-01 14:46:02 +01:00
siphash Update copyright year 2022-05-03 13:36:42 +01:00
sm2 Update copyright year 2023-05-30 14:29:35 +02:00
sm3 Add "origin" field to EVP_CIPHER, EVP_MD 2021-04-18 10:03:07 +02:00
sm4 Update copyright year 2021-04-08 13:04:41 +01:00
srp Copyright year updates 2023-09-19 14:58:35 +02:00
stack Errors raised from OPENSSL_sk_set should have ERR_LIB_CRYPTO 2022-10-21 18:03:37 +02:00
store Copyright year updates 2023-09-19 14:58:35 +02:00
ts ts: fix memleaks caused by TS_VERIFY_CTX_set_imprint 2021-08-26 11:06:06 +02:00
txt_db Update copyright year 2022-11-01 14:55:40 +01:00
ui Update copyright year 2023-05-30 14:29:35 +02:00
whrlpool Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
x509 Check i2d_X509_NAME return in X509_NAME_hash_ex/old 2023-08-16 10:47:42 +02:00
LPdir_nyi.c
LPdir_unix.c Copyright year updates 2023-08-01 14:46:02 +01:00
LPdir_vms.c
LPdir_win.c
LPdir_win32.c
LPdir_wince.c
README-sparse_array.md Fix many MarkDown issues in {NOTES*,README*,HACKING,LICENSE}.md files 2020-07-05 11:29:43 +02:00
alphacpuid.pl
arm64cpuid.pl Read MIDR_EL1 system register on aarch64 2020-12-09 16:17:17 +01:00
arm_arch.h Don't use __ARMEL__/__ARMEB__ in aarch64 assembly 2023-10-05 20:04:29 +02:00
armcap.c Update copyright year 2022-10-11 13:20:27 +01:00
armv4cpuid.pl
asn1_dsa.c Update copyright year 2021-04-08 13:04:41 +01:00
bsearch.c
build.info Do not include sparse_array.o in libssl 2023-09-22 20:41:38 +02:00
c64xpluscpuid.pl
context.c Release the drbg in the global default context before engines 2022-11-10 09:34:35 +01:00
core_algorithm.c "Reserve" the method store when constructing methods 2022-07-20 07:29:23 +01:00
core_fetch.c "Reserve" the method store when constructing methods 2022-07-20 07:29:23 +01:00
core_namemap.c Copyright year updates 2023-08-01 14:46:02 +01:00
cpt_err.c Have OSSL_PARAM_allocate_from_text() raise error on unexpected neg number 2021-11-24 19:21:41 +01:00
cpuid.c Refactor CPUID code 2021-04-02 16:39:13 +02:00
cryptlib.c crypto: remove TODOs 2021-06-02 16:30:15 +10:00
ctype.c tolower: refine the tolower code to avoid a memory access 2022-05-23 09:52:54 +10:00
cversion.c
der_writer.c Update copyright year 2022-07-05 10:33:12 +02:00
dllmain.c
ebcdic.c
ex_data.c Fix error handling in CRYPTO_get_ex_new_index 2023-09-21 14:47:37 +02:00
getenv.c Update copyright year 2020-10-15 14:10:06 +01:00
ia64cpuid.S
info.c Update copyright year 2023-02-07 12:59:59 +01:00
init.c init: fix defined but unused warning/error 2022-10-18 16:41:27 +02:00
initthread.c Avoid a race in init_thread_stop() 2021-11-15 14:22:41 +00:00
mem.c Windows: use srand() instead of srandom() 2023-10-13 15:09:31 +02:00
mem_clr.c
mem_sec.c Update copyright year 2023-02-07 12:59:59 +01:00
mips_arch.h
o_dir.c
o_fopen.c Update copyright year 2020-11-26 14:18:57 +00:00
o_init.c
o_str.c strcasecmp: implement strcasecmp and strncasecmp 2022-05-23 09:54:29 +10:00
o_time.c Update copyright year 2021-03-11 13:27:36 +00:00
packet.c Update copyright year 2022-10-11 13:20:27 +01:00
param_build.c Update copyright year 2023-02-07 12:59:59 +01:00
param_build_set.c ossl_param_build_set_multi_key_bn(): Do not set NULL BIGNUMs 2023-10-18 18:11:46 +02:00
params.c crypto/params: drop float for UEFI 2023-06-14 16:05:54 +02:00
params_dup.c Update copyright year 2022-05-03 13:36:42 +01:00
params_from_text.c Allow sign extension in OSSL_PARAM_allocate_from_text() 2021-11-24 19:21:41 +01:00
pariscid.pl
passphrase.c Update copyright year 2022-03-15 13:52:58 +00:00
ppccap.c enable getauxval on android 10 2021-06-25 18:31:05 +10:00
ppccpuid.pl
provider.c Correctly activate the provider in OSSL_PROVIDER_try_load 2021-11-15 14:22:41 +00:00
provider_child.c Update copyright year 2023-02-07 12:59:59 +01:00
provider_conf.c Correctly activate the provider in OSSL_PROVIDER_try_load 2021-11-15 14:22:41 +00:00
provider_core.c Copyright year updates 2023-09-19 14:58:35 +02:00
provider_local.h make struct provider_info_st a full type 2021-06-24 14:48:15 +01:00
provider_predefined.c make struct provider_info_st a full type 2021-06-24 14:48:15 +01:00
punycode.c Update copyright year 2022-11-01 14:55:40 +01:00
s390x_arch.h Update copyright year 2022-05-03 13:36:42 +01:00
s390xcap.c Update copyright year 2022-05-03 13:36:42 +01:00
s390xcpuid.pl
self_test_core.c Update copyright year 2021-05-20 14:22:33 +01:00
sparccpuid.S
sparcv9cap.c Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
sparse_array.c Coverity 1507376: Dereference after null check 2022-07-22 14:42:44 +02:00
threads_lib.c Fix no-threads 2020-12-14 10:45:27 +10:00
threads_none.c Update copyright year 2021-04-08 13:04:41 +01:00
threads_pthread.c Copyright year updates 2023-09-19 14:58:35 +02:00
threads_win.c Update copyright year 2023-05-30 14:29:35 +02:00
trace.c Update copyright year 2023-02-07 12:59:59 +01:00
uid.c Openssl fails to compile on Debian with kfreebsd kernels 2021-09-02 10:05:51 +10:00
vms_rms.h
x86_64cpuid.pl Update copyright year 2021-04-08 13:04:41 +01:00
x86cpuid.pl