31112 Commits

Author SHA1 Message Date
Ronald Cron
31b40b3600 Add change logs
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-28 10:42:01 +02:00
Ronald Cron
97dc5832c5 Improve debug logs
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-28 10:42:01 +02:00
Ronald Cron
fc76718dcd Move MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET doc
Move MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET
error code documentation to the documentation of
mbedtls_ssl_read() as we cannot have long error
descriptions because of a limitation in
generate_errors.pl.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-28 10:42:01 +02:00
Ronald Cron
d67f801c63 Do not add a new field in the SSL config
We cannot add a new field in SSL config in
an LTS. Use `session_tickets` field instead.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-28 10:41:54 +02:00
Ronald Cron
57ad182644 ssl_client2: Fix new_session_tickets option parsing
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-28 10:30:24 +02:00
Ronald Cron
e55659d576 Document NewSessionTicket handling being disabled by default
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-28 10:30:17 +02:00
Ronald Cron
9df056390a Improve MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET documentation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-27 18:04:44 +02:00
Ronald Cron
0e5d4fdfc5 Document MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-27 16:20:47 +02:00
Ronald Cron
23303a47f4 Enable TLS 1.3 ticket handling in resumption tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-27 16:20:40 +02:00
Ronald Cron
b675b2ba5d TLS 1.3: Ignore tickets if disabled at runtime
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-27 15:41:24 +02:00
Ronald Cron
bedddd707a Add mbedtls_ssl_conf_enable_new_session_tickets() API
Add mbedtls_ssl_conf_enable_new_session_tickets() API
to be able to enable and disable the handling of TLS 1.3
NewSessionTicket messages.

The TLS 1.2 equivalent function is named
mbedtls_ssl_conf_session_tickets() thus the most
natural name would have been
mbedtls_ssl_conf_new_session_tickets() but it is
already used on server side thus rather
mbedtls_ssl_conf_enable_new_session_tickets().

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-08-27 15:41:18 +02:00
Gilles Peskine
7defa41fb3
Merge pull request #9501 from gilles-peskine-arm/tls13-psa-init-auto-3.6
[3.6] TLS 1.3: call psa_crypto_init
2024-08-26 15:26:35 +00:00
Gilles Peskine
57dbd69945 TLS 1.3 server: move crypto_init after protocol negotiation
This reduces the workflows where psa_crypto_init is called when not
necessary: it won't be called when a dual-version server receives a 1.2-only
ClientHello.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-26 12:04:39 +02:00
Gilles Peskine
aa6ef7da50 Changelog entry for psa_crypto_init potentially being called from TLS
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-26 12:01:31 +02:00
Gilles Peskine
92e803ea5b Clarify "negotiating"
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-26 11:59:48 +02:00
Gilles Peskine
50476272a9 Error translation and init are needed in PSK-only builds as well
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-26 09:28:41 +02:00
Gilles Peskine
069bccdf78 Call psa_crypto_init in the library when required for TLS 1.3
For backward compatibility with Mbed TLS <=3.5.x, applications must be able
to make a TLS connection with a peer that supports both TLS 1.2 and TLS 1.3,
regardless of whether they call psa_crypto_init(). Since Mbed TLS 3.6.0,
we enable TLS 1.3 in the default configuration, so we must take care of
calling psa_crypto_init() if needed. This is a change from TLS 1.3 in
previous versions, where enabling MBEDTLS_SSL_PROTO_TLS1_3 was a user
choice and could have additional requirement.

This commit makes the library call psa_crypto_init() when it needs PSA
crypto in a situation where the application might not have called it,
namely, when starting a TLS 1.3 connection.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-25 10:44:39 +02:00
Gilles Peskine
cd4da16eea Don't call psa_crypto_init in test programs when not required for TLS 1.3
For backward compatibility with Mbed TLS <=3.5.x, applications must be able
to make a TLS connection with a peer that supports both TLS 1.2 and TLS 1.3,
regardless of whether they call psa_crypto_init(). Since Mbed TLS 3.6.0,
we enable TLS 1.3 in the default configuration, so we must take care of
calling psa_crypto_init() if needed. This is a change from TLS 1.3 in
previous versions, where enabling MBEDTLS_SSL_PROTO_TLS1_3 was a user
choice and could have additional requirement.

This commit changes our test programs to validate that the library
does not have the compatibility-breaking requirement.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-25 10:44:39 +02:00
Gilles Peskine
5950301740 Don't call psa_crypto_init in unit tests when not required for TLS 1.3
For backward compatibility with Mbed TLS <=3.5.x, applications must be able
to make a TLS connection with a peer that supports both TLS 1.2 and TLS 1.3,
regardless of whether they call psa_crypto_init(). Since Mbed TLS 3.6.0,
we enable TLS 1.3 in the default configuration, so we must take care of
calling psa_crypto_init() if needed. This is a change from TLS 1.3 in
previous versions, where enabling MBEDTLS_SSL_PROTO_TLS1_3 was a user
choice and could have additional requirement.

This commit changes our unit tests to validate that the library
does not have the compatibility-breaking requirement.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-25 10:44:39 +02:00
Gilles Peskine
590bdcbddf Call psa_crypto_init in the library when required for TLS 1.3: doc
For backward compatibility with Mbed TLS <=3.5.x, applications must be able
to make a TLS connection with a peer that supports both TLS 1.2 and TLS 1.3,
regardless of whether they call psa_crypto_init(). Since Mbed TLS 3.6.0,
we enable TLS 1.3 in the default configuration, so we must take care of
calling psa_crypto_init() if needed. This is a change from TLS 1.3 in
previous versions, where enabling MBEDTLS_SSL_PROTO_TLS1_3 was a user
choice and could have additional requirement.

This commit removes the compatibility-breaking requirement from the
documentation.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-25 10:44:39 +02:00
Gilles Peskine
86a4c25136
Merge pull request #9499 from waleed-elmelegy-arm/fix-legacy-compression-issue-3.6
[Backport 3.6] Fix issue in handling legacy_compression_methods in ssl_tls13_parse_client_hello()
2024-08-22 18:23:33 +00:00
Gilles Peskine
df0ef8a624
Merge pull request #9281 from mpg/rsapub
[3.6] Reduce performance regression in RSA public operations
2024-08-22 16:50:38 +00:00
Waleed Elmelegy
8ac9caf89b Fix the capitalisation in the changelog entry
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 16:42:18 +00:00
Waleed Elmelegy
d930a3e950 Reduce the wording in changelog entry
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 16:39:39 +00:00
Waleed Elmelegy
5183e1ab17 Improve the changelog entry for fixing legacy compression issue
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 16:39:21 +00:00
Waleed Elmelegy
f669fef856 Add chanelog entry for fixing legacy comprssion methods issue
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 16:15:06 +00:00
Waleed Elmelegy
1297309fdb Remove redundant legacy compression test
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 15:50:46 +00:00
Waleed Elmelegy
38c8757b2c Improve legacy compression regression testing
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 15:50:46 +00:00
Waleed Elmelegy
790f3b16d4 Add regression testing to handling Legacy_compression_methods
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 15:50:45 +00:00
Waleed Elmelegy
a1c4f4cab6 Improve comments explaining legacy_methods_compression handling
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 15:50:45 +00:00
Waleed Elmelegy
3918598e52 Correct a small typo in ssl_tls13_parse_client_hello()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 15:50:45 +00:00
Waleed Elmelegy
566ed54d6e Improve handling of legacy_compression_methods in ssl_tls13_parse_client_hello()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 15:50:45 +00:00
Waleed Elmelegy
41e0cdf8c1 Fix issue in handling legacy_compression_methods in ssl_tls13_parse_client_hello()
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-08-22 15:50:45 +00:00
Janos Follath
4c857c49b4 Fix Changelog formatting
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-22 15:45:18 +01:00
Janos Follath
5f316972b2 Add header for mbedtls_mpi_exp_mod_unsafe()
To silence no previous prototype warnings. And this is the proper way to
do it anyway.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-22 15:00:09 +01:00
Janos Follath
5d16334e84
Improve ChangeLog
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-22 14:49:58 +01:00
Manuel Pégourié-Gonnard
273d07b0c0
Merge pull request #9240 from gilles-peskine-arm/psa-keystore-dynamic-3.6
Backport 3.6: dynamically sized key store
2024-08-22 12:53:32 +00:00
Janos Follath
82976f3548 Make mbedtls_mpi_exp_mod_unsafe internal
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-22 13:00:12 +01:00
Janos Follath
6c2086931d Add changelog
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-22 12:59:36 +01:00
minosgalanakis
7be977a7a7
Merge pull request #9486 from sergio-nsk/sergio-nsk/3.6/lean_and_mean/1
[Backport 3.6] Fix Mbed-TLS build when WIN32_LEAN_AND_MEAN macro is defined globally
2024-08-22 10:08:11 +00:00
Gilles Peskine
11cac75449 Simplify and explain the overflow check for maximum slice length
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-22 10:55:40 +02:00
David Horstmann
9183ba1179 Add overflow check for maximum key slot length
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-08-21 17:05:37 +01:00
David Horstmann
43124912c5 Tweak macro check to allow 3 extra key slices
We are technically allowed to use all possible values of key slice index
that will fit into the bit width we have allocated, so allow all values.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-08-21 15:18:28 +01:00
David Horstmann
a8e13d7c2a Fix incorrect comments on slice numbering
The persistent key cache slice is the last slice (not the first as
previously stated). Update the numbering-related comments accordingly.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-08-21 14:41:06 +01:00
Janos Follath
878af12807 Fix memory corruption in exp_mod tests
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-20 12:33:42 +01:00
Janos Follath
afb2079652 Clean up initialization in _core_exp_mod()
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-20 11:00:51 +01:00
Janos Follath
8786dd79f7 Disable optionally safe test hook in threading builds
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-20 10:21:54 +01:00
Janos Follath
a11269187e Fix optionally safe hooks declarations
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-20 09:56:16 +01:00
Janos Follath
9d72df8e6d Optimise public RSA operations
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 16:06:19 +01:00
Janos Follath
2c62441f96 Fix mpi_core_exp_mod documentation
Signed-off-by: Janos Follath <janos.follath@arm.com>
2024-08-15 15:53:07 +01:00