s2n-tls icon indicating copy to clipboard operation
s2n-tls copied to clipboard

Versions are confusing

Open zz85 opened this issue 4 years ago • 0 comments

Problem:

There's a bunch of version properties and related API to get versions. They seem to returning version numbers but are they equal? Here's an attempt to demystify them.

client_hello_version/s2n_connection_get_client_hello_version() This currently returns version used to send client_hello. It has a maximum version of S2N_TLS12 as TLS 1.3 spec freezes the version as legacy. This currently also returns S2N_SSLv2 if the client had connected as a SSLv2 client even though it is capable of negotiating higher (eg. TLS10).

client_protocol_version/s2n_connection_get_client_protocol_version() This returns the highest supported version a client is willing to negotiate. This value can be higher than client_hello_version in the cases of SSLv2 and TLS 1.3 clients. For TLS 1.3, this version is derived after supported_versions extensions is processed.

server_protocol_version/s2n_connection_get_server_protocol_version() The highest supported version that the server is willing to negotiate.

actual_protocol_version/s2n_connection_get_actual_protocol_version() The actual version both the server is willing to negotiate. This is usually MIN(client_protocol_version, server_protocol_version).

Some things that aren't necessary obvious

  • record version (usually 1.0) but this is not exposed except for a sslv3 client_hello
  • legacy_client_hello_version - this is client_hello_version only if client_hello_version >= TLS 1.0, or can be calculate with MIN(client_protocol_version, S2N_TLS12)

Proposed Solution:

discuss.

zz85 avatar Apr 07 '20 23:04 zz85