openssl/crypto
sashan 6dacee485f RSA decoder should check also sanity of p, q, e, d ... with respect to n
This issue has been discovered by osss-fuzzer [1]. The test function decodes
RSA key created by fuzzer and calls EVP_PKEY_pairwise_check() which
proceeds to ossl_bn_miller_rabin_is_prime() check which takes too long
exceeding timeout (45secs).

The idea is to fix OSSL_DECODER_from_data() code path so invalid
RSA keys will be refused.

[1] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69134

Test case generated by the fuzzer is added.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25190)
2024-08-28 16:50:46 +02:00
..
aes
aria
asn1 When calling ASN1_item_i2d () check both returned length and allocated pointer 2024-08-20 11:45:14 +02:00
async
bf
bio that open brace { should be on the previous line 2024-07-22 06:55:35 -04:00
bn crypto: factorize to hex chars conversion code. 2024-08-07 19:25:10 +02:00
buffer
camellia
cast
chacha
cmac Add FIPS indicator to CMAC. 2024-07-31 09:04:17 +10:00
cmp open brace '{' following struct go on the same line 2024-07-22 06:55:35 -04:00
cms When calling ASN1_item_i2d () check both returned length and allocated pointer 2024-08-20 11:45:14 +02:00
comp
conf Fix line continuation check in config parser 2024-07-16 21:32:40 +02:00
crmf
ct
des that open brace { should be on the previous line 2024-07-22 06:55:35 -04:00
dh
dsa fix: drop DSA <=> dsaWithSHA1 aliasing 2024-07-12 11:20:23 +02:00
dso
ec FIPS: Add EDDSA public key validation. 2024-08-23 21:23:53 +02:00
encode_decode
engine convert users of build time defaults to use new defaults api 2024-07-09 04:01:44 -04:00
err feat: Implement EVP_CIPHER_CTX_{set,get}_algor_params() and EVP_CIPHER_CTX_get_algor() 2024-08-27 13:56:28 +02:00
ess
evp fix coding style 2024-08-27 13:56:28 +02:00
ffc
hashtable ossl_ht_insert(): Allow for 4 iterations of grow_hashtable() 2024-08-22 14:52:43 +02:00
hmac s390x: Fix memory leak in s390x_HMAC_CTX_copy() 2024-08-23 09:11:01 +02:00
hpke open brace '{' following struct go on the same line 2024-07-22 06:55:35 -04:00
http
idea that open brace { should be on the previous line 2024-07-22 06:55:35 -04:00
kdf
lhash
md2
md4
md5
mdc2
modes
objects fix: alias auditEntity OID 2024-08-26 10:38:44 +01:00
ocsp
pem Remove trailing whitespace 2024-07-22 06:55:35 -04:00
perlasm MASM: Need to strip arguments after .pdata or .xdata 2024-06-26 12:03:45 +02:00
pkcs7 When calling ASN1_item_i2d () check both returned length and allocated pointer 2024-08-20 11:45:14 +02:00
pkcs12 Implementation of the RFC 9579, PBMAC1 in PKCS#12 2024-08-07 10:00:16 +02:00
poly1305
property Set down_load factor on hash table when culling items in doall 2024-07-16 06:05:14 -04:00
rand Explicitly include e_os.h for close() 2024-08-19 12:27:41 +02:00
rc2
rc4
rc5
ripemd
rsa RSA decoder should check also sanity of p, q, e, d ... with respect to n 2024-08-28 16:50:46 +02:00
seed
sha Prefer ARRAY_SIZE(...) 2024-07-22 06:55:35 -04:00
siphash
sm2
sm3 riscv: Fix cpuid_obj asm checks for sm4/sm3 2024-07-12 11:09:02 +01:00
sm4 that open brace { should be on the previous line 2024-07-22 06:55:35 -04:00
srp
stack
store Prefer ARRAY_SIZE(...) 2024-07-22 06:55:35 -04:00
thread
ts Replace and Deprecate TS_VERIFY_CTX Functions 2024-07-10 09:39:53 +02:00
txt_db
ui
whrlpool
x509 feat: add support for issuedOnBehalfOf X.509v3 extension 2024-08-27 16:48:57 +02:00
alphacpuid.pl
arm64cpuid.pl
arm_arch.h
armcap.c
armv4cpuid.pl
asn1_dsa.c
bsearch.c
build.info Add FIPS indicator callback. 2024-07-11 08:29:43 +10:00
c64xpluscpuid.pl
comp_methods.c
context.c Add FIPS indicator callback. 2024-07-11 08:29:43 +10:00
core_algorithm.c
core_fetch.c
core_namemap.c core_namemap.c: 2048 hashtable buckets should be sufficient 2024-08-21 15:21:26 +02:00
cpt_err.c Use the new hashtable for core_namemap 2024-08-21 15:21:26 +02:00
cpuid.c
cryptlib.c
ctype.c
cversion.c Allow OPENSSLDIR/ENGINESDIR/MODULESDIR to be NULL 2024-07-09 04:01:44 -04:00
defaults.c Fix typos found by codespell 2024-08-07 19:09:43 +02:00
der_writer.c
deterministic_nonce.c
dllmain.c
ebcdic.c
ex_data.c
getenv.c
ia64cpuid.S
indicator_core.c Add FIPS indicator callback. 2024-07-11 08:29:43 +10:00
info.c JITTER: implement error handling from jitter library 2024-07-31 14:44:51 +10:00
init.c
initthread.c
loongarch64cpuid.pl
loongarch_arch.h
loongarchcap.c
LPdir_nyi.c
LPdir_unix.c
LPdir_vms.c
LPdir_win32.c
LPdir_win.c
LPdir_wince.c
mem_clr.c
mem_sec.c open brace '{' following struct go on the same line 2024-07-22 06:55:35 -04:00
mem.c
mips_arch.h
o_dir.c
o_fopen.c o_fopen: fix coding style and build error with VS2010 2024-07-12 11:23:56 +01:00
o_init.c
o_str.c crypto: factorize to hex chars conversion code. 2024-08-07 19:25:10 +02:00
o_time.c
packet.c
param_build_set.c
param_build.c
params_dup.c
params_from_text.c
params_idx.c.in
params.c
pariscid.pl
passphrase.c
ppccap.c
ppccpuid.pl
provider_child.c
provider_conf.c
provider_core.c Add FIPS indicator callback. 2024-07-11 08:29:43 +10:00
provider_local.h
provider_predefined.c
provider.c
punycode.c
quic_vlint.c
rcu_internal.h
README-sparse_array.md
riscv32cpuid.pl
riscv64cpuid.pl
riscvcap.c
s390x_arch.h s390x: Add hardware acceleration for HMAC 2024-08-19 18:23:35 +02:00
s390xcap.c
s390xcpuid.pl
self_test_core.c open brace '{' following struct go on the same line 2024-07-22 06:55:35 -04:00
sleep.c
sparccpuid.S
sparcv9cap.c
sparse_array.c
threads_lib.c
threads_none.c threads_win: fix build error with VS2010 x86 2024-07-01 10:02:02 +02:00
threads_pthread.c disable rwlocks on nonstop klt model 2024-07-31 08:05:53 -04:00
threads_win.c Fix typing on call to interlockedExchange for windows 2024-08-11 08:23:19 -04:00
time.c
trace.c
uid.c
vms_rms.h
x86_64cpuid.pl
x86cpuid.pl