openssl/include/openssl
Matt Caswell d9a7510747 Teach the RSA implementation about TLS RSA Key Transport
In TLSv1.2 a pre-master secret value is passed from the client to the
server encrypted using RSA PKCS1 type 2 padding in a ClientKeyExchange
message. As well as the normal formatting rules for RSA PKCA1 type 2
padding TLS imposes some additional rules about what constitutes a well
formed key. Specifically it must be exactly the right length and
encode the TLS version originally requested by the client (as opposed to
the actual negotiated version) in its first two bytes.

All of these checks need to be done in constant time and, if they fail,
then the TLS implementation is supposed to continue anyway with a random
key (and therefore the connection will fail later on). This avoids
padding oracle type attacks.

This commit implements this within the RSA padding code so that we keep
all the constant time padding logic in one place. A later commit will
remove it from libssl.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10411)
2019-12-05 16:12:18 +00:00
..
__DECC_INCLUDE_EPILOGUE.H Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
__DECC_INCLUDE_PROLOGUE.H Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
aes.h Deprecate the AES_ige_*() functions 2019-12-04 17:46:38 +00:00
asn1_mac.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
asn1.h include/openssl/asn1.h: Remove version dependent inclusion of <openssl/bn.h> 2019-11-07 11:37:25 +01:00
asn1err.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
asn1t.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
async.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
asyncerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
bio.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
bioerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
blowfish.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
bn.h Update the check surround the BN_zero() implementation 2019-11-07 11:37:25 +01:00
bnerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
buffer.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
buffererr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
camellia.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
cast.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
cmac.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
cmp_util.h Fix header file include guard names 2019-09-28 20:26:36 +02:00
cmp.h chunk 5 of CMP contribution to OpenSSL 2019-10-29 14:17:39 +00:00
cmperr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
cms.h PEM: constify PEM_write_ routines 2019-11-18 02:34:12 +01:00
cmserr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
comp.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
comperr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
conf_api.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
conf.h Add a .pragma directive for configuration files 2019-11-12 13:33:12 +01:00
conferr.h Add a .pragma directive for configuration files 2019-11-12 13:33:12 +01:00
core_names.h Teach the RSA implementation about TLS RSA Key Transport 2019-12-05 16:12:18 +00:00
core_numbers.h PROV BIO: add a BIO_vprintf() upcall, and a provider BIO library 2019-11-29 20:55:16 +01:00
core.h SERIALIZER: New API for serialization of objects through providers 2019-11-29 20:54:48 +01:00
crmf.h Fix header file include guard names 2019-09-28 20:26:36 +02:00
crmferr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
crypto.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
cryptoerr.h CORE: ossl_namemap_add_names(): new function to add multiple names 2019-11-29 20:42:12 +01:00
ct.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
cterr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
des.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
dh.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
dherr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
dsa.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
dsaerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
dtls1.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
e_os2.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
ebcdic.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
ec.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
ecdh.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
ecdsa.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
ecerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
engine.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
engineerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
err.h SERIALIZER: add support for serializing EVP_PKEYs 2019-11-29 20:55:16 +01:00
ess.h Fix header file include guard names 2019-09-28 20:26:36 +02:00
esserr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
evp.h Add missing EVP_PKEY_METHOD accessors for digestsign and digestverify 2019-11-17 08:27:06 +01:00
evperr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
fips_names.h Fix header file include guard names 2019-09-28 20:26:36 +02:00
hmac.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
idea.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
kdf.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
kdferr.h Deprecate ERR_load_KDF_strings() 2019-11-12 13:30:35 +01:00
lhash.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
macros.h Add the ability to supress deprecation warnings 2019-12-04 17:46:27 +00:00
md2.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
md4.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
md5.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
mdc2.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
modes.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
obj_mac.h Fix long name of some Microsoft objects 2019-10-03 08:24:38 +10:00
objects.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
objectserr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
ocsp.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
ocsperr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
opensslconf.h.in include/openssl/opensslconf.h.in: remove spurious HEADER_FILE_H definition 2019-11-07 11:37:25 +01:00
opensslv.h.in Cleanup include/openssl/opensslv.h.in 2019-11-08 16:12:57 +01:00
ossl_typ.h Reorganize public header files (part 2) 2019-09-28 20:26:36 +02:00
params.h Fix header file include guard names 2019-09-28 20:26:36 +02:00
pem2.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
pem.h PROV SERIALIZER: add common functionality to serialize keys 2019-11-29 20:55:16 +01:00
pemerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
pkcs7.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
pkcs7err.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
pkcs12.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
pkcs12err.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
provider.h Fix header file include guard names 2019-09-28 20:26:36 +02:00
rand_drbg.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
rand.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
randerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
rc2.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
rc4.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
rc5.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
ripemd.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
rsa.h Teach the RSA implementation about TLS RSA Key Transport 2019-12-05 16:12:18 +00:00
rsaerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
safestack.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
seed.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
serializer.h SERIALIZER: add support for serializing EVP_PKEYs 2019-11-29 20:55:16 +01:00
serializererr.h SERIALIZER: add support for serializing EVP_PKEYs 2019-11-29 20:55:16 +01:00
sha.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
srp.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
srtp.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
ssl2.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
ssl3.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
ssl.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
sslerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
stack.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
store.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
storeerr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
symhacks.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
tls1.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
trace.h OSSL_STORE: add tracing 2019-11-03 18:38:23 +01:00
ts.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
tserr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
txt_db.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
types.h PROV SERIALIZER: add support for writing RSA keys 2019-11-29 20:55:16 +01:00
ui.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
uierr.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
whrlpool.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
x509_vfy.h add X509_cmp_timeframe() including its documentation 2019-12-04 15:17:55 +00:00
x509.h add X509_cmp_timeframe() including its documentation 2019-12-04 15:17:55 +00:00
x509err.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
x509v3.h Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
x509v3err.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00