openssl/test/recipes/30-test_evp_data
Hubert Kario 7fc67e0a33 rsa: add implicit rejection in PKCS#1 v1.5
The RSA decryption as implemented before required very careful handling
of both the exit code returned by OpenSSL and the potentially returned
ciphertext. Looking at the recent security vulnerabilities
(CVE-2020-25659 and CVE-2020-25657) it is unlikely that most users of
OpenSSL do it correctly.

Given that correct code requires side channel secure programming in
application code, we can classify the existing RSA decryption methods
as CWE-676, which in turn likely causes CWE-208 and CWE-385 in
application code.

To prevent that, we can use a technique called "implicit rejection".
For that we generate a random message to be returned in case the
padding check fails. We generate the message based on static secret
data (the private exponent) and the provided ciphertext (so that the
attacker cannot determine that the returned value is randomly generated
instead of result of decryption and de-padding). We return it in case
any part of padding check fails.

The upshot of this approach is that then not only is the length of the
returned message useless as the Bleichenbacher oracle, so are the
actual bytes of the returned message. So application code doesn't have
to perform any operations on the returned message in side-channel free
way to remain secure against Bleichenbacher attacks.

Note: this patch implements a specific algorithm, shared with Mozilla
NSS, so that the attacker cannot use one library as an oracle against the
other in heterogeneous environments.

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13817)
2022-12-12 11:30:52 +01:00
..
evpciph_aes_ccm_cavs.txt Update copyright year 2022-05-03 13:34:51 +01:00
evpciph_aes_common.txt
evpciph_aes_cts.txt
evpciph_aes_gcm_siv.txt aes: add AES-GCM-SIV modes to the FIPS provider 2022-11-30 07:50:33 +11:00
evpciph_aes_ocb.txt AES OCB test vectors 2022-07-05 10:10:24 +02:00
evpciph_aes_siv.txt
evpciph_aes_stitched.txt Fix the RC4-MD5 cipher 2022-05-03 10:46:49 +01:00
evpciph_aes_wrap.txt
evpciph_aria.txt
evpciph_bf.txt
evpciph_camellia_cts.txt
evpciph_camellia.txt
evpciph_cast5.txt
evpciph_chacha.txt
evpciph_des3_common.txt TDES: fix test with old FIPS provider 2022-09-16 08:34:52 +10:00
evpciph_des.txt
evpciph_idea.txt
evpciph_rc2.txt
evpciph_rc4_stitched.txt Fix the RC4-MD5 cipher 2022-05-03 10:46:49 +01:00
evpciph_rc4.txt
evpciph_rc5.txt
evpciph_seed.txt
evpciph_sm4.txt test: add sm4 xts test cases 2022-11-29 16:17:30 +01:00
evpencod.txt
evpkdf_hkdf.txt
evpkdf_hmac_drbg.txt Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
evpkdf_kbkdf_counter.txt
evpkdf_krb5.txt
evpkdf_pbkdf1.txt
evpkdf_pbkdf2.txt add tests for PBKDF2 with SHA-3 2022-05-18 17:08:48 +02:00
evpkdf_pvkkdf.txt
evpkdf_scrypt.txt
evpkdf_ss.txt
evpkdf_ssh.txt
evpkdf_tls11_prf.txt
evpkdf_tls12_prf.txt
evpkdf_tls13_kdf.txt
evpkdf_x942_des.txt
evpkdf_x942.txt
evpkdf_x963.txt
evpmac_blake.txt
evpmac_cmac_des.txt
evpmac_common.txt Update fips version check to be more robust 2022-11-30 07:51:02 +11:00
evpmac_poly1305.txt Update copyright year 2022-05-03 13:34:51 +01:00
evpmac_siphash.txt
evpmac_sm3.txt feat: add hmac-sm3 test cases from GM/T 0042-2015 Appendix D.3 2022-07-11 10:59:20 +10:00
evpmd_blake.txt
evpmd_md.txt
evpmd_mdc2.txt
evpmd_ripemd.txt default provider: include RIPEMD160 2022-10-19 13:21:01 +02:00
evpmd_sha.txt
evpmd_sm3.txt
evpmd_whirlpool.txt
evppbe_pbkdf2.txt add tests for PBKDF2 with SHA-3 2022-05-18 17:08:48 +02:00
evppbe_pkcs12.txt
evppbe_scrypt.txt
evppkey_brainpool.txt
evppkey_dh.txt
evppkey_dsa_rfc6979.txt [test/recipes] Add RFC6979 deterministic DSA KATs in evptest format 2022-11-30 07:31:54 +00:00
evppkey_dsa.txt
evppkey_ecc.txt
evppkey_ecdh.txt
evppkey_ecdsa_rfc6979.txt [test/recipes] Add RFC6979 deterministic DSA KATs in evptest format 2022-11-30 07:31:54 +00:00
evppkey_ecdsa.txt Testcase for regression by PPC64 fixed length montgomery multiplication 2022-06-15 09:54:02 +02:00
evppkey_ecx.txt
evppkey_ffdhe.txt Fix default padding regression against 3.0.0 FIPS provider 2022-09-16 08:34:52 +10:00
evppkey_kas.txt
evppkey_kdf_hkdf.txt
evppkey_kdf_scrypt.txt
evppkey_kdf_tls1_prf.txt
evppkey_mismatch.txt
evppkey_rsa_common.txt rsa: add implicit rejection in PKCS#1 v1.5 2022-12-12 11:30:52 +01:00
evppkey_rsa.txt
evppkey_sm2.txt
evprand.txt