mbedtls/programs/ssl
Hanno Becker 473f98f2e0 Introduce ciphersuite handle type
This commit introduces an internal zero-cost abstraction layer for
SSL ciphersuites: Instead of addressing ciphersuites via pointers
to instances of mbedtls_ssl_ciphersuite_t and accessing their fields
directly, this commit introduces an opaque type

  mbedtls_ssl_ciphersuite_handle_t,

and getter functions

  mbedtls_ssl_suite_get_xxx()

operating on ciphersuite handles.

The role of NULL is played by a new macro constant

  MBEDTLS_SSL_CIPHERSUITE_INVALID_HANDLE

which results of functions returning handles can be checked against.
(For example, when doing a lookup of a ciphersuite from a peer-provided
ciphersuite ID in the per's Hello message).

The getter functions have the validity of the handle as a precondition
and are undefined if the handle is invalid.

So far, there's only one implementation of this abstraction layer, namely

  mbedtls_ssl_ciphersuite_handle_t being mbedtls_ssl_ciphersuite_t const *

and

  getter functions being field accesses.

In subsequent commits, however, the abstraction layer will be useful
to save code in the situation where only a single ciphersuite is enabled.
2019-07-08 11:17:53 +01:00
..
CMakeLists.txt Improve cmake inclusion of query_config.c when building apps 2019-02-07 10:32:31 +00:00
dtls_client.c Allow compile-time configuration of timer callbacks 2019-07-04 10:29:44 +01:00
dtls_server.c Allow compile-time configuration of timer callbacks 2019-07-04 10:29:44 +01:00
mini_client.c Allow compile-time configuration of I/O function pointers 2019-07-04 10:28:55 +01:00
query_config.c Allow compile-time configuration of timer callbacks 2019-07-04 10:29:44 +01:00
ssl_client1.c Merge branch 'mbedtls-2.16' into baremetal-2.16-01_07_19 2019-07-01 11:25:42 +01:00
ssl_client2.c Introduce ciphersuite handle type 2019-07-08 11:17:53 +01:00
ssl_fork_server.c Merge branch 'mbedtls-2.16' into baremetal-2.16-01_07_19 2019-07-01 11:25:42 +01:00
ssl_mail_client.c Merge branch 'mbedtls-2.16' into baremetal-2.16-01_07_19 2019-07-01 11:25:42 +01:00
ssl_pthread_server.c Merge branch 'mbedtls-2.16' into baremetal-2.16-01_07_19 2019-07-01 11:25:42 +01:00
ssl_server.c Merge remote-tracking branch 'restricted/pr/608' into baremetal-proposed 2019-07-03 10:31:46 +02:00
ssl_server2.c Introduce ciphersuite handle type 2019-07-08 11:17:53 +01:00