openssl/ssl
Benjamin Kaduk a87f3fe01a Fix NULL dereference in SSL_check_chain() for TLS 1.3
In the tls1_check_sig_alg() helper function, we loop through the list of
"signature_algorithms_cert" values received from the client and attempt
to look up each one in turn in our internal table that maps wire
codepoint to string-form name, digest and/or signature NID, etc., in
order to compare the signature scheme from the peer's list against what
is used to sign the certificates in the certificate chain we're
checking.  Unfortunately, when the peer sends a value that we don't
support, the lookup returns NULL, but we unconditionally dereference the
lookup result for the comparison, leading to an application crash
triggerable by an unauthenticated client.

Since we will not be able to say anything about algorithms we don't
recognize, treat NULL return from lookup as "does not match".

We currently only apply the "signature_algorithm_cert" checks on TLS 1.3
connections, so previous TLS versions are unaffected.  SSL_check_chain()
is not called directly from libssl, but may be used by the application
inside a callback (e.g., client_hello or cert callback) to verify that a
candidate certificate chain will be acceptable to the client.

CVE-2020-1967

Reviewed-by: Matt Caswell <matt@openssl.org>
2020-04-21 13:32:35 +01:00
..
record Use a fetched MD if appropriate in ssl3_cbc_digest_record 2020-04-20 11:29:31 +01:00
statem Make sure we always send an alert in libssl if we hit a fatal error 2020-04-15 11:38:33 +01:00
bio_ssl.c Reorganize local header files 2019-09-28 20:26:35 +02:00
build.info If we are multiblock capable make sure we use it 2019-08-14 11:04:09 +01:00
d1_lib.c Reorganize local header files 2019-09-28 20:26:35 +02:00
d1_msg.c Reorganize local header files 2019-09-28 20:26:35 +02:00
d1_srtp.c Reorganize local header files 2019-09-28 20:26:35 +02:00
methods.c Update some inclusions of <openssl/macros.h> 2019-11-07 11:37:25 +01:00
pqueue.c Reorganize local header files 2019-09-28 20:26:35 +02:00
s3_cbc.c Use a fetched MD if appropriate in ssl3_cbc_digest_record 2020-04-20 11:29:31 +01:00
s3_enc.c Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
s3_lib.c Use the libctx for all EVP_PKEY_CTX operations 2020-04-19 14:40:55 +01:00
s3_msg.c Reorganize local header files 2019-09-28 20:26:35 +02:00
ssl_asn1.c Explicitly test against NULL; do not use !p or similar 2019-10-09 21:32:15 +02:00
ssl_cert_table.h Following the license change, modify the boilerplates in ssl/ 2018-12-06 14:20:59 +01:00
ssl_cert.c Use X509_STORE_CTX_new_with_libctx() in libssl 2020-04-08 23:56:29 +01:00
ssl_ciph.c TLS Cipher Suite 0xC102 Support 2020-04-02 18:01:41 +03:00
ssl_conf.c X509_LOOKUP_store: new X509_LOOKUP_METHOD that works by OSSL_STORE URI 2019-11-03 18:38:23 +01:00
ssl_err.c Use a fetched version of SHA256 in tls_process_new_session_ticket() 2020-03-24 16:13:59 +00:00
ssl_init.c Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
ssl_lib.c Ensure libssl uses the new library context aware CT code 2020-04-09 14:51:48 +01:00
ssl_local.h Use a fetched MD if appropriate in ssl3_cbc_digest_record 2020-04-20 11:29:31 +01:00
ssl_mcnf.c Reorganize local header files 2019-09-28 20:26:35 +02:00
ssl_rsa.c Make sure we use the libctx in libssl when loading PrivateKeys 2020-04-15 11:24:13 +01:00
ssl_sess.c Make sure we use RAND_bytes_ex and RAND_priv_bytes_ex in libssl 2020-01-24 15:12:56 +00:00
ssl_stat.c Reorganize local header files 2019-09-28 20:26:35 +02:00
ssl_txt.c Explicitly fetch ciphers and digests in libssl 2020-02-06 11:59:07 +00:00
ssl_utst.c Reorganize local header files 2019-09-28 20:26:35 +02:00
t1_enc.c Use EVP_DigestSignInit_ex and EVP_DigestVerifyInit_ex in libssl 2020-04-01 17:28:56 +01:00
t1_lib.c Fix NULL dereference in SSL_check_chain() for TLS 1.3 2020-04-21 13:32:35 +01:00
t1_trce.c TLSEXT_SIGALG_gostr34102012 0x0840 and 0x0841 support 2020-04-16 18:29:17 +03:00
tls13_enc.c Use a fetched cipher for the TLSv1.3 early secret 2020-03-26 13:46:43 +00:00
tls_srp.c Update libssl to use the new library context aware SRP functions 2020-03-27 11:29:25 +00:00