Ben Taylor
9063aca165
ssl: propagate transcript-hash computation failures
...
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:17:14 +01:00
Gilles Peskine
465d6e9669
Fix ssl_tls13_prepare_new_session_ticket returning 1 on an RNG failure
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-04 18:44:05 +02:00
Minos Galanakis
308e7fb232
Merge remote-tracking branch 'restricted/development-restricted' into mbedtls-4.1.0.rc3
...
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-03-26 22:18:31 +00:00
David Horstmann
624fc2e0de
Move TLS 1.3 verify-result setting for PSK
...
When we are doing PSK, we'd like to set verify_result to
MBEDTLS_X509_BADCERT_SKIP_VERIFY. Previously this was done in
mbedtls_ssl_set_hs_psk() but this is inadequate since this function may
be called for early data (where certificate verification happens later
in the handshake.
Instead, set this value after writing / processing the encrypted
extensions on the server / client respectively, so that we know whether
we are doing certificate verification or not for sure. This change is
effective only for TLS 1.3 as TLS 1.2 sets verify_result for PSK in
ssl_parse_certificate_coordinate().
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2026-03-10 15:12:47 +00:00
Ronald Cron
8731587e41
tls13: Commit to session resume only when we actually do it
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-26 15:16:51 +01:00
Ronald Cron
ed767bada9
tls13: Do not negotiate TLS 1.2 after an HRR
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-02-26 15:16:46 +01:00
Valerio Setti
bc611fe44c
[tls12|tls13]_server: fix usage being checked on the certificate key
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-09-16 16:12:07 +02:00
Valerio Setti
7b2d72aaf0
ssl: replace PSA_ALG_ECDSA with MBEDTLS_PK_ALG_ECDSA
...
When the key is parsed from PK it is assigned the pseudo-alg
MBEDTLS_PK_ALG_ECDSA. Trying to run "mbedtls_pk_can_do_psa" with an hardcoded
deterministc/randomized ECDSA can make the function to fail if the proper
variant is not the one also used by PK.
This commit fixes this problem.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-09-16 16:12:07 +02:00
Valerio Setti
0009b042ac
library: ssl: replace mbedtls_pk_can_do_ext with mbedtls_pk_can_do_psa
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-09-16 16:12:07 +02:00
Ben Taylor
1cd1e01897
Correct code style
...
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-26 13:34:03 +00:00
Ben Taylor
0deda0e34c
Update debug
...
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-26 13:33:32 +00:00
Ben Taylor
602b2968ca
pre-test version of the mbedtls_ssl_conf_rng removal
...
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-26 13:32:10 +00:00
Manuel Pégourié-Gonnard
1038b22d74
Reduce the level of logging used in tests
...
This should avoid running into a bug with printf format specifiers one
windows.
It's also a logical move for actual tests: I used the highest debug
level for discovery, but we don't need that all the time.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-03-14 09:22:09 +01:00
Manuel Pégourié-Gonnard
6637ef798f
New test function inject_client_content_on_the_wire()
...
Not used for real stuff so far, just getting the tooling in place.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-03-14 09:22:09 +01:00
Manuel Pégourié-Gonnard
855f5bf244
Rm dead !USE_PSA code: ssl_tls13_xxx (part 1)
...
unifdef -m -DMBEDTLS_USE_PSA_CRYPTO library/ssl_tls13*.c
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-01-28 16:15:29 +01:00
Harry Ramsey
0f6bc41a22
Update includes for each library file
...
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-09 11:18:50 +01:00
Waleed Elmelegy
e2a6aa5369
Improve comments explaining legacy_methods_compression handling
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-06-25 18:16:16 +01:00
Waleed Elmelegy
0a9e8a3a18
Correct a small typo in ssl_tls13_parse_client_hello()
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-06-25 10:22:49 +01:00
Waleed Elmelegy
a5842ac20e
Improve handling of legacy_compression_methods in ssl_tls13_parse_client_hello()
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-06-19 15:09:48 +01:00
Waleed Elmelegy
b6e7331739
Fix issue in handling legacy_compression_methods in ssl_tls13_parse_client_hello()
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-06-11 18:45:40 +01:00
Gilles Peskine
a9d4ef0998
Fix uint32_t printed as unsigned int
...
This is ok in practice since we don't support 16-bit platforms, but it makes
`arm-none-eabi-gcc-10 -mthumb -Wformat` complain.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-03 22:16:23 +02:00
Manuel Pégourié-Gonnard
a4b773d3bb
Merge pull request #6955 from inorick/nofa_no_session_tickets
...
Guard ticket specific TLS 1.3 function with macro
2024-04-08 08:56:17 +00:00
Norbert Fabritius
d60aef0f1b
Unconditionally define session variable
...
Signed-off-by: Norbert Fabritius <norbert.fabritius@esrlabs.com>
2024-03-27 08:22:53 +01:00
Ronald Cron
1f045f3a0c
tls13: srv: Fix guards of _is_psk_(ephemeral_)available
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-27 08:22:53 +01:00
Norbert Fabritius
96eed725e1
Guard ticket specific TLS 1.3 function with macro
...
Guard ssl_tls13_write_new_session_ticket_coordinate with
MBEDTLS_SSL_SESSION_TICKETS macro.
Signed-off-by: Norbert Fabritius <norbert.fabritius@esrlabs.com>
2024-03-27 08:22:53 +01:00
Minos Galanakis
b70f0fd9a9
Merge branch 'development' into 'development-restricted'
...
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-03-19 22:24:40 +00:00
Ronald Cron
a5c5c58107
tls13: srv: Fix potential stack buffer overread
...
Fix potential stack buffer overread when
checking PSK binders.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-19 14:46:21 +01:00
Waleed Elmelegy
4dfb0e7c90
Add ALPN checking when accepting early data
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-03-15 12:12:15 +00:00
Ronald Cron
6bee910dbd
Merge pull request #8858 from waleed-elmelegy-arm/add_alpn_to_session
...
Add ALPN information in session tickets
2024-03-15 09:50:24 +00:00
Gilles Peskine
7b333f1e88
Merge pull request #8913 from ronald-cron-arm/tls13-ticket-lifetime
...
TLS 1.3: Enforce ticket maximum lifetime and discard tickets with 0 lifetime
2024-03-14 15:59:25 +00:00
Waleed Elmelegy
5bc5263b2c
Add code improvments and refactoring in dealing with ALPN
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-03-13 16:50:01 +00:00
Waleed Elmelegy
883f77cb08
Add mbedtls_ssl_session_set_alpn() function
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-03-13 16:50:01 +00:00
Waleed Elmelegy
2824a209bc
Add ALPN information in session tickets
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-03-13 16:50:01 +00:00
Jerry Yu
ce79488dd5
tls13: srv: Fail connection if ticket lifetime exceed 7 days
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-10 17:42:43 +01:00
Ronald Cron
7e1f9f290f
Merge pull request #8854 from ronald-cron-arm/tls13-srv-max-early-data-size
...
TLS 1.3: Enforce max_early_data_size on server
2024-03-09 00:16:07 +00:00
Janos Follath
080a5171e2
Merge pull request #8861 from ronald-cron-arm/tls13-srv-select-kex
...
TLS 1.3: SRV: Improve key exchange mode selection
2024-03-08 14:58:36 +00:00
Ronald Cron
19521ddc36
tls13: srv: Fix/Improve debug logs
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
7cab4f885b
tls13: srv: Fix/Improve comments
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
16cc370423
tls13: srv: Fix initialization value
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
f602f7ba50
tls13: srv: Code improvements
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
3811765c0c
tls13: srv: Add/Improve comments
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
74a1629231
tls13: srv: Move PSK ciphersuite selection up
...
Move PSK ciphersuite selection up to the main
ClientHello parsing function. That way the
ciphersuite selection only happens in this
function.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
3e47eec431
tls13: srv: Simplify resumption detection
...
Avoid marking we resume and then
cancelling it.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
e8c162d7ba
tls13: srv: Simplify kex availability checks
...
Regarding the possibility of selecting a
key exchange mode, the check of the ticket
flags is now separated from the check of
the ClientHello content and server
configuration.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
79cdd4156f
tls13: srv: Improve key exchange mode determination
...
For PSK based key exchange modes do not check twice
anymore if they can be selected or not. Check it
only when looping over the offered PSKs to select
one.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
1f63fe4d74
tls13: srv: Fix resume flag in case of cancelled PSK
...
If we prefer ephemeral key exchange mode over
the pure PSK one, make sure the resume flag is
disabled as eventually we are not going to
resume a session even if we aimed to at some
point.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
cf284565c5
tls13: srv: Determine best key exchange mode for a PSK
...
Determine best key exchange for for ticket based and
external PSKs.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
89089cc69b
tls13: srv: Factorize ciphersuite selection code
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
f7e9916b3d
tls13: srv: Fix MBEDTLS_SSL_SESSION_TICKETS guard position
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00
Ronald Cron
12e72f1664
tls13: srv: Always parse the pre-shared key extension
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-08 08:43:41 +01:00