zephyr/tests/net/socket/tls_configurations/testcase.yaml
Valerio Setti 91fa8a2b63 tests: net: socket_tls: test different TLS configurations with sockets
This commit adds a test to showcase how to configure TLS 1.2 and 1.3
socket connections against an OpenSSL server. Only a limited number
of combinations are available for now:

- TLS 1.2
	- RSA certificate and key exchange.
	- ECDSA certificate and ECDHE key exchange.

- TLS 1.3 only supports ephemeral (ECDHE) key exchange with/without
  session tickets.

Since the goal is to test TLS connection and not low level ethernet
functionalities or similar, the only supported platform is "native_sim"
where Linux sockets are used to connect to the OpenSSL server locally.

The idea is that the Zephyr application acts a client and tries to connect
to the OpenSSL server running on the same PC. For sake of simplificity a
bash script is provided to start the OpenSSL server properly.
For completeness a bash script is also provided to re-generate
certificates and keys.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-09-12 13:31:20 -04:00

54 lines
1.8 KiB
YAML

common:
tags:
- crypto.mbedtls
- net.socket
platform_allow:
- native_sim
- native_sim/native/64
integration_platforms:
- native_sim
harness: pytest
tests:
net.sockets.tls12.rsa_kex:
extra_args:
- EXTRA_CONF_FILE=overlay-tls12.conf;overlay-rsa.conf
extra_configs:
- CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_ENABLED=y
- CONFIG_SERVER_PORT=4000
harness_config:
pytest_args: ["--server-type", "1.2-rsa", "--port", "4000"]
net.sockets.tls12.ec_kex:
extra_args:
- EXTRA_CONF_FILE=overlay-tls12.conf;overlay-ec.conf
extra_configs:
- CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED=y
- CONFIG_SERVER_PORT=4001
harness_config:
pytest_args: ["--server-type", "1.2-ec", "--port", "4001"]
net.sockets.tls13.ephemeral_kex:
extra_args:
- EXTRA_CONF_FILE=overlay-tls13.conf;overlay-ec.conf
extra_configs:
- CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED=y
- CONFIG_SERVER_PORT=4002
harness_config:
pytest_args: ["--server-type", "1.3-ephemeral", "--port", "4002"]
net.sockets.tls13.ephemeral_kex.tickets:
extra_args:
- EXTRA_CONF_FILE=overlay-tls13.conf;overlay-ec.conf
extra_configs:
- CONFIG_MBEDTLS_TLS_SESSION_TICKETS=y
- CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED=y
- CONFIG_SERVER_PORT=4003
harness_config:
pytest_args: ["--server-type", "1.3-ephemeral-tickets", "--port", "4003"]
net.sockets.tls13.psk_kex.tickets:
extra_args:
- EXTRA_CONF_FILE=overlay-tls13.conf
extra_configs:
- CONFIG_MBEDTLS_TLS_SESSION_TICKETS=y
- CONFIG_MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED=y
- CONFIG_SERVER_PORT=4004
harness_config:
pytest_args: ["--server-type", "1.3-psk-tickets", "--port", "4004"]