33015 Commits

Author SHA1 Message Date
Gilles Peskine
abb6bcd354 Credit independent report
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-16 19:36:40 +02:00
Gilles Peskine
794e1a89db Add documentation for the new getters and setters
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-16 15:04:35 +02:00
Gilles Peskine
7c28ccf8ab Use functions instead of macros for badmac_seen_or_in_hsfraglen setters
Let the caller handle returning on error. This is less surprising, and it's
more flexible in case the caller needs to perform some cleanup (which is
currently not the case).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-16 14:56:59 +02:00
Gilles Peskine
364f07a926
Merge pull request #1654 from bjwtaylor/ECDHE-PSK-integer-overflow-restricted-3.6
Backport for Ecdhe psk integer overflow fix to 3.6
2026-06-16 11:50:01 +02:00
Ronald Cron
1d44a35519
Merge pull request #1647 from bjwtaylor/oob-key-exchange-restricted-3.6
Add fix for OOB key exchange error 3.6
2026-06-15 22:42:22 +02:00
Gilles Peskine
93460dafc7 Reject MBEDTLS_SSL_SET_BADMAC_SEEN at compile time if DTLS is disabled
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-15 18:39:19 +02:00
Gilles Peskine
1453fda32c Remove some test cases that are not really meaningful
Remove the "srv" variant of "DTLS proxy: server: get invalid AD record then
accept renego", where the server initiates the renegotiation process by
sending a HelloRequest. The HelloRequest message is not relevant to this
test. The first message of the actual renegotiation is the ClientHello
message from the client, and the interesting part of the test happens when
the client receives the server's response.

Remove "DTLS proxy: server: get invalid AD record then accept early
renego (cli)" and the corresponding "reject" control. This test case doesn't
really do what it is advertised to do, and in particular does not lead to a
call to `ssl_consume_current_message()` in the server. What happens is that
the client sends a ClientHello message to start the renegotiation, then it
blocks until the server has replied. So there is nothing to delay that
ClientHello after:(unlike what happens in the corresponding client-side
test, where the first flight of the renegotiation protocol contains multiple
messages, so we can delay the first of these messages after the second one).
What happens in practice is that the client times out, then resends its
ClientHello, and the proxy sends the delayed ClientHello immediately after
the resent one, which does not cause any interesting behavior in the server.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-15 18:22:11 +02:00
Gilles Peskine
1db3c1c9a0 Explain the "get invalid AD record .*renego" tests better
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-15 16:14:31 +02:00
Gilles Peskine
a145116bff Don't pass badmac_limit when it would have no effect
Only set `badmac_limit` on the side that actually receives a message with a
bad MAC/tag (injected by the proxy).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-15 13:37:54 +02:00
Gilles Peskine
a939d850c7 Add DTLS handshake test with badmac_seen=1
Add a test entry point for a handshake with a specially crafted context.
This can be used for defense in depths for scenarios that we think can't
happen, but might actually happen due to a bug, or due to a new feature that
is insufficiently tested. This can also be a proxy for testing aspects of
renegotiation or session resumption in circumstances that are hard to
arrange.

In this commit, use it to test a DTLS handshake with `ssl->badmac_seen`
:(actually `ssl->badmac_seen_or_in_hsfraglen` in the 3.6 branch) set to a
nonzero value. This can't happen, as far as I know (`badmac_seen` can only
be nonzero during renegotiation, not during a nominal handshake or in
session resumption). But it could happen, for example, if
`mbedtls_ssl_session_reset()` failed to reset `badmac_seen`, as was the case
in Mbed TLS 4.0.0 to 4.1.0.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-15 13:08:43 +02:00
Manuel Pégourié-Gonnard
591982e047 Clarify a commend in tests
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-15 10:24:09 +02:00
Ben Taylor
b961ac2cf2
Update ChangeLog to include CVE number
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-15 09:21:28 +01:00
Ben Taylor
e1351f7881 Fix style issue
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 09:14:29 +01:00
Ben Taylor
0421e88ce1 Correct ChangeLog style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 09:14:29 +01:00
Ben Taylor
9befdba49e Add CVE to ChangeLog
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-15 09:14:29 +01:00
Ben Taylor
b461821223 Improve the wording of the ChangeLog
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-15 09:14:29 +01:00
Minos Galanakis
154516a789 Merge remote-tracking branch 'public/mbedtls-3.6' into public-sync/mbedtls-3.6-14062026
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-14 19:35:34 +01:00
Manuel Pégourié-Gonnard
255fd41e1e pk: tests: avoid corner case
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-11 16:50:29 +02:00
Ben Taylor
e8908dfa54 Correct maximum lengths in length tests
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 89620b3cd4649dc3af967af8cf901dcaa1986ec0)
2026-06-11 14:11:36 +01:00
Ben Taylor
757e75732d Add note clarifying that output integrity for the chachpoly update is currently provided, though not gauranteed in the future
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit b70d73e6a7591f99a05e8b1c03f0b3915ae7cdff)
2026-06-11 14:11:30 +01:00
Ben Taylor
4ee90fe0e6 Correct logic for keystream_bytes_used
Co-authored-by: minosgalanakis <30719586+minosgalanakis@users.noreply.github.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
(cherry picked from commit 8de9f6aa776d5e92d77b10dfca6666f83f542ab2)
2026-06-11 14:11:24 +01:00
Ben Taylor
bac83ee5de Add additional verification that output hasn't been modified
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 720ee2392a6ced5ee0220a87c20d6c3d43a10650)
2026-06-11 14:11:16 +01:00
Ben Taylor
29090200c2 Update tests to reflect change to lenght checking
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit f650b3f761ff5d88c94800d168b1889567106eec)
2026-06-11 14:11:10 +01:00
Ben Taylor
89005658bc Remove issue number and add CVE to ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 84bb99ca557ddfe4864d3b9ae84299ba4fb0c358)
2026-06-11 14:11:05 +01:00
Ben Taylor
77a2831999 Remove length checking from chacha20
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 21594d5f6daeb8b6f633d481d3335bd7399f8237)
2026-06-11 14:10:53 +01:00
Ben Taylor
176bea08b7 Correct maximum size for chacha20
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 540c75e5a0fa787b6e4ffdaec33648f83b850b6a)
2026-06-11 14:10:47 +01:00
Ben Taylor
e1641d00e2 Remove assertion that ctx.ciphertext_len is 0
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 3f3d3da789e05f078a4df9995278d3d53e273513)
2026-06-11 14:10:42 +01:00
Ben Taylor
98b1bf9f2e fix asserts in old chachapoly_update_too_long_preserves_state function
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 57ac277339e9e9684caf1e8a3bad20c57678ea83)
2026-06-11 14:10:35 +01:00
Ben Taylor
08accf7b92 Fix code style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit ef055ea1bbfd17de9eeae11c5f90101361fb02df)
2026-06-11 14:10:21 +01:00
Ben Taylor
8b7fca9ede Add improvement to chacha20 tests
Co-authored-by: minosgalanakis <30719586+minosgalanakis@users.noreply.github.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
(cherry picked from commit 9d6a54795c96f7f0d7dfc230071dc16c5f47f94a)
2026-06-11 14:10:14 +01:00
Manuel Pégourié-Gonnard
9b3d8dc174 rsa: fix constant-time test for decompose_ret()
We were passing input, while only combined_ret is marked as secret...

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-11 12:26:16 +02:00
Manuel Pégourié-Gonnard
29108ed8ce pk: test buffer too small for RSA-opaque + RSA-alt
A previous commit added tests "normal" PK RSA contexts, but missed
opaque RSA keys and RSA_ALT keys.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-11 11:52:18 +02:00
Manuel Pégourié-Gonnard
9516cc4e70 psa: test buffer too small for RSA decrypt
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-11 11:30:45 +02:00
Ben Taylor
f1c9f7fb25 Add reported by and CVE placeholder
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit ab2a7d5a3472f39190344f754e6cee5039fcba50)
2026-06-10 14:35:58 +01:00
Ben Taylor
38a111dd98 Correct style of ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 0501e447cc19ed06b69daea5e17585e1294030cd)
2026-06-10 14:35:58 +01:00
Ben Taylor
dafd83e310 Improve ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit c058818451833a748da112e3b8129fd299480ceb)
2026-06-10 14:35:58 +01:00
Ben Taylor
7f945f96e8 Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit e71e49e634ba49b2b630f268bc8f0dd392751ec3)
2026-06-10 14:35:58 +01:00
Ben Taylor
ec1641e6a0 Add in tests for ECDHE-PSK integer overflow
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit c567299ee6bade9547a97d3ad1dcd5f3bd98ea6f)
2026-06-10 14:35:58 +01:00
Ben Taylor
f9835c081f Added fix for Integer overflow using a large ECDHE Identity
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit baf449db7e31f031ed5def0fecf417122f72d3ee)
2026-06-10 14:34:37 +01:00
Ronald Cron
02edd2b8c2
Merge pull request #1609 from minosgalanakis/security/mlfbyt4c_tls13_policy_bypass_3.6
Backport 3.6: TLS1.3 client HRR policy bypass[ARM-MLFBYT4C]
2026-06-10 13:03:45 +02:00
Manuel Pégourié-Gonnard
d73eec656c psa: test buffer sized just for actual plaintext
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-10 09:57:20 +02:00
Minos Galanakis
8c458b8cca test_suite_ssl: Updated reject_hrr_selecting_unoffered_group dependencies
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-08 15:54:41 +01:00
Manuel Pégourié-Gonnard
4813b0c093 pk: fix builds without PKCS#1 v1.5
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-08 12:00:02 +02:00
Manuel Pégourié-Gonnard
c76cfd536e pk: also fix RSA-opaque v1.5 decrypt side channels
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-08 11:56:59 +02:00
Manuel Pégourié-Gonnard
88d55b8140 Add ChangeLog for the latest RSA padding issues
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-08 11:39:44 +02:00
Manuel Pégourié-Gonnard
31ac657745 rsa: move CT tests to .constant_time.data
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-08 11:39:44 +02:00
Manuel Pégourié-Gonnard
7e51c31aef rsa/psa: tune doc about RSA v1.5 decrypt usage
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-08 11:39:44 +02:00
Gilles Peskine
fe47e9ed89 Define and use mbedtls_rsa_decrypt_decompose_ret()
Use a more structured way of isolating and translating sensitive error codes
from RSA PKCS#1v1.5 decryption.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-08 11:39:44 +02:00
Gilles Peskine
a818c0a8dd Changelog entry for badmac_seen_or_in_hsfraglen confusion
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 21:59:07 +02:00
Ronald Cron
b513676bed
Merge pull request #10772 from mpg/security-link-3.6
[3.6] Update broken link
2026-06-05 16:47:25 +00:00