aws / s2n-tls

An implementation of the TLS/SSL protocols
https://aws.github.io/s2n-tls/usage-guide/
Apache License 2.0
4.49k stars 704 forks source link

">= S2N_TLSX" vs "== S2N_TLSX" #1681

Open lrstewart opened 4 years ago

lrstewart commented 4 years ago

Problem:

Our code currently uses a mix of ">= S2N_TLS13" and "== S2N_TLS13" checks. I would like to argue for switching all of the "=="s over to ">=": I believe "==" is shortsighted and will inevitably cause future developers pain.

When implementing TLS1.3, we have repeatedly run into problems because of "== S2N_TLS12" checks. We expect TLS1.3 code to behave like TLS1.2 code unless we specify otherwise, not like TLS1.1 code. Code regressing to pre-TLS1.2 because we raise the protocol version causes unexpected and sometimes difficult to diagnose issues (and could unexpectedly re-introduce vulnerabilities). It is unintuitive for code to default to the oldest implementation instead of the newest implementation. When we add a hypothetical TLS1.4, it is FAR more likely to build off of TLS1.3 than off of TLS1.1 or TLS1.0.

Examples of pain with "== S2N_TLS12":

Proposed Solution:

lrstewart commented 4 years ago

Note: we should also check for "!= S2N_TLSX".