openssl/crypto
Viktor Dukhovni 06d1dc3fa9 Avoid type errors in EAI-related name check logic.
The incorrectly typed data is read only, used in a compare operation, so
neither remote code execution, nor memory content disclosure were possible.
However, applications performing certificate name checks were vulnerable to
denial of service.

The GENERAL_TYPE data type is a union, and we must take care to access the
correct member, based on `gen->type`, not all the member fields have the same
structure, and a segfault is possible if the wrong member field is read.

The code in question was lightly refactored with the intent to make it more
obviously correct.

Fixes CVE-2024-6119

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(cherry picked from commit 0890cd13d4)
2024-09-03 12:03:39 +02:00
..
aes enable AES-XTS optimization for AIX in 3.0 branch 2024-06-07 08:06:06 +02:00
aria
asn1 Fix unpredictible refcount handling of d2i functions 2024-08-16 10:09:24 +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 Avoid NULL pointer dereference 2024-07-08 21:56:27 +02:00
bn Copyright year updates 2024-06-04 16:25:21 +02:00
buffer
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 OSSL_CMP_validate_msg(): fix check such that OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR becomes usable again 2024-06-17 10:55:51 +02:00
cms Copyright year updates 2024-01-30 13:26:54 +00:00
comp Fix coverity 1493364 & 1493375: unchecked return value 2021-11-08 08:56:38 +10:00
conf Fix line continuation check in config parser 2024-07-16 21:33:50 +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 Make DH_check_pub_key() and DH_generate_key() safer yet 2023-11-06 07:54:30 +00:00
dsa Copyright year updates 2024-06-04 16:25:21 +02:00
dso Update copyright year 2021-12-14 14:41:27 +00:00
ec Check EC_GROUP_get0_order result before dereference 2024-07-01 10:04:36 +02:00
encode_decode Copyright year updates 2024-06-04 16:25:21 +02:00
engine Unlock only when lock was successful 2024-07-03 15:42:02 -04:00
err Add reason codes with the correct offset for two alerts 2024-05-14 15:29:08 +02:00
ess Copyright year updates 2024-06-04 16:25:21 +02:00
evp evp_get_digest/cipherbyname_ex(): Try to fetch if not found 2024-07-31 11:26:33 +02:00
ffc DH_check_pub_key() should not fail when setting result code 2023-10-11 16:23:06 +02:00
hmac
http Fix some invalid use of sscanf 2023-12-12 16:13:08 +00:00
idea Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
kdf
lhash Copyright year updates 2023-10-24 14:47:21 +01: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 Copyright year updates 2023-10-24 14:47:21 +01:00
objects Copyright year updates 2024-01-30 13:26:54 +00: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 x86_64-xlate.pl: Fix build with icx and nvc compilers 2023-11-24 17:22:34 +01:00
pkcs7 Fix possible double-free in pkcs7 add_attribute function 2024-07-08 12:26:34 +02:00
pkcs12 fix potential memory leak in PKCS12_add_key_ex() 2024-06-18 13:46:31 -04:00
poly1305 Copyright year updates 2024-01-30 13:26:54 +00:00
property Set down_load factor on hash table when culling items in doall 2024-07-16 07:32:48 -04:00
rand randfile.c: Fix the e_os.h include path 2024-08-19 12:37:42 +02: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 Fix coverity-1604666 2024-07-17 16:31:47 +02:00
seed Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:29:18 +11:00
sha Fix a few incorrect paths in some build.info files 2024-02-02 14:11:27 +01:00
siphash Update copyright year 2022-05-03 13:36:42 +01:00
sm2 Copyright year updates 2024-06-04 16:25:21 +02:00
sm3
sm4
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 Avoid type errors in EAI-related name check logic. 2024-09-03 12:03:39 +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
alphacpuid.pl
arm64cpuid.pl
arm_arch.h Copyright year updates 2023-10-24 14:47:21 +01:00
armcap.c Update copyright year 2022-10-11 13:20:27 +01:00
armv4cpuid.pl
asn1_dsa.c
bsearch.c
build.info Statically link legacy provider to evp_extra_test 2023-12-06 17:02:17 +01:00
c64xpluscpuid.pl
context.c docs: document that *_free(NULL) does nothing 2024-06-27 18:34:13 +02: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
cryptlib.c
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 Copyright year updates 2023-10-24 14:47:21 +01:00
getenv.c
ia64cpuid.S
info.c Update copyright year 2023-02-07 12:59:59 +01:00
init.c Copyright year updates 2024-06-04 16:25:21 +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 Add locking to CRYPTO_secure_used 2023-12-01 09:44:25 -05:00
mips_arch.h
o_dir.c
o_fopen.c
o_init.c
o_str.c OPENSSL_hexstr2buf_ex(): Handle zero-length input correctly 2024-07-02 20:14:42 +02:00
o_time.c
packet.c Update copyright year 2022-10-11 13:20:27 +01:00
param_build.c ossl-params: check length returned by strlen() 2023-12-12 19:58:47 +01:00
param_build_set.c Copyright year updates 2023-10-24 14:47:21 +01: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 Copyright year updates 2024-01-30 13:26:54 +00:00
pariscid.pl
passphrase.c Update copyright year 2022-03-15 13:52:58 +00:00
ppccap.c
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 Detect and prevent recursive config parsing 2023-12-30 09:10:59 -05:00
provider_core.c Copyright year updates 2024-06-04 16:25:21 +02:00
provider_local.h
provider_predefined.c
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
sparccpuid.S
sparcv9cap.c
sparse_array.c Coverity 1507376: Dereference after null check 2022-07-22 14:42:44 +02:00
threads_lib.c
threads_none.c
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
x86cpuid.pl