32964 Commits

Author SHA1 Message Date
Minos Galanakis
091ce71fb2 Added attribution
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-23 10:51:21 +01:00
Minos Galanakis
63ea5aef99 Added CVE
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-22 22:38:08 +01:00
Ronald Cron
6c8f300620
Merge pull request #1674 from bjwtaylor/pkcs-free-stale-pointers-3.6
Pkcs free stale pointers 3.6
2026-06-22 17:56:23 +02:00
Gilles Peskine
a2ede7033f
Merge pull request #1637 from bjwtaylor/chacha20-counter-overflow-restricted-3.6
Chacha20 counter overflow restricted 3.6
2026-06-22 12:49:53 +02:00
Ronald Cron
f6f6492228
Merge pull request #1641 from gilles-peskine-arm/badmac_seen_or_in_hsfraglen-fix
3.6 only: Fix and test badmac_seen_or_in_hsfraglen confusion
2026-06-22 10:30:00 +02:00
Gilles Peskine
d3b43bcbc1
Merge pull request #1596 from gilles-peskine-arm/basic-constaints-sequence-check-3.6
Backport 3.6: Fix CA bit forgery through invalid basicConstraints
2026-06-18 15:36:50 +02:00
Ben Taylor
12717ec8f4 Add in the two additional checks that were dropped.
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
(cherry picked from commit 377aa4eff16cd0aa5e7440a41de59847e3a789a0)
2026-06-18 13:15:58 +01:00
Ben Taylor
7457580790 Remove pkcs7_parse_free_resets_context as it duplicates pkcs7_parse_reuse
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 10afc1ed5c8e9c47caf1ad8ee6241fd99e43f945)

Backport note: resolved the redundant-test removal conflict by deleting the temporary reset test while keeping the 3.6 pkcs7_verify dependency expression.
2026-06-18 13:15:58 +01:00
Ben Taylor
2ce44c5b1d Add CVE ID to ChangeLog
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
(cherry picked from commit a798b5804ef8571bcfd6609019758014325162c4)
2026-06-18 13:13:59 +01:00
Ben Taylor
25513f33f0 Remove whitespace in ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 74555884cc72bf8aa6b74a0a09bb2a3a68741806)
2026-06-18 13:13:59 +01:00
Ben Taylor
ad814cabe2 Correct changelog style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 351419f1ff82f148e142bd9bdbfc2a3fa3b7f5ee)
2026-06-18 13:13:59 +01:00
Ben Taylor
439e194752 Add further testing
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 84966c1bda07dd01e38786b2caa9b7453a5adb95)

Backport note: resolved PKCS7 test conflicts by retaining the 3.6 dependency names (MBEDTLS_MD_CAN_SHA256:MBEDTLS_RSA_C) for the added regression cases.
2026-06-18 13:13:59 +01:00
Ben Taylor
544f1ccc1d Update ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 64435904480332b9dd7249b73385853720b6a5da)
2026-06-18 13:12:25 +01:00
Ben Taylor
dfa25b3577 Update ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 4e797c14e0ae62c31f7ae5996dd27888642d11a3)
2026-06-18 13:12:25 +01:00
Ben Taylor
b6793c584d Fix style issues
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 62162e6e4d08ddcc6805975cc39e59f69e0c9775)
2026-06-18 13:12:25 +01:00
Ben Taylor
934bee94c1 Remove redundant function from pkcs7_parse_reuse
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit f60f5ba85cda59545442af29b59fdee9ed6af83d)
2026-06-18 13:12:25 +01:00
Ben Taylor
34f0016cbc Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit e9ec4ce3caf7e21f877d4dd6d733b858bc56df75)
2026-06-18 13:12:25 +01:00
Ben Taylor
699d4030c2 Add fix for stale pointer after mbedtls_pkcs7_free
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
(cherry picked from commit 67e696b430716f95ed714f2c1404681697251438)

Backport note: resolved the PKCS7 test-suite conflict by keeping the 3.6 pkcs7_verify dependency expression while adding the reuse regression test.
2026-06-18 13:12:14 +01:00
Ronald Cron
cc1181a65e
Merge pull request #1662 from minosgalanakis/public-sync/mbedtls-3.6-14062026
[Sync] Merge mbedtls-3.6 into Merge mbedtls-3.6-restricted
2026-06-16 23:07:37 +02:00
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
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
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
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