openssl/ssl
Benjamin Kaduk ee36b963ae Reuse extension_is_relevant() in should_add_extension()
At the core of things is the concept that each extension is only
defined in certain context(s) -- the ClientHello, EncryptedExtensions,
etc., and sometimes only for a specific protocol or protocol range;
we want to enforce that we only parse or generate extensions in the
context(s) for which they are defined.  There is some subtlety here,
in that the protocol version in use is not known when generating the
ClientHello (but it is known when the ClientHello extensions are
being parsed!), so the SSL_IS_TLS13() macro must be used with caution.
Nonetheless, by making assertions about whether we are acting in a
server role and whether the current context is (not) a ClientHello,
we can consolidate almost all of the logic for determining whether
an extension is permitted in a given protocol message, whether we
are generating or parsing that message.

The only logic that remains separate relates to generating the ClientHello,
as it depends on an external factor (the maximum permitted TLS version) that
is not defined in the parsing context.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2945)
2018-03-09 11:17:32 -06:00
..
record Remove OSSLzu, and fix the one place that used it. 2018-02-23 16:49:59 -05:00
statem Reuse extension_is_relevant() in should_add_extension() 2018-03-09 11:17:32 -06:00
bio_ssl.c Add comments to NULL func ptrs in bio_method_st 2017-12-18 07:04:48 +10:00
build.info
d1_lib.c More record layer conversions to use SSLfatal() 2017-12-08 16:42:02 +00:00
d1_msg.c
d1_srtp.c
methods.c
packet_locl.h
packet.c
pqueue.c
s3_cbc.c
s3_enc.c Tell the ciphers which DRBG to use for generating random bytes. 2018-02-28 21:20:01 +01:00
s3_lib.c Update copyright year 2018-02-13 13:59:25 +00:00
s3_msg.c Update copyright year 2018-02-13 13:59:25 +00:00
ssl_asn1.c ssl/ssl_asn1.c: resolve warnings in VC-WIN32 build, which allows to add /WX. 2017-11-13 10:58:21 +01:00
ssl_cert_table.h Add X448/Ed448 support to libssl 2018-03-05 11:39:20 +00:00
ssl_cert.c Update copyright years on all files merged since Jan 1st 2018 2018-01-09 05:49:01 +01:00
ssl_ciph.c Copyright update of more files that have changed this year 2018-01-19 13:34:03 +01:00
ssl_conf.c Update copyright year 2018-02-13 13:59:25 +00:00
ssl_err.c Add SSL/SSL_CTX_use_cert_and_key() 2018-03-09 10:28:04 -06:00
ssl_init.c In OPENSSL_init_ssl(), run the base ssl init before OPENSSL_init_crypto() 2017-12-08 16:08:39 +01:00
ssl_lib.c Give more information in the SSL_stateless return code 2018-03-09 11:37:58 +00:00
ssl_locl.h Add X448/Ed448 support to libssl 2018-03-05 11:39:20 +00:00
ssl_mcnf.c
ssl_rsa.c Add SSL/SSL_CTX_use_cert_and_key() 2018-03-09 10:28:04 -06:00
ssl_sess.c Consistent formatting for sizeof(foo) 2017-12-07 19:11:49 -05:00
ssl_stat.c Merge HRR into ServerHello 2017-12-14 15:06:37 +00:00
ssl_txt.c
ssl_utst.c
t1_enc.c Tell the ciphers which DRBG to use for generating random bytes. 2018-02-28 21:20:01 +01:00
t1_lib.c Add X448/Ed448 support to libssl 2018-03-05 11:39:20 +00:00
t1_trce.c Duplicate entries ssl_handshake_tbl trace entries... 2018-03-08 10:32:34 -05:00
tls13_enc.c Tell the ciphers which DRBG to use for generating random bytes. 2018-02-28 21:20:01 +01:00
tls_srp.c Convert remaining functions in statem_clnt.c to use SSLfatal() 2017-12-04 13:31:48 +00:00