1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-04-19 01:04:04 +03:00

1318 Commits

Author SHA1 Message Date
David Horstmann
232da48471
Merge pull request #9421 from mfil/feature/implement_tls_exporter
Implement TLS-Exporter
2025-04-17 14:47:13 +00:00
Manuel Pégourié-Gonnard
ed4a2b4f0a Merge branch 'development-restricted' into merge-from-restricted
* development-restricted:
  Add missing credit for set_hostname issue
  Add changelog entry for TLS 1.2 Finished fix
  TLS1.2: Check for failures in Finished calculation
  ssl_session_reset: preserve HOSTNAME_SET flag
  Document the need to call mbedtls_ssl_set_hostname
  Improve documentation of mbedtls_ssl_set_hostname
  Changelog entries for requiring mbedls_ssl_set_hostname() in TLS clients
  Add a note about calling mbedtls_ssl_set_hostname to mbedtls_ssl_setup
  mbedtls_ssl_set_hostname tests: add tests with CA callback
  Call mbedtls_ssl_set_hostname in the generic endpoint setup in unit tests
  Require calling mbedtls_ssl_set_hostname() for security
  Create error code for mbedtls_ssl_set_hostname not called
  Keep track of whether mbedtls_ssl_set_hostname() has been called
  Access ssl->hostname through abstractions in certificate verification
  mbedtls_ssl_set_hostname tests: baseline
  Add a flags field to mbedtls_ssl_context
  Automate MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK dependency
  Make guards more consistent between X.509-has-certs and SSL-has-certs
  Fix Doxygen markup
  Make ticket_alpn field private

 Conflicts:
	programs/ssl/ssl_test_common_source.c
2025-04-01 09:40:47 +02:00
Max Fillinger
d23579c746 Fix requirements for TLS 1.3 Exporter compat test
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:08:12 +01:00
Max Fillinger
4e21703bcf Add fixed compatibility test for TLS 1.3 Exporter
When testing TLS 1.3, use O_NEXT_CLI.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:08:12 +01:00
Max Fillinger
7b97712164 Remove exporter compatibility test for TLS 1.3
The openssl version in the docker image doesn't support TLS 1.3, so we
can't run the test.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:08:12 +01:00
Max Fillinger
6d53a3a647 Fix openssl s_client invocation
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:08:12 +01:00
Max Fillinger
f8059db4ee Print names of new tests properly
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:08:12 +01:00
Max Fillinger
92b7a7e233 ssl-opt.sh: Add tests for keying material export
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:08:12 +01:00
Gabor Mezei
1ac784c5a5
Fix test case migration
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-03-20 17:55:35 +01:00
Gabor Mezei
3ead04a12d
Remove/migrate tests for key exchange based on decryption
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-03-20 17:53:07 +01:00
Gabor Mezei
e1e27300a2
Remove MBEDTLS_KEY_EXCHANGE_RSA_ENABLED config option
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-03-20 17:53:01 +01:00
Minos Galanakis
625c8fd2d9 ssl-opt: Added 4 and 128 bytes tests to HS defragmentation for server initiated reneg
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-18 10:31:37 +00:00
Minos Galanakis
dfc082e16c ssl-opt: Fixed a minor typo.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-18 10:25:24 +00:00
Minos Galanakis
f475a15d5d ssl-opt: Disabled the renegotiation delay for fragmented HS renegotiation.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-14 00:15:40 +00:00
Minos Galanakis
641e08e2aa ssl-opt: Updated documentation.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:43:08 +00:00
Minos Galanakis
1d78c7d58d ssl-opt: Added client-initiated server-rejected renegotation test.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:44 +00:00
Minos Galanakis
a8f14384f8 ssl-opt: Updated O_NEXT_CLI_RENEGOTIATE used by fragmented HS renegotiation with certificates.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:44 +00:00
Minos Galanakis
df4ddfdf0c ssl-opt: Fragmented HS renegotiation, removed -legacy_renegotiation argument.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:44 +00:00
Minos Galanakis
0b830f145f ssl-opt: Fragmented HS renegotiation, removed requires_certificate_authentication dependency.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:44 +00:00
Minos Galanakis
9b2e4b80e7 ssl-opt: Fragmented HS renegotiation, removed requires_openssl_3_x dependency.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
af0e60b38f ssl-opt: Fragmented HS renegotiation, adjusted test names for consistency.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
70be67b97e ssl-opt: Fragmented HS renegotiation, updated matching regex
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
ae54c749fc ssl-opt: Added coverage for client-initiated fragmented HS renegotiation tests.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
a7b19aa857 ssl-opt: Refactored fragmented HS renegotiation tests.
- Switched to using MBEDTLS_SSL_PROTO_TLS1_2 for dependency.
- Re-ordered tests.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
990a10909d ssl-opt: Fragmented HS renegotiation, updated documentation.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
135ebd3241 ssl-opt: Removed mock-tests from HS renegotiation.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
87be69a3fc sll-opt: Added refence fix for the Mock HS Defrag test using renegotitiation delay
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
05009c736c Added Mock Renegotiation negative test for testing.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
529188f30b ssl-opt: Added fragmented HS tests for server-initiated renegotiation.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
5aaa6e048b ssl-opt: Added fragmented HS tests for client-initiated renegotiation.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
daa14a4212 ssl-opt: Added fragmented HS tests for SSL_VARIABLE_BUFFER_LENGTH.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-13 11:06:43 +00:00
Minos Galanakis
a2a0c2cbe7 Merge remote-tracking branch 'origin/features/tls-defragmentation/development' into feature_merge_defragmentation_dev
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-03-12 15:25:06 +00:00
Gabor Mezei
dd7c0f1e66
Fix ciphersuit
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-03-05 12:18:46 +01:00
Gabor Mezei
00ab71035e
Delete SSL async decryption tests
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-03-05 12:18:46 +01:00
Gabor Mezei
fc42c22c7b
Migrate RSA key exchange tests
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-03-05 12:18:30 +01:00
Gilles Peskine
b40d33b7c8 Move most TLS handshake defragmentation tests to a separate file
Prepare for those test cases to be automatically generated by a script.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-03 16:13:19 +01:00
Minos Galanakis
4354dc646f ssl-opt: Re-introduce certificate dependency for HS negative tests.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-27 22:40:37 +00:00
Minos Galanakis
0dd57a9913 ssl-opt: Removed dependencies for HS defrag negative tests.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-27 18:05:48 +00:00
Minos Galanakis
d01ac30cfa ssl-opt: Adjusted reference hs defragmentation tests.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-27 15:11:21 +00:00
Minos Galanakis
76957cceab ssl-opt: Minor typos and documentation fixes.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-27 15:11:21 +00:00
Minos Galanakis
17170a5ed2 ssl-opt: Updated documentation of HS-Defrag tests.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-27 11:40:33 +00:00
Minos Galanakis
c8709c6a85 ssl-opt: Removed redundant dependencies: requires_openssl_3_x
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-26 17:12:01 +00:00
Gilles Peskine
640512eb90 mbedtls_ssl_set_hostname tests: add tests with CA callback
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-24 18:48:49 +01:00
Gilles Peskine
488b91929d Require calling mbedtls_ssl_set_hostname() for security
In a TLS client, when using certificate authentication, the client should
check that the certificate is valid for the server name that the client
expects. Otherwise, in most scenarios, a malicious server can impersonate
another server.

Normally, the application code should call mbedtls_ssl_set_hostname().
However, it's easy to forget. So raise an error if mandatory certificate
authentication is in effect and mbedtls_ssl_set_hostname() has not been
called. Raise the new error code
MBEDTLS_ERR_SSL_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME, for easy
identification.

But don't raise the error if the backward compatibility option
MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME is
enabled.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-24 18:48:49 +01:00
Gilles Peskine
434016e2eb Keep track of whether mbedtls_ssl_set_hostname() has been called
No behavior change apart from now emitting a different log message depending
on whether mbedtls_ssl_set_hostname() has been called with NULL or not at all.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-02-24 18:47:44 +01:00
Minos Galanakis
cd6a24b288 ssl-opt.sh: Disabled HS Defrag Tests for TLS1.2 where len < 16
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-24 09:27:09 +00:00
Minos Galanakis
99ca6680f2 ssl-opt: Replaced max_send_frag with split_send_frag
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-24 09:16:06 +00:00
Minos Galanakis
a5a8c9f5c9 ssl-opt: Added coverage for hs defragmentation TLS 1.2 tests.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-24 09:16:06 +00:00
Minos Galanakis
d708a63857 ssl-opt: Updated documentation.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-24 09:16:06 +00:00
Minos Galanakis
36c81f5f05 ssl-opt: Added DSA-RSA dependency on TLS1.2 defragmentation testing.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2025-02-24 09:16:06 +00:00