Compare commits

..

275 Commits

Author SHA1 Message Date
David Horstmann
3bb3738679
Merge pull request #10820 from minosgalanakis/tools/fix-auto-generated-files
Fix generate_errors.pl
2026-07-20 09:55:59 +00:00
David Horstmann
12556bc2a2
Merge pull request #10804 from valeriosetti/improve-rsa-pubkey-import-err-code
pk: improve error code failure reporting when RSA public key parsing fails (1/2)
2026-07-15 11:09:33 +00:00
Minos Galanakis
32ae7d92d6 Fix generate_errors.pl
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-09 15:20:32 +01:00
Ronald Cron
9e9eb069d6
Merge pull request #10817 from Mbed-TLS/mbedtls-4.2.0_mergeback
Mbedtls 4.2.0 mergeback
2026-07-08 13:16:51 +00:00
Minos Galanakis
bacdd16661 Updated framework
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-08 10:44:21 +01:00
Minos Galanakis
53aaf3215b Updated tf-psa-crypto submodule
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-08 10:43:26 +01:00
Valerio Setti
a5b83aea58 tests: x509parse: add temporary fallback mechanism for PK error codes
Add a temporary fallback mechanism in 'x509parse_crt' while crypto#827
is merged.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-07 22:56:30 +02:00
Minos Galanakis
970ccc59b0 Merge tag 'mbedtls-4.2.0' into mbedtls-4.2.0_mergeback
Mbed TLS 4.2.0

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-07 16:51:57 +01:00
Valerio Setti
8607628249 tests: x509parse: adjust some PK related error codes
After crypto#827 some PK error codes changed from
MBEDTLS_ERR_PK_INVALID_PUBKEY to MBEDTLS_ERR_PK_INVALID_ALG.
This commit adjusts failing test cases.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-07-02 14:05:15 +02:00
Minos Galanakis
ece41aa84d ChangeLog: Removed CVE-ID
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-07-01 12:00:14 +01:00
Valerio Setti
47e9e61020
Merge pull request #10656 from bjwtaylor/unused-variable-ret
Fix variable set but not used warning
2026-07-01 08:26:29 +00:00
Minos Galanakis
b4ee2d4277 Update BRANCHES.md
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-29 18:16:27 +01:00
Minos Galanakis
c1cc0ed3ed ChangeLog: Removed todo placeholder for CVE
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-29 18:16:27 +01:00
Minos Galanakis
7f64d9609b Changelog: Added reference to tf-psa-crypto update
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-29 18:16:27 +01:00
Minos Galanakis
f3c2896076 Assemble ChangeLog
./framework/scripts/assemble_changelog.py

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-29 18:12:41 +01:00
Minos Galanakis
b11a07f274 Bump version --version 4.2.0
./scripts/bump_version.sh --version 4.2.0

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-29 18:12:41 +01:00
Minos Galanakis
97a9420455 Updated tf-psa-crypto submodule
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-29 18:12:41 +01:00
Minos Galanakis
d156cf4c02 Merge remote-tracking branch 'development-restricted' into mbedtls-4.2.0.rc 2026-06-26 22:23:37 +01:00
Ronald Cron
41a8bdf109
Merge pull request #1619 from valeriosetti/issue1585
[development] Stale DTLS- SRTP negotiation state after session_reset() (ARM-RZ7EMQAA)
2026-06-26 12:17:06 +02:00
Ronald Cron
3bb1c69f7e
Merge pull request #1685 from minosgalanakis/security/mlfbyt4c_tls13_policy_bypass_changelog
Add Attribution CVE mbedtls:development-restricted
2026-06-25 15:54:46 +02:00
Ronald Cron
05e0dfbe99
Merge pull request #10786 from minosgalanakis/mbedtls-release-sync
Mbedtls 4.2.0 release sync
2026-06-25 12:16:45 +00:00
Minos Galanakis
66e3648745 Updated tf-psa-crypto pointer
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-25 00:50:42 +01:00
Minos Galanakis
0aaa58b438 Updated framework pointer
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-25 00:50:26 +01:00
Gilles Peskine
1a4f04b0c4
Merge pull request #10788 from bensze01/readthedocs
Upgrade readthedocs builder to Ubuntu 26.04
2026-06-24 18:18:42 +00:00
Gilles Peskine
9baa16385d
Merge pull request #1652 from ronald-cron-arm/hsm-do-not-span-key-change
Hsm do not span key change
2026-06-24 19:22:01 +02:00
Bence Szépkúti
98413e8b70 Upgrade readthedocs builder to Ubuntu 26.04
The 20.04 runner is no longer supported.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2026-06-24 16:43:16 +02:00
Ronald Cron
b188f399f9 Check ServerHello record boundary alignment only in TLS 1.3 case
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
74b9ab2008 tls13_fetch_handshake_msg(): Remove require_record_boundary parameter
Deduce it from the handshake message type

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
e08cea612f tls13_record_boundary_alignement: Append empty hs msg
Append an empty handshake message to expand
the record instead of just a zero byte.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
1a58c59470 Various improvements of tls13_(drop_early_data|record_boundary_alignment)()
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
6c557a70f6 tls13: Rework mbedtls_ssl_tls13_fetch_handshake_msg()
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
0c9d3d4a0f tls13: Improve argument name
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
86315b62a8 test_suite_ssl: Add initialization to all zeroes of test endpoint structs
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
c494497256 Fix typos
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
e55d0b76ed Add change log
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
2de65b79a3 test_suite_ssl: Test EndOfEarlyData on record boundary enforcement
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
cbef7256ce test_suite_ssl: Test client Finished on record boundary enforcement
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
53ac018b24 test_suite_ssl: Test server Finished on record boundary enforcement
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
93eb43ed4f test_suite_ssl: Test ServerHello on record boundary enforcement
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
c8fefcde05 test_suite_ssl: Test ClientHello on record boundary check
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
3861588b47 tls13: Add record boundary checks
RFC 8446 (TLS 1.3 specification), Section 5.1, states:

Handshake messages MAY be coalesced into a single TLSPlaintext record
or fragmented across several records, provided that:
    ...
    -Handshake messages MUST NOT span key changes. Implementations
    MUST verify that all messages immediately preceding a key change
    align with a record boundary; if not, then they MUST terminate the
    connection with an "unexpected_message" alert. Because the
    ClientHello, EndOfEarlyData, ServerHello, Finished, and KeyUpdate
    messages can immediately precede a key change, implementations
    MUST send these messages in alignment with a record boundary.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:33 +02:00
Ronald Cron
b340e27847 test_suite_ssl: Add early data drop tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-24 15:51:30 +02:00
Valerio Setti
4f92a63e4a tests: ssl_helpers: run ssl_context reset check only when the SSL context is setup
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 15:37:00 +02:00
Minos Galanakis
f722436e46 Changelog. Added attribution/CVE for 1569
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-24 14:36:00 +01:00
Ronald Cron
f74ef9b3ab
Merge pull request #1599 from bjwtaylor/ssl-ignores-failure-restricted
Fix issues in ssl where it ignores the failure return
2026-06-24 15:02:34 +02:00
Valerio Setti
c668f4e68e framework: update reference
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:31:20 +02:00
Valerio Setti
4c8a9b7a5e tests: generate_ssl_session_reset_check: remove trailing whitespace
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
dce45a7cfe tests: generate_ssl_session_reset_check: pacify pylint
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
508e9b1ca4 tests: generate_ssl_session_reset_check: order rules as fields in the struct
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
d70169b85c tests: ssl_helpers: fix documentation of mbedtls_test_ssl_check_context_after_session_reset
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
365544616d tests: ssl_context_reset_verifier: add missing semicolon in generated file
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
b55e820fd1 tests: generate_ssl_session_reset_check: add missing semicolon in generated file
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
4b57c243bb changelog: add note for documentation fix for mbedtls_ssl_set_cid
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
3bd3e47100 include: ssl: fix documentation of mbedtls_ssl_set_cid
Specify that the configured CID will apply to all subsequent handshakes
not just to the next one.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
931b983159 changelog: add reset for some fields of the SSL context structure
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
a2338a21fa library: ssl: reset some SSL context's fields in mbedtls_ssl_session_reset
Following fields were not properly reset when mbedtls_ssl_session_reset
was called:

- badmac_seen
- dtls_srtp_info
- alert_reason
- alert_type

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
fbd49c0c4e tests|programs: call check_context_after_session_reset whenever mbedtls_ssl_session_reset
Call mbedtls_test_ssl_check_context_after_session_reset both in programs
(ssl_client2 and ssl_server2) and tests to ensure that the SSL context
has been properly handled when mbedtls_ssl_session_reset was called.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
a4dbd999c0 tests: add prototype and implementation of mbedtls_test_ssl_check_context_after_session_reset
Ideally the implementation shouldn't be checked in git, but for the time
being there is no support in building source code for tests from the
binary folder, so it's accepted as a temporary solution.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
8294a8fd67 tests: scripts: add generate_ssl_session_reset_check.py
Togethere with the framework counterpart ('ssl_session_reset_check.py')
this script is used to automatically generate the function
'mbedtls_test_ssl_check_context_after_session_reset()'.
The goal of this function is to verify that 'mbedtls_ssl_session_reset()'
properly handled (reset or keep) all the fields of the
'mbedtls_ssl_context' structure.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
0a48608651 tests: ssl: split ssl_helpers between public and internal functions
Move functions in "ssl_helpers.h" that depend on internal headers to
"ssl_helpers_internal.h". This allows to include "ssl_helpers.h" also
in programs (which do not have access to internal headers).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Valerio Setti
3e191be15a include: ssl: add a typedef for unused data in mbedtls_ssl_config and mbedtls_ssl_context
Add mbedtls_ssl_unused_data_t type instead of embedding the union inside
both structures.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-24 14:30:59 +02:00
Ben Taylor
c438b0b9a9 Correct error handling in mbedtls_ssl_reset_checksum
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
82bba7ef61 Fix error codes for tls_transcript_error_propagation
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-24 09:33:33 +01:00
Ben Taylor
e98a0a84c3 Improve tls_transcript_error_propagation testing to check for error codes
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
414d284f4a Update regression test
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-24 09:33:33 +01:00
Ben Taylor
0bf015a43b restore missing ext_len set
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
dc555d19ec remove trailing whitespace
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
fa003af204 Update ChangeLog with CVE number
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-24 09:33:33 +01:00
Ben Taylor
75bdaa35c3 Update ChangeLog to add CVE
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-24 09:33:33 +01:00
Ben Taylor
fc2f108dfb Update dependencies for skipped test
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
14b2bdc8ce fix code style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
86b94d411c Improve ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
2e95cb7baa Update error handling of return from ssl_write_ecjpake_kkpp_ext
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
629df9f5fb Improve testing
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
835226c59a Update ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
d32397563e Fix reporters in ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
f63a0058d3 Remove check for NULL pointer
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
f487bd2e07 Tidy up ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
795eb3ee95 Add Reported by to ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
1c68ca14fb Fix code style issues
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
48593c23a0 Add fix for missing return from ssl_write_ecjpake_kkpp_ext
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
f6aeb4c8e4 Add additional fix for return with error
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
1e098f3ae9 Add client tests for RMS computation error
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
e9779ccaa3 Add unsupported trigger check
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
ed70149de3 Add further documentation to tls_abort_transcript_context
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:33 +01:00
Ben Taylor
3565231081 Fix issues with hanging seed length
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:32 +01:00
Ben Taylor
c2a26a989f Fixed code style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:32 +01:00
Ben Taylor
8e9e821ce8 refactor initialisation in tls_transcript_error_propagation, so that the variables are initialised straight after they are declared
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:32 +01:00
Ben Taylor
d137f35665 Add additional guard for sha256 in tests
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:32 +01:00
Ben Taylor
e8f3c920ed Improve layout of the code for debugging with breakpoints
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:32 +01:00
Ben Taylor
ceaa75b899 Add security impact
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:32 +01:00
Ben Taylor
b35f870331 Update ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:32 +01:00
Ben Taylor
c7f07e9288 Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:32 +01:00
Ronald Cron
ae6b06ce4c Improve dependencies and error handling
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:33:30 +01:00
Ben Taylor
5871216afc tests: ssl: add regression tests for EMS/RMS error propagation
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-24 09:30:05 +01:00
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
98e4a7b02a
Merge pull request #1595 from bjwtaylor/info-leak-in-ssl_write_new_session_ticket
Info leak in ssl write new session ticket
2026-06-24 09:42:13 +02:00
Gilles Peskine
8300fd0a65
Merge pull request #1638 from valeriosetti/issue1598
[development] PKCS7 accepts weak hashes
2026-06-23 16:40:47 +02:00
Minos Galanakis
567a3a443d Added attribution
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-23 10:52:37 +01:00
Minos Galanakis
de8a0d3fdb Added CVE
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-22 22:29:15 +01:00
Ronald Cron
27fcc8e3a0
Merge pull request #1582 from bjwtaylor/pkcs-free-stale-pointers
Add fix for stale pointer after mbedtls_pkcs7_free
2026-06-22 17:54:17 +02:00
Valerio Setti
f155d9fefd framework: update reference
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:40:07 +02:00
Valerio Setti
869bd519fb tests: pkcs7: adjust test dependencies
Newly added tests for RIPEMD160 and MD5 still require SHA-256 for the
certificate being used. SHA-1 is instead useless in this case.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
feb2c53009 pkcs7: update documentation adding a note about rejecting weak hash algs
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
f065e47b18 changelog: update documentation for PKCS7 changes
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
00a2677b1e test_suite_pkcs7: adjust numbering of tests
Some newly added tests had duplicate numbers with what was already there.
This commit fixes the duplication problem.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
64d8776ea9 pkcs7: replace MBEDTLS_ERR_PKCS7_VERIFY_FAIL with MBEDTLS_ERR_PKCS7_VERIFY_FAIL
This also updates test data.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
45654b0246 pkcs7: split MD/PK check in mbedtls_pkcs7_data_or_hash_verify
Follow the default Mbed TLS coding style and ease debugging (i.e. placing
of breakpoints).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
930b87a87e tests: pkcs7: add negative tests using MD5 and RIPEMD160
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
394d8e6a6f changelog: add note for PKCS7 rejecting weak hash algorithms
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
632c4fce0e tests: pkcs7: adjust return code in SHA-1 based PKCS7 test
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
c25e7654ea pkcs7: fail verification if MD alg or sig_alg are not secure
Add a check on mbedtls_pkcs7_data_or_hash_verify() so that the verification
fails if the MD alg specified in PKCS7 structure or the signature
algorithm specified in the X.509 certificate are not in the list of
secure algorithms (i.e. mbedtls_x509_crt_profile_default).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
395bc86df8 x509: make profile checking functions internally available
Following functions

- x509_profile_check_md_alg
- x509_profile_check_pk_alg

are made non-static and moved to x509_internal.h so that other library
files can used them.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
24a184ad36 x509_crt: add SHA3 algs to mbedtls_x509_crt_profile_default
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Valerio Setti
4e057619a9 x509_crt: remove old invalid comment
ssl_preset_default_hashes was removed in
f0cda410a4bca0f45f66bdbf0714cd0eb2ea4718 but the comment in 'x509_crt.c'
wasn't updated.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-06-22 11:39:49 +02:00
Ronald Cron
2beeff6a8e
Merge pull request #1671 from gilles-peskine-arm/badmac_seen_or_in_hsfraglen-test-dev
test badmac_seen with renegotiation #1667
2026-06-22 10:29:05 +02:00
Gilles Peskine
55bd327bad
Merge pull request #1630 from gilles-peskine-arm/basic-constaints-sequence-check-dev
Fix CA bit forgery through invalid basicConstraints
2026-06-18 15:36:41 +02:00
Ronald Cron
45ad2fc5ee
Merge pull request #10715 from Nadav0077/harden-tls13-session-load
Harden TLS 1.3 serialized session loading
2026-06-18 10:36:47 +00:00
Gilles Peskine
94370bc4e4 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-17 14:53:58 +02:00
Gilles Peskine
c2f9cf3416 Explain the "get invalid AD record .*renego" tests better
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
bba465154a 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-17 14:53:58 +02:00
Gilles Peskine
41ee1448ba 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-17 14:53:58 +02:00
Gilles Peskine
a4e7d2b11e Add tests for renegotiation with badmac_seen=1 on the server
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
05fa79dc43 Add renegotiate=2 option to ssl_client2
In `ssl_client2`, the existing option `renegotiate=1` causes the client to
initiate renegotiation immediately after the initial handshake. Add a
variant `renegotiate=2` that initiates renegotiation after one data exchange.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
ed39c7b394 Add tests for renegotiation with badmac_seen=1 on the client
After a message with a bad MAC (invalid application data record), try to
renegotiate:

* Test cases where renegotiation (nominal or delayed) is rejected.
  Nothing bad happens.
* A test where renegotiation is misparsed and rejected.
  The subsequent parsing fails.
* A test where the renegotiation request is delayed.
  This causes a heap buffer overflow in `ssl_buffer_message()`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
b1ba93460b Check "refusing renegotiation" log in more renegotiation tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
259de57a85 Add badmac_limit option to ssl_client2
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
3d088c90c4 Add one-shot bad AD options to udp_proxy
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
2475c617cb Add udp_proxy options to delay an encrypted handshake message
This can be used to simulate data messages received in the wrong epoch, or
to cause a handshake message to be buffered.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
3e76e77ee2 Test DTLS renegotiation when badmac_seen_or_in_hsfraglen != 0
Non-regression test for a bug introduced with TLS handshake defragmentation
support in Mbed TLS 3.6.3, whereby the confusion between the `badmac_seen`
meaning and the `in_hsfraglen` meaning of `ssl->badmac_seen_or_in_hsfraglen`
causes renegotiation to be processed incorrectly after receiving a message
with a bad MAC.

The bug doesn't affect Mbed TLS 4.0.0 and above, but it's still good to have
more testing.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
21df158961 Add some hooks in mbedtls_test_ssl_perform_handshake()
Let test code customize the kitchen sink function
`mbedtls_test_ssl_perform_handshake()` at a few points.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
639615337e Add a missing dependency
Needed by a test certificate.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-17 14:53:58 +02:00
Ronald Cron
5374a4124b Remove unnecessary dependency
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2026-06-17 14:53:58 +02:00
Gilles Peskine
e31c644041 Credit independent report
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-16 19:34:32 +02:00
Gilles Peskine
86b620ace3
Merge pull request #1586 from bjwtaylor/ECDHE-PSK-integer-overflow
Ecdhe psk integer overflow fix
2026-06-16 11:49:54 +02:00
Ronald Cron
9b2a6cc914
Merge pull request #1663 from minosgalanakis/public-sync/development-14062026
[Sync] Merge development into development-restricted
2026-06-16 08:44:06 +02:00
Ronald Cron
8efcd8d700
Merge pull request #1603 from bjwtaylor/oob-key-exchange-restricted
Add fix for OOB key exchange error
2026-06-15 22:42:08 +02:00
Ben Taylor
377aa4eff1 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>
2026-06-15 13:27:02 +01:00
Ben Taylor
10afc1ed5c Remove pkcs7_parse_free_resets_context as it duplicates pkcs7_parse_reuse
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
a798b5804e 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>
2026-06-15 13:27:02 +01:00
Ben Taylor
74555884cc Remove whitespace in ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
351419f1ff Correct changelog style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
84966c1bda Add further testing
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
6443590448 Update ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
4e797c14e0 Update ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
62162e6e4d Fix style issues
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
f60f5ba85c Remove redundant function from pkcs7_parse_reuse
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
e9ec4ce3ca Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Ben Taylor
67e696b430 Add fix for stale pointer after mbedtls_pkcs7_free
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-15 13:27:02 +01:00
Minos Galanakis
c508351e39 Merge remote-tracking branch 'public/development' into sync/development-14062026
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-06-14 19:32:58 +01:00
Ben Taylor
1aa1254546 Fix style issue
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-10 14:15:48 +01:00
Ronald Cron
1070ab8dd7
Merge pull request #1563 from minosgalanakis/security/mlfbyt4c_tls13_policy_bypass
TLS1.3 client HRR policy bypass[ARM-MLFBYT4C]
2026-06-10 13:04:24 +02:00
Ben Taylor
273c9b38b7 Correct syntax of MBEDTLS_GET_UINT32_BE in write_new_session_ticket_mem
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-10 08:38:36 +01:00
Ben Taylor
cecb4c2162 Correct ChangeLog style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-10 08:21:05 +01:00
Ben Taylor
911b9b67db
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>
2026-06-08 15:48:14 +01:00
Ben Taylor
0c62b498bd Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:46:00 +01:00
Ben Taylor
33c55a90e3 Improve test of non-initilisation of lifetime
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:39:17 +01:00
Ben Taylor
38185e2308 Improve robustness of tlen and lifetime variables
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:39:17 +01:00
Ben Taylor
a5c2e02198 Add fix for leak
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:39:17 +01:00
Ben Taylor
f5675fd064 Add test for leak
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:39:17 +01:00
Ben Taylor
5e04a32840
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-08 15:13:37 +01:00
Ben Taylor
4b32430d3c
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-08 15:13:02 +01:00
Ronald Cron
5cd633798c
Merge pull request #10769 from mpg/security-link-dev
Update broken link in SECURITY.md
2026-06-05 15:44:33 +00:00
Gilles Peskine
e94a7a2d22 Add CVE-ID
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
ca89089968 Add attribution for the second bug
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
402592db1d Update dependencies in forward port from 3.6
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
f624adff2e Switch to MBEDTLS_ERROR_ADD for combining X509 and ASN1 error codes
Since Mbed TLS 4.0, this is just the low-level error code. But keep the
combination for uniformity with the rest of the file, and to reduce the
differences with the 3.6 branch.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
045cede1b8 basicConstraints with leading INTEGER field: document the behavior change
Announce the security fix together with the overflow fix, since the two bugs
are pretty much indistinguishable from a black-box perspective, despite
being due to independent problems in the code.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
0d6060d644 Stop accepting basicConstraints with only pathLenConstraint
In an X.509 certificate, a basicConstraints extension where the cA
field (BOOLEAN) is omitted but the pathLenConstraint field (INTEGER )is
present is syntactically valid, but RFC 5280 states that CAs MUST NOT emit
such a certificate.

Historically, since XySSL 0.9 in 2008, if a basicConstraints extension
started with an INTEGER field, we interpreted that field as a cA value. This
was a deliberate change:

> Fixed x509_get_ext() to accept some rare certificates (like
> www.openssl.org:443) which have an INTEGER instead of a BOOLEAN for
> Extension::BasicConstraints::cA.

However, 18 years later, this does not seem to be relevant, and the details
seem to have been lost. Furthermore, major implementations follow RFC 5280
and interpret `SEQUENCE { INTEGER n }` with cA being set to its default
value (FALSE) and pathLenConstraint set to `n`. This means that such a
certificate with n != 0 would be interpreted as a CA certificate in Mbed TLS
but as a leaf certificate elsewhere, which is dangerous.

Since CAs are not supposed to emit such certificates, stop accepting them
altogether.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
5cc6fb22c6 basicConstraints pathLenConstraint tests: use standard cA type
In test cases for pathLenConstraint parsing in a basicConstraints extension
of an X.509 certificate, use the standard type for the leading cA field,
namely BOOLEAN. The test data was encoding that field as INTEGER, which was
accepted as a deviation from the standard since XySSL 0.9.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
eb051b501a Remove unreachable CSR extensionRequest check
It is now unreachable because:

- end_set == end_attr_data is enforced at library/x509_csr.c:236.
- end_exts == end_set is enforced at library/x509_csr.c:248.
- x509_csr_parse_extensions() only returns success if *p == end_exts, enforced
  at library/x509_csr.c:188.

So after a successful x509_csr_parse_extensions() call, *p == end_exts ==
end_set == end_attr_data. The condition at line 257 cannot be true.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:41 +02:00
Gilles Peskine
cc794d8501 Tighten CSR extensionRequest bounds
Don't allow parts of a compound (SEQUENCE or SET) to go beyond the
containing compound.

The inline CSR regression test is derived from the existing "X509 CSR
ASN.1 (OK)" DER test vector. In the extensionRequest attribute, the original
well-formed fragment is:

    a029 3027 06092a864886f70d01090e 311a 3018 ...

where 31 1a is the SET containing the Extensions sequence and 30 18 is the
contained Extensions sequence. The malformed test changes only the SET
length byte, from 1a to 19:

    a029 3027 06092a864886f70d01090e 3119 3018 ...

The attribute SEQUENCE length and the inner Extensions sequence length are
left unchanged. This makes the SET one byte too short for its containing
attribute, so the parser must reject it with
MBEDTLS_ERR_ASN1_LENGTH_MISMATCH instead of parsing the trailing byte as
data outside the SET.

There is no known security impact, just some risk reduction.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:38 +02:00
Ben Taylor
a7c0d83354 Add improvements to ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-05 10:22:49 +01:00
Ben Taylor
ab2a7d5a34 Add reported by and CVE placeholder
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
0501e447cc Correct style of ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
c567299ee6 Add in tests for ECDHE-PSK integer overflow
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
c058818451 Improve ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
e71e49e634 Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
baf449db7e Added fix for Integer overflow using a large ECDHE Identity
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Manuel Pégourié-Gonnard
af15f6e244 Update broken link
I believe the existing link was to the TF wiki which has been retired
for some time now.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-03 10:33:29 +02:00
Ronald Cron
5ca2218a28
Merge pull request #1589 from gilles-peskine-arm/ssl_tls13_prepare_new_session_ticket-psa_get_random-4.1
Fix ssl_tls13_prepare_new_session_ticket returning 1 on an RNG failure
2026-05-29 16:20:27 +02:00
Ronald Cron
05bd7f6429
Merge pull request #1612 from valeriosetti/issue1569
[development] TLS 1.3 certificate chain signature algorithm policy gap
2026-05-29 13:35:32 +02:00
Gilles Peskine
6c8ae1ea48 Fix lax basicConstraints parsing
When parsing the basicConstraints extension, reject junk after the SEQUENCE
inside the extension (which is probably benign), and reject a SEQUENCE that
extends beyond the extension (could be very dangerous).

Add a non-regression test where a certificate that is technically malformed,
but accepted as a leaf certificate by OpenSSL and other X.509
implementations, to be accepted as a CA certificate by Mbed TLS.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-26 21:07:09 +02:00
Gilles Peskine
22dccc1d83 Update framework with test certificate with basicConstraints overflow
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-26 21:07:09 +02:00
Janos Follath
545d1b77a2
Merge pull request #10741 from valeriosetti/fix-mbedtls_config
mbedtls_config.c missing mbedtls_platform_requirements.h
2026-05-26 09:24:54 +00:00
Minos Galanakis
e2a6f05640 ssl_write_supported_groups_ext: Updated documentation
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-26 10:17:11 +01:00
Nadav0077
fc34e72fc2
Address review: symbolic mutation constants and CID bounds-check test
Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-05-21 13:58:17 +03:00
Minos Galanakis
84667a048f test_suite_ssl: Added MBEDTLS_DEBUG_C guards to logs
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-20 12:25:42 +01:00
Minos Galanakis
95ad8b45ed test_suite_ssl: Restructured reject_hrr_selecting_unoffered_group
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-19 22:28:56 +01:00
Minos Galanakis
3d3de630db test_suite_ssl: Renamed hrr_reject_selecting_unoffered_group
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-19 17:36:12 +01:00
Minos Galanakis
7a232d0822 sll_client: align TLS 1.3 supported_groups filtering with PSA curve support
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-19 17:31:47 +01:00
Nadav0077
72f767da31
Address review comments on serialized data hardening
Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-05-19 14:15:02 +03:00
Nadav0077
fea00c3e51
Reject out-of-bounds DTLS CID length in ssl_context_load
Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-05-19 14:15:01 +03:00
Valerio Setti
147ad72669 changelog: fix typos
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-19 12:37:30 +02:00
Valerio Setti
c53e78796a changelog: add note about issue 1569 resolution
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-18 11:08:23 +02:00
Valerio Setti
a3ae8be611 ssl: improve documentation of mbedtls_ssl_conf_sig_algs()
Clarify that the 'sig_algs' set through this function are only enforced
during the key exchange and that 'mbedtls_ssl_conf_cert_profile()' should
instead be used to enforce the same algorithms when verifying certificates.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-18 11:04:59 +02:00
minosgalanakis
701132e5b3
Merge pull request #10663 from yiwu0b11/remove_unused_ffdh_code
Remove FFDH-specific code from compat.sh
2026-05-13 16:49:20 +00:00
Minos Galanakis
848ddaaedb test_suite_ssl: doc fixes
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-13 11:33:40 +01:00
Ben Taylor
ea9dc9c396 Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-05-13 11:16:49 +01:00
Nadav0077
3f972d014d
Use block-local ret to avoid unused-variable in restricted configs
Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-05-12 19:32:50 +03:00
Minos Galanakis
5936ba523d Added ChangeLog
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-12 14:59:18 +01:00
Ronald Cron
00be9c9b67
Merge pull request #10700 from gilles-peskine-arm/python-project-knowledge-directory-mbedtls-dev
Create Python project knowledge directory
2026-05-12 13:38:23 +00:00
Manuel Pégourié-Gonnard
4a1d150cdf
Merge pull request #1600 from mpg/development-restricted
Merge public development into -restricted
2026-05-12 08:59:49 +02:00
Ben Taylor
08e3e3f81e Add fix for OOB key exchange error
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-05-11 15:22:09 +01:00
Manuel Pégourié-Gonnard
00dfa64627 Merge branch 'development' into development-restricted
* development: (46 commits)
  Update tf-psa-crypto pointer to bring in fix for python imports
  Update framework pointer to bring in fix for python imports
  check_config: fix error message for missing TLS 1.2 key exchanges
  check_config: add check for TLS 1.3 key exchanges
  update ChangeLog
  Pacify uncrustify
  ChangeLog: Fixed a reference to TF-PSA-Crypto
  ssl: add TLS 1.2 RSA-PSS debug trace
  add ChangeLog
  Fix build warning/error using llvm-mingw
  ssl: narrow TLS 1.2 RSA-PSS handling and add interop coverage
  test: improve symlink checks
  test: versioned symlink order fix
  test: reorder if-else structure
  test: add debug output and fix for win config
  ChangeLog fix
  Unify TF-PSA-Crypto and mbedtls templates
  tests: fix DESTDIR install checks and add macOS compatibility
  ChangeLog fixes
  Update crypto submodule with analyze_outcomes.py
  ...
2026-05-11 12:04:15 +02:00
Manuel Pégourié-Gonnard
902b012537
Merge pull request #10749 from bjwtaylor/broken-build
Update framework pointer to bring in fix for python imports
2026-05-07 19:13:19 +00:00
Ben Taylor
954e236500 Update tf-psa-crypto pointer to bring in fix for python imports
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-05-07 14:17:54 +01:00
Ben Taylor
02fb4c75cb Update framework pointer to bring in fix for python imports
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-05-07 08:14:43 +01:00
Minos Galanakis
89a0606118 Adjusted dependecies for hrr_reject_unadvertised_group
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-06 11:19:39 +01:00
Valerio Setti
cd8b3878c5 changelog: add note about fix of issue 10740
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-04-29 17:05:51 +02:00
Valerio Setti
b155a58ab5 include mbedtls_platform_requirements.h in mbedtls_config.c
This is required because if the user defined configuration file (not the
default one provided by mbedtls) includes files from the standard
C library then __STDC_WANT_LIB_EXT1__ won't be defined there which
cause weird build failures.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-04-29 16:57:55 +02:00
minosgalanakis
d12fbb991c
Merge pull request #10695 from valord577/patch-1
Fix build warning/error using llvm-mingw
2026-04-29 14:52:00 +00:00
Gilles Peskine
a314ada082
Merge pull request #10631 from yiwu0b11/destdir_install_env_support
Support DESTDIR for install and add build-system test
2026-04-29 14:37:29 +00:00
Nadav0077
3ab4fce1a0
Harden TLS 1.3 serialized session loading
Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-04-25 15:19:30 +03:00
Valerio Setti
ae8579f2a2
Merge pull request #10650 from valeriosetti/fix-tls13-guard
check_config: add missing check for TLS 1.3 key exchanges
2026-04-24 14:32:36 +00:00
Minos Galanakis
a9a8385747 test_suite_ssl: Introduced hrr_reject_unadvertised_group
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-04-24 12:04:36 +01:00
Valerio Setti
51b62060de
Merge pull request #10639 from valeriosetti/ecdhe-rsa-fix-check
library: check_config: remove RSA encryption requirement from ECDHE-RSA
2026-04-24 07:30:47 +00:00
Gilles Peskine
52ca15362b Update comment
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-22 17:38:48 +02:00
Valerio Setti
c3d52b905b check_config: fix error message for missing TLS 1.2 key exchanges
Align the error message to the one used for the same check in TLS 1.3.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-04-22 15:00:55 +02:00
Valerio Setti
5ea77200d9 check_config: add check for TLS 1.3 key exchanges
When MBEDTLS_SSL_PROTO_TLS1_3 is enabled ensure that at least one of the
related key exchanges is also enabled.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-04-22 15:00:54 +02:00
valord577
68319cbc80 update ChangeLog
Signed-off-by: valord577 <valord577@gmail.com>
2026-04-22 11:05:04 +08:00
valord577
e022733f9f
Merge branch 'Mbed-TLS:development' into patch-1 2026-04-22 10:41:51 +08:00
Minos Galanakis
9027620393 tls13_client: fix HRR selected_group validation
Reject HRR selected_group unless it matches the client’s original
supported_groups and is locally supported, so unadvertised groups are not
accepted in the second ClientHello.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-04-21 17:07:36 +01:00
Ronald Cron
391af7c976
Merge pull request #10701 from minosgalanakis/docs/4.1.0_changelog_fixes
ChangeLog: Fixed a reference to TF-PSA-Crypto
2026-04-20 09:38:38 +00:00
Ronald Cron
518ed0337d
Merge pull request #10672 from Maokaman1/fix/tls12-rsa-pss-sigalgs
ssl: accept TLS 1.2 rsa_pss_rsae signature algorithms
2026-04-20 08:03:39 +00:00
Viktor Sokolovskiy
f90e81c7f8 Pacify uncrustify
Signed-off-by: Viktor Sokolovskiy <maokaman@gmail.com>
2026-04-18 01:51:17 +03:00
Maokaman1
78336bb5bd
Merge branch 'Mbed-TLS:development' into fix/tls12-rsa-pss-sigalgs 2026-04-17 19:13:43 +03:00
Minos Galanakis
935eb1a53b ChangeLog: Fixed a reference to TF-PSA-Crypto
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-04-17 16:59:05 +01:00
Viktor Sokolovskiy
3d61c38ea0 ssl: add TLS 1.2 RSA-PSS debug trace
Signed-off-by: Viktor Sokolovskiy <maokaman@gmail.com>
2026-04-17 17:36:31 +03:00
Gilles Peskine
cf0bbfd024 Prefer to load tf_psa_crypto_test_case_info from project_knowledge
Try to load the list of tests that TF-PSA-Crypto wants us to ignore in three
ways, depending on the age of the tf-psa-crypto submodule:

* Modern: import `tf_psa_crypto_test_case_info` as an ordinary module,
  expected to be found in `tf-psa-crypto/scripts/project_knowledge`.
* First location, quickly superseded: load
  `tf-psa-crypto/tests/scripts/tf_psa_crypto_test_case_info.py`,
  in a hackish way because we don't want to put that directory on the
  load path.
* Oldest: there is no `tf_psa_crypto_test_case_info.py`. Use a hard-coded
  list.

Once all the TF-PSA-Crypto branches we care about (e.g. pull requests
in progress) are updated with
`tf-psa-crypto/scripts/project_knowledge/tf_psa_crypto_test_case_info.py`,
we can drop the backward compatibilty hacks and simply
`import tf_psa_crypto_test_case_info` unconditionally and use
`tf_psa_crypto_test_case_info.INTERNAL_TEST_CASES` unconditionally.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-16 19:17:02 +02:00
Gilles Peskine
d934b7b751 Add tf-psa-crypto/scripts/project_knowledge to Python load path
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-16 19:16:30 +02:00
valord577
37b81f13c7 add ChangeLog
Signed-off-by: valord577 <valord577@gmail.com>
2026-04-16 15:17:32 +08:00
valord577
a3d3ede9d6
Fix build warning/error using llvm-mingw
error logs refs: https://github.com/valord577/nativepkgs/actions/runs/24490614774/job/71574726128

Signed-off-by: valord577 <valord577@gmail.com>
2026-04-16 14:31:55 +08:00
Viktor Sokolovskiy
2168fe9cda ssl: narrow TLS 1.2 RSA-PSS handling and add interop coverage
Signed-off-by: Viktor Sokolovskiy <maokaman@gmail.com>
2026-04-16 04:36:48 +03:00
Yi Wu
970df30a8f test: improve symlink checks
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-04-15 12:13:09 +01:00
Gilles Peskine
8426c9bc51
Merge pull request #10684 from gilles-peskine-arm/maintainer-scripts-create-directory-dev
development: Create a directory for maintainer-only Python scripts
2026-04-15 08:19:36 +00:00
Gilles Peskine
8bf89416cf
Merge pull request #10647 from gilles-peskine-arm/github-pr-template-add-4.1-mbedtls
Add 1.1 line to the PR template
2026-04-15 08:17:24 +00:00
Yi Wu
0c02d74a48 test: versioned symlink order fix
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-04-14 11:06:16 +01:00
Yi Wu
f38b17e7a0 test: reorder if-else structure
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-04-14 10:12:44 +01:00
Yi Wu
331ad77fe2 test: add debug output and fix for win config
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-04-13 15:13:52 +01:00
Yi Wu
6fb557c31a ChangeLog fix
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-04-13 15:00:44 +01:00
Gilles Peskine
6b31bc6885 Unify TF-PSA-Crypto and mbedtls templates
Following the team discussion, don't suggest "prerequisite" or "consuming"
in the template. Suggest linking all the pull requests in a group
everywhere.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-13 14:57:07 +02:00
Yi Wu
e9e0409b11 tests: fix DESTDIR install checks and add macOS compatibility
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-04-13 12:48:01 +01:00
Yi Wu
15be9e9048 ChangeLog fixes
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-04-13 12:12:24 +01:00
Gilles Peskine
2a7d1ece77
Merge pull request #10676 from gilles-peskine-arm/analyze_outcomes-read_crypto
Let TF-PSA-Crypto define test cases that Mbed TLS does not need to cover
2026-04-13 09:24:21 +00:00
Gilles Peskine
cc134b0b94 Update crypto submodule with analyze_outcomes.py
Update framework to match.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-10 14:49:14 +02:00
Yi Wu
f14f28ce75 ChangeLog padding space fix
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-04-10 10:27:09 +01:00
Gilles Peskine
9248af96b1 Create a directory for maintainer-only Python scripts
This directory is currently excluded from `check-python-files.sh`, because
we run it on the CI in an old Python version that doesn't support some of
our new maintainer scripts.

There are no such scripts in mbedtls for now (only in TF-PSA-Crypto), but be
ready if we want to add some.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-09 19:39:42 +02:00
Gilles Peskine
806e1d365b Documentation improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-08 17:22:10 +02:00
Gilles Peskine
d25f03919a INTERNAL_TEST_CASES moved to a separate data-only module
This way, when Mbed TLS's `analyze_outcomes.py` loads the python module from
TF-PSA-Crypto (because it needs to know the value of `INTERNAL_TEST_CASES`),
there's no risk that the subproject and the superproject will have different
requirements on auxiliary modules such as `mbedtls_framework.outcome_analysis`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-08 15:47:49 +02:00
Gilles Peskine
16a90a556e Add copyright line
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-08 15:31:52 +02:00
Viktor Sokolovskiy
f75c033ead ssl: add TLS 1.2 RSA-PSS regression coverage
Signed-off-by: Viktor Sokolovskiy <maokaman@gmail.com>
2026-04-07 20:20:09 +03:00
Gilles Peskine
667a3f6442 Move test currently covered by crypto from uncovered list to ignored list
If we can't read `INTERNAL_TEST_CASES` from
`tf-psa-crypto/tests/scripts/analyze_outcomes.py` because the script doesn't
exist, hard-code the legacy value of that information.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-07 11:47:24 +02:00
Gilles Peskine
1978e1bd6b Ignore test cases that TF-PSA-Crypto tells us to ignore
If the `tf-psa-crypto` submodule has `tests/scripts/analyze_outcomes.py`,
require it to define a global variable `INTERNAL_TEST_CASES`. Those test
cases will be ignored in Mbed TLS's coverage analysis.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-07 11:47:13 +02:00
Gilles Peskine
bb5cfbbdec Move _has_word_re to the framework
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-07 11:06:39 +02:00
Gilles Peskine
68d6b07287 Rename IGNORED_TESTS to UNCOVERED_TESTS
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-07 11:06:39 +02:00
Gilles Peskine
619f1acd75 Update framework with UNCOVERED_TESTS in outcome analysis
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-07 11:06:39 +02:00
Viktor Sokolovskiy
c064ba0edb ssl: accept TLS 1.2 rsa_pss_rsae signature schemes
Signed-off-by: Viktor Sokolovskiy <maokaman@gmail.com>
2026-04-04 03:57:04 +03:00
David Horstmann
0333486837
Merge pull request #10670 from gilles-peskine-arm/security-md-mention-compiler-4.x
mbedtls: Mention compiler optimization in the threat model
2026-04-01 15:43:26 +00:00
Gilles Peskine
d1f0ce8493 Be more specific about what compiler options we consider legitimate
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-01 11:08:46 +02:00
Gilles Peskine
54ebb9b42d Mention the new advice about compiler options in the changelog
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-01 11:08:46 +02:00
Gilles Peskine
be18f3f4a5 Add a section about compiler-introduced timing side channels
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-04-01 11:08:46 +02:00
Yi Wu
3df1f043be tests: remove remaining FFDH code in compat.sh
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-03-30 16:07:45 +01:00
Yi Wu
532db3d49e Test: add symlinks and dangling link check
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-03-26 09:27:41 +00:00
Ben Taylor
5554a33fb2 Add ret return pattern to avoid variable ret was set but never used warning
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-03-25 15:27:58 +00:00
Valerio Setti
a201a74b7d tests: depends.py: extend pkalgs including PSA_WANT_ALG_RSA_PKCS1V15_SIGN
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-03-19 17:50:26 +01:00
Valerio Setti
63df2f79a4 tests: depends.py: fix reverse dependency for RSA
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-03-19 17:50:26 +01:00
Valerio Setti
52379636c5 library: check_config: remove RSA encryption requirement from ECDHE-RSA
ECDHE-RSA only requires RSA signature, not encryption. This commits fixes
guards in "mbedtls_check_config.h".

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2026-03-19 17:50:26 +01:00
Gilles Peskine
c2139f8887 Add repository shortcut suggestion
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-19 16:39:08 +01:00
Gilles Peskine
10988b0477 Clarify prerequisite, consuming or side PR
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-19 15:29:08 +01:00
Gilles Peskine
72330cac94 Add 4.1 backport line to the PR template
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-03-19 15:25:14 +01:00
Yi Wu
a8a1111827 ChangeLog fix
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-03-13 10:16:30 +00:00
Yi Wu
287d0a8d3c ChangeLog newline fix
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-03-13 10:11:42 +00:00
Yi Wu
d9fa082e30 Add changelog
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-03-10 11:04:06 +00:00
Yi Wu
b6ef9ec78f Support DESTDIR for install and add build-system test
Signed-off-by: Yi Wu <yi.wu2@arm.com>
2026-03-05 17:32:51 +00:00
19 changed files with 51 additions and 75 deletions

View File

@ -9,13 +9,14 @@ Please write a few sentences describing the overall goals of the pull request's
Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.
- [ ] **changelog** provided | not required because:
- [ ] **development PR** provided # | not required because:
- [ ] **TF-PSA-Crypto PR** provided # | not required because:
- [ ] **changelog** provided | not required because:
- [ ] **framework PR** provided Mbed-TLS/mbedtls-framework# | not required
- [ ] **3.6 PR** provided # | not required because:
- **tests** provided | not required because:
- [ ] **TF-PSA-Crypto development PR** provided Mbed-TLS/TF-PSA-Crypto# | not required because:
- [ ] **TF-PSA-Crypto 1.1 PR** provided Mbed-TLS/TF-PSA-Crypto# | not required because:
- [ ] **mbedtls development PR** provided # | not required because:
- [ ] **mbedtls 4.1 PR** provided # | not required because:
- [ ] **mbedtls 3.6 PR** provided # | not required because:
- **tests** provided | not required because:
## Notes for the submitter

View File

@ -37,7 +37,7 @@ cmake_policy(SET CMP0011 NEW)
# is deprecated and will be removed in future versions.
cmake_policy(SET CMP0012 NEW)
set(MBEDTLS_VERSION 4.1.1)
set(MBEDTLS_VERSION 4.2.0)
set(MBEDTLS_CRYPTO_SOVERSION 18)
set(MBEDTLS_X509_SOVERSION 9)
set(MBEDTLS_TLS_SOVERSION 23)

View File

@ -1,6 +1,6 @@
Mbed TLS ChangeLog (Sorted per branch, date)
= Mbed TLS 4.1.1 branch released 2026-07-07
= Mbed TLS 4.2.0 branch released 2026-07-07
Features
* Restore DESTDIR support for CMake installs of compatibility
@ -32,7 +32,7 @@ Security
man-in-the-middle attacker to cause loss of 0-RTT early data.
Reported by Ben Smyth.
* Fix a remote buffer overflow in (D)TLS with ECDHE-PSK cipher suites when
CBC is disabled. Reported by Karnakar Reddy. CVE-ID-50580
CBC is disabled. Reported by Karnakar Reddy. CVE-2026-50580
* Fix a potential information disclosure in TLS 1.2 servers using session
tickets. If the session ticket write callback failed without setting the
lifetime output parameter, Mbed TLS could send 4 bytes of uninitialized
@ -47,9 +47,7 @@ Security
signed_data.signers.next pointers cannot be walked by a later free
operation. CVE-2026-50579
* PKCS7 now rejects weak hash algorithms (RIPEMD160, MD5, SHA-1, SHA-224,
SHA3-224) on signature verification. The new configuration option
MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES allows to keep using weak hash
algorithms in PKCS7 for backward compatibility purposes.
SHA3-224) on signature verification.
* Improved documentation of mbedtls_ssl_conf_sig_algs() to emphasize that
this function only sets signature algorithms that are enforced during
TLS key exchange and not on certificate verification. Reported by
@ -94,7 +92,7 @@ Bugfix
wrappers do not exactly contain the requested extensions.
Changes
* Upgraded TF-PSA-Crypto from 1.1.0 to 1.1.1. See tf-psa-crypto/ChangeLog.
* Upgraded TF-PSA-Crypto from 1.1.0 to 1.2.0. See tf-psa-crypto/ChangeLog.
* X.509 certificates with a basicConstraints extension starting with an
INTEGER field are no longer accepted. According to RFC 5280, such
certificates are syntactically valid and the first field is the

View File

@ -10,7 +10,7 @@
*/
/**
* @mainpage Mbed TLS v4.1.1 API Documentation
* @mainpage Mbed TLS v4.2.0 API Documentation
*
* This documentation describes the application programming interface (API)
* of Mbed TLS.

View File

@ -1,4 +1,4 @@
PROJECT_NAME = "Mbed TLS v4.1.1"
PROJECT_NAME = "Mbed TLS v4.2.0"
OUTPUT_DIRECTORY = ../apidoc/
FULL_PATH_NAMES = NO
OPTIMIZE_OUTPUT_FOR_C = YES

@ -1 +1 @@
Subproject commit dde0c4a0e448a0552f18817dcea633bb851fd288
Subproject commit a3079552234917a9831dd70693983af5e62c70de

View File

@ -27,17 +27,17 @@
* Major, Minor, Patchlevel
*/
#define MBEDTLS_VERSION_MAJOR 4
#define MBEDTLS_VERSION_MINOR 1
#define MBEDTLS_VERSION_PATCH 1
#define MBEDTLS_VERSION_MINOR 2
#define MBEDTLS_VERSION_PATCH 0
/**
* The single version number has the following structure:
* MMNNPP00
* Major version | Minor version | Patch version
*/
#define MBEDTLS_VERSION_NUMBER 0x04010100
#define MBEDTLS_VERSION_STRING "4.1.1"
#define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 4.1.1"
#define MBEDTLS_VERSION_NUMBER 0x04020000
#define MBEDTLS_VERSION_STRING "4.2.0"
#define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 4.2.0"
#if defined(MBEDTLS_CONFIG_FILES_READ)
#error "Something went wrong: MBEDTLS_CONFIG_FILES_READ defined before reading the config files!"

View File

@ -1036,15 +1036,6 @@
*/
#define MBEDTLS_PKCS7_C
/**
* \def MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
*
* Allow weak signature algorithms (RIPEMD160, MD5, SHA-1) in PKCS#7.
*
* Requires: MBEDTLS_PKCS7_C
*/
// #define MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
/**
* \def MBEDTLS_X509_CREATE_C
*

View File

@ -32,11 +32,9 @@
* - The RFC allows for the signed Data type to contain contentInfo. This
* implementation assumes the type is DATA and the content is empty.
* - The RFC doesn't put any constrain on the hash algorithm to be used, but
* this implementation by default rejects weak hash algorithms (i.e. RIPEMD160,
* MD5, SHA-1, SHA-224, SHA3-224). In general accepted hash algorithms
* are the ones belonging to ::mbedtls_x509_crt_profile_default.
* #MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES can be enabled to accept all
* supported hash algorithms.
* this implementation rejects weak hash algorithms (i.e. RIPEMD160, MD5,
* SHA-1, SHA-224, SHA3-224). In general accepted hash and PK algorithms are
* the ones belonging to `mbedtls_x509_crt_profile_default`.
*/
#ifndef MBEDTLS_PKCS7_H

View File

@ -665,7 +665,6 @@ static int mbedtls_pkcs7_data_or_hash_verify(mbedtls_pkcs7 *pkcs7,
return ret;
}
#if !defined(MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES)
/* Ensure the MD alg from the PKCS#7 context and signature algorithm from
* the certificate belong to the list of secure algorithms
* (i.e. mbedtls_x509_crt_profile_default). */
@ -677,7 +676,6 @@ static int mbedtls_pkcs7_data_or_hash_verify(mbedtls_pkcs7 *pkcs7,
if (ret != 0) {
return MBEDTLS_ERR_PKCS7_INVALID_ALG;
}
#endif /* MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES */
md_info = mbedtls_md_info_from_type(md_alg);
if (md_info == NULL) {

View File

@ -341,11 +341,12 @@ static int ssl_tls13_parse_certificate_verify(mbedtls_ssl_context *ssl,
MBEDTLS_SSL_DEBUG_BUF(3, "verify hash", verify_hash, verify_hash_len);
if ((ret = mbedtls_pk_verify_ext((mbedtls_pk_sigalg_t) sig_alg,
&ssl->session_negotiate->peer_cert->pk,
md_alg, verify_hash, verify_hash_len,
p, signature_len)) == 0) {
return 0;
ret = mbedtls_pk_verify_ext((mbedtls_pk_sigalg_t) sig_alg,
&ssl->session_negotiate->peer_cert->pk,
md_alg, verify_hash, verify_hash_len,
p, signature_len);
if (ret == 0) {
return ret;
}
MBEDTLS_SSL_DEBUG_RET(1, "mbedtls_pk_verify_ext", ret);

View File

@ -9,7 +9,6 @@ MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
MBEDTLS_NET_C
MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
MBEDTLS_PKCS7_C
MBEDTLS_PSK_MAX_LEN
MBEDTLS_SSL_ALL_ALERT_MESSAGES

View File

@ -188,7 +188,7 @@ foreach my $match (@matches)
$first = 0;
foreach my $dep (split(/,/, ${$old_define_name}))
{
${$code_check} .= " || \n " if ($first++);
${$code_check} .= " ||\n " if ($first++);
${$code_check} .= "${$old_define_prefix}${dep}${$old_define_suffix}";
}
${$code_check} .= " */\n\n";
@ -229,7 +229,7 @@ if ($ll_old_define[0] ne "")
my $first = 0;
foreach my $dep (split(/,/, $ll_old_define[0]))
{
$ll_code_check .= " || \n " if ($first++);
$ll_code_check .= " ||\n " if ($first++);
$ll_code_check .= "${ll_old_define[1]}${dep}${ll_old_define[2]}";
}
$ll_code_check .= " */\n";
@ -240,7 +240,7 @@ if ($hl_old_define[0] ne "")
my $first = 0;
foreach my $dep (split(/,/, $hl_old_define[0]))
{
$hl_code_check .= " || \n " if ($first++);
$hl_code_check .= " ||\n " if ($first++);
$hl_code_check .= "${hl_old_define[1]}${dep}${hl_old_define[2]}";
}
$hl_code_check .= " */\n";

View File

@ -14116,7 +14116,6 @@ run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \
-c "Protocol is TLSv1.2" \
-c "HTTP/1.0 200 [Oo][Kk]"
requires_gnutls_tls1_3
requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2
requires_config_enabled MBEDTLS_DEBUG_C

View File

@ -95,29 +95,17 @@ depends_on:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY
pkcs7_verify:"../framework/data_files/pkcs7_data_cert_signed_sha256.der":"../framework/data_files/pkcs7-rsa-sha256-1.der":"../framework/data_files/pkcs7_data.bin":MBEDTLS_MD_SHA256:0
PKCS7 Signed Data Verification Fail SHA1 #10
depends_on:PSA_WANT_ALG_SHA_1:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY:!MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
depends_on:PSA_WANT_ALG_SHA_1:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY
pkcs7_verify:"../framework/data_files/pkcs7_data_cert_signed_sha1.der":"../framework/data_files/pkcs7-rsa-sha256-1.der":"../framework/data_files/pkcs7_data.bin":0:MBEDTLS_ERR_PKCS7_INVALID_ALG
PKCS7 Signed Data Verification Pass SHA1 #10
depends_on:PSA_WANT_ALG_SHA_1:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY:MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
pkcs7_verify:"../framework/data_files/pkcs7_data_cert_signed_sha1.der":"../framework/data_files/pkcs7-rsa-sha256-1.der":"../framework/data_files/pkcs7_data.bin":0:0
PKCS7 Signed Data Verification Fail MD5 #10.1
depends_on:PSA_WANT_ALG_MD5:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY:!MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
depends_on:PSA_WANT_ALG_MD5:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY
pkcs7_verify:"../framework/data_files/pkcs7_data_cert_signed_md5.der":"../framework/data_files/pkcs7-rsa-sha256-1.der":"../framework/data_files/pkcs7_data.bin":0:MBEDTLS_ERR_PKCS7_INVALID_ALG
PKCS7 Signed Data Verification Pass MD5 #10.1
depends_on:PSA_WANT_ALG_MD5:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY:MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
pkcs7_verify:"../framework/data_files/pkcs7_data_cert_signed_md5.der":"../framework/data_files/pkcs7-rsa-sha256-1.der":"../framework/data_files/pkcs7_data.bin":0:0
PKCS7 Signed Data Verification Fail RIPEMD160 #10.2
depends_on:PSA_WANT_ALG_RIPEMD160:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY:!MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
depends_on:PSA_WANT_ALG_RIPEMD160:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY
pkcs7_verify:"../framework/data_files/pkcs7_data_cert_signed_ripemd160.der":"../framework/data_files/pkcs7-rsa-sha256-1.der":"../framework/data_files/pkcs7_data.bin":0:MBEDTLS_ERR_PKCS7_INVALID_ALG
PKCS7 Signed Data Verification Pass RIPEMD160 #10.2
depends_on:PSA_WANT_ALG_RIPEMD160:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY:MBEDTLS_PKCS7_ALLOW_WEAK_SIGNATURES
pkcs7_verify:"../framework/data_files/pkcs7_data_cert_signed_ripemd160.der":"../framework/data_files/pkcs7-rsa-sha256-1.der":"../framework/data_files/pkcs7_data.bin":0:0
PKCS7 Signed Data Verification Pass SHA512 #11
depends_on:PSA_WANT_ALG_SHA_512:PSA_WANT_ALG_SHA_256:PSA_HAVE_ALG_RSA_PKCS1V15_VERIFY
pkcs7_verify:"../framework/data_files/pkcs7_data_cert_signed_sha512.der":"../framework/data_files/pkcs7-rsa-sha256-1.der":"../framework/data_files/pkcs7_data.bin":0:0

View File

@ -1,8 +1,8 @@
Check compile time library version
check_compiletime_version:"4.1.1"
check_compiletime_version:"4.2.0"
Check runtime library version
check_runtime_version:"4.1.1"
check_runtime_version:"4.2.0"
Check for MBEDTLS_VERSION_C
check_feature:"MBEDTLS_VERSION_C":0

View File

@ -1769,15 +1769,15 @@ x509parse_crt:"307d3068a0030201008204deadbeef300d06092a864886f70d01010b0500300c3
X509 CRT ASN1 (TBS, inv SubPubKeyInfo, inv internal bitstring length)
depends_on:PSA_HAVE_ALG_SOME_RSA_VERIFY:PSA_WANT_ALG_SHA_256
x509parse_crt:"308180306ba0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a300806001304546573743015300d06092A864886F70D0101010500030400300000300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_PUBKEY
x509parse_crt:"308180306ba0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a300806001304546573743015300d06092A864886F70D0101010500030400300000300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_ALG
X509 CRT ASN1 (TBS, inv SubPubKeyInfo, inv internal bitstring tag)
depends_on:PSA_HAVE_ALG_SOME_RSA_VERIFY:PSA_WANT_ALG_SHA_256
x509parse_crt:"308180306ba0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a300806001304546573743015300d06092A864886F70D0101010500030400310000300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_PUBKEY
x509parse_crt:"308180306ba0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a300806001304546573743015300d06092A864886F70D0101010500030400310000300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_ALG
X509 CRT ASN1 (TBS, inv SubPubKeyInfo, inv RSA modulus)
depends_on:PSA_HAVE_ALG_SOME_RSA_VERIFY:PSA_WANT_ALG_SHA_256
x509parse_crt:"3081873072a0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a30080600130454657374301c300d06092A864886F70D0101010500030b0030080202ffff0302ffff300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_PUBKEY
x509parse_crt:"3081873072a0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a30080600130454657374301c300d06092A864886F70D0101010500030b0030080202ffff0302ffff300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_ALG
X509 CRT ASN1 (TBS, inv SubPubKeyInfo, total length mismatch)
depends_on:PSA_HAVE_ALG_SOME_RSA_VERIFY:PSA_WANT_ALG_SHA_256
@ -1785,11 +1785,11 @@ x509parse_crt:"3081893074a0030201008204deadbeef300d06092a864886f70d01010b0500300
X509 CRT ASN1 (TBS, inv SubPubKeyInfo, check failed)
depends_on:PSA_HAVE_ALG_SOME_RSA_VERIFY:PSA_WANT_ALG_SHA_256
x509parse_crt:"3081873072a0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a30080600130454657374301c300d06092A864886F70D0101010500030b0030080202ffff0202ffff300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_PUBKEY
x509parse_crt:"3081873072a0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a30080600130454657374301c300d06092A864886F70D0101010500030b0030080202ffff0202ffff300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_ALG
X509 CRT ASN1 (TBS, inv SubPubKeyInfo, check failed, expanded length notation)
depends_on:PSA_HAVE_ALG_SOME_RSA_VERIFY:PSA_WANT_ALG_SHA_256
x509parse_crt:"308196308180a0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a30080600130454657374302a300d06092A864886F70D010101050003190030160210fffffffffffffffffffffffffffffffe0202ffff300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_PUBKEY
x509parse_crt:"308196308180a0030201008204deadbeef300d06092a864886f70d01010b0500300c310a30080600130454657374301c170c303930313031303030303030170c303931323331323335393539300c310a30080600130454657374302a300d06092A864886F70D010101050003190030160210fffffffffffffffffffffffffffffffe0202ffff300d06092a864886f70d01010b0500030200ff":"":MBEDTLS_ERR_PK_INVALID_ALG
# We expect an extension parsing error here because the IssuerID is optional.
# Hence, if we find an ASN.1 tag doesn't match the IssuerID, we assume the

View File

@ -1136,12 +1136,15 @@ void x509parse_crt(data_t *buf, char *result_str, int result)
#else
((void) result_str);
#endif
/* Tests whose result is MBEDTLS_ERR_PK_INVALID_PUBKEY might return
* MBEDTLS_ERR_ASN1_UNEXPECTED_TAG until psa#308 is merged. This variable
* is therefore used for backward compatiblity and will be removed in
* mbedtls#10229. */
int result_back_comp = result;
int res;
/* After psa#827 some failing tests that were returning MBEDTLS_ERR_PK_INVALID_PUBKEY
* will return MBEDTLS_ERR_PK_INVALID_ALG instead. We need a temporary
* backward compatibility fix until psa#827 is merged.
*/
int result_back_comp = result;
if (result == MBEDTLS_ERR_PK_INVALID_ALG) {
result_back_comp = MBEDTLS_ERR_PK_INVALID_PUBKEY;
}
mbedtls_x509_crt_init(&crt);
USE_PSA_INIT();

@ -1 +1 @@
Subproject commit a0632be94d883daa0295ac1eabf70359ad94f91b
Subproject commit a92cb6a97d84762d2f4355eae99af7b9ff5c6ae1