mbedtls/tests
Hanno Becker fadbdbb576 Store TLS version in SSL session structure
Instances of `mbedtls_ssl_session` represent data enabling session resumption.

With the introduction of TLS 1.3, the format of this data changes. We therefore
need TLS-version field as part of `mbedtlsl_ssl_session` which allows distinguish
1.2 and 1.3 sessions.

This commit introduces such a TLS-version field to mbedtls_ssl_session.

The change has a few ramifications:

- Session serialization/deserialization routines need to be adjusted.

  This is achieved by adding the TLS-version after the header of
  Mbed TLS version+config, and by having the subsequent structure
  of the serialized data depend on the value of this field.

  The details are described in terms of the RFC 8446 presentation language.

  The 1.2 session (de)serialization are moved into static helper functions,
  while the top-level session (de)serialization only parses the Mbed TLS
  version+config header and the TLS-version field, and dispatches according
  to the found version.

  This way, it will be easy to add support for TLS 1.3 sessions in the future.

- Tests for session serialization need to be adjusted

- Once we add support for TLS 1.3, with runtime negotiation of 1.2 vs. 1.3,
  we will need to have some logic comparing the TLS version of the proposed session
  to the negotiated TLS version. For now, however, we only support TLS 1.2,
  and no such logic is needed. Instead, we just store the TLS version in the
  session structure at the same point when we populate mbedtls_ssl_context.minor_ver.

The change introduces some overlap between `mbedtls_ssl_session.minor_ver` and
`mbedtls_ssl_context.minor_ver`, which should be studied and potentially resolved.
However, with both fields being private and explicitly marked so, this can happen
in a later change.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-07-23 06:25:48 +01:00
..
.jenkins
configs Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
data_files Removal of RC4 certs and fixes to docs and tests 2021-06-21 13:27:29 +02:00
docker/bionic
git-scripts Remove Git pre-commit hook 2021-05-20 10:37:22 +02:00
include Rename function to conform to the library 2021-06-29 17:06:33 +02:00
scripts Speed up the generation of storage format test cases 2021-07-07 12:47:47 +02:00
src Merge pull request #4739 from gabor-mezei-arm/3258_fp30_implement_one-shot_MAC_and_cipher 2021-06-30 17:04:23 +01:00
suites Store TLS version in SSL session structure 2021-07-23 06:25:48 +01:00
.gitignore Ignore generated source files that are no longer checked in 2021-05-20 10:37:22 +02:00
CMakeLists.txt Remove MD2, MD4, RC4, Blowfish and XTEA 2021-06-16 10:34:25 +02:00
compat-in-docker.sh
compat.sh Rename config.h to mbedtls_config.h 2021-06-28 09:28:33 +01:00
context-info.sh Modifies tests in context-info.sh 2021-06-16 16:19:53 +01:00
Descriptions.txt
make-in-docker.sh
Makefile Don't make configuration-independent files depend on config.h 2021-05-20 10:37:22 +02:00
ssl-opt-in-docker.sh
ssl-opt.sh Merge pull request #4724 from hanno-arm/ssl_hs_parse_error_3_0 2021-06-30 09:02:55 +01:00