1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-06-24 22:29:04 +08:00

33245 Commits

Author SHA1 Message Date
Valerio Setti
3de417fce2 scripts: generate_visualc_files.pl: prepare for Everest headers relocation
This change allows the Perl script to manage Everest headers in
tf-psa-crypto repo both before and after psa#235. Once psa#235 will be
merged this commit can be simplified, i.e. it will be returned to its
original state with paths of Everest headers updated.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-06-16 15:04:27 +02:00
Ben Taylor
83e5a7bf75 update framework submodule to pull in everest changes
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-06-05 11:26:51 +01:00
Ben Taylor
de864e7a1c Remove ChangeLog as it is not required
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-06-05 11:26:51 +01:00
Ben Taylor
40bc348963 corrected ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-06-05 11:26:51 +01:00
Ben Taylor
142347383f Add ChangeLog for removal of everest headers
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-06-05 11:26:51 +01:00
Ben Taylor
243b54f386 update further everest paths
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-06-05 11:26:51 +01:00
Ben Taylor
2d6374a0f9 adjust everest header paths in generate_visualc_files.pl
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-06-05 11:26:51 +01:00
Bence Szépkúti
591d854b1a
Merge pull request #10201 from gabor-mezei-arm/9144_SHA3_testing
Add temporary test component for SHA3 testing
2025-06-02 17:52:07 +00:00
Gabor Mezei
b9d728467a
Fix calling config.py and update comment
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-06-02 17:22:53 +02:00
Gabor Mezei
8e5ee478e1
Add temporary component for SHA3 testing
With the removal of MBEDTLS_SHA3_C the test cases with disabled SHA3
dependency are never executed. Adding a temporary `all.sh` component
which disabling the `PSA_WANT_ALG_SHA3_*` macros to cover
these test cases.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-06-02 13:28:39 +02:00
Gilles Peskine
80b697d78a
Merge pull request #10183 from felixc-arm/fix-ssl-opt-error-codes
Change hardcoded error values in ssl-opt to take in the PSA error alias
2025-05-27 14:52:51 +00:00
Ronald Cron
36f424e240
Merge pull request #10190 from valeriosetti/prerequisites-for-ecp-restartable
[development] Some prerequisites for PR #10187
2025-05-26 15:15:23 +00:00
Valerio Setti
4a2e7b9ed8 tests: suite_x509parse: set PSA max operations in x509_verify_restart()
Set also psa_interruptible_set_max_ops() when mbedtls_ecp_set_max_ops()
is set so that the same amount of operations will be used both if legacy
ECDSA_C or PSA is used under the hood to perform the operation.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-23 15:15:22 +02:00
Valerio Setti
153a906a51 library: debug: remove mbedtls_debug_printf_ecdh()
The function is not used anywhere and can be removed.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-23 15:08:48 +02:00
Valerio Setti
28ef01a3c1 library: debug: make mbedtls_debug_print_psa_ec() static
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-23 15:03:26 +02:00
Gilles Peskine
127c78e589
Merge pull request #10133 from bjwtaylor/remove-compat-2
remove compat-2.x.h
2025-05-23 09:57:49 +00:00
Manuel Pégourié-Gonnard
768f90f3c3
Merge pull request #10186 from mpg/rm-pk-decrypt
Remove call to pk_decrypt() in ssl_server2
2025-05-21 12:47:55 +00:00
Manuel Pégourié-Gonnard
92a9bd345c Remove call to pk_decrypt() in ssl_server2
We no longer use decrypt TLS 1.2 (never did in 1.3) so we no longer need
this path. Further simplifications could probably be made (we currently
have an enum type with only one possible value...) but for now I'm
trying to keep changes minimal.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-05-20 12:04:26 +02:00
Manuel Pégourié-Gonnard
66c6aaacf6
Merge pull request #10177 from gilles-peskine-arm/union-initialization-gcc15-basic-fix-dev
Test with GCC 15 with sloppy union initialization
2025-05-20 09:56:51 +00:00
Felix Conway
e0ce40bc8f Change hardcoded error values in ssl-opt to take in the PSA error alias
ssl-opt checks for specific error code values in the output, but as
MBEDTLS_ERR_ECP_IN_PROGRESS is becoming an alias of PSA_OPERATION_INCOMPLETE
then this hardcoded value will change.

Therefore allow the result to be either the old mbedtls error, or the new PSA
error, as not to break the CI.

Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-05-19 16:22:05 +01:00
Gilles Peskine
b9da11f289 Test with GCC 15 with sloppy union initialization
This is a non-regression test for
https://github.com/Mbed-TLS/mbedtls/issues/9814

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-19 16:51:19 +02:00
Gilles Peskine
421318c074 Update crypto with the union initialization fixes
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-19 16:51:19 +02:00
Manuel Pégourié-Gonnard
32745c95f9
Merge pull request #8947 from rojer/consts
Mark ssl_tls12_preset_default_sig_algs const
2025-05-19 10:09:30 +00:00
Gilles Peskine
d31a3c39b1
Merge pull request #10159 from gilles-peskine-arm/union-initialization-gcc15-preliminaries-dev
Test with GCC 15
2025-05-15 14:33:45 +00:00
Deomid rojer Ryabkov
7dddc1724f Mark ssl_tls12_preset_suiteb_sig_algs const
Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
2025-05-15 15:27:40 +03:00
Deomid rojer Ryabkov
e2d71ccc64 Mark ssl_tls12_preset_default_sig_algs const
To place in flash and save RAM on targets where this applies.

Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
2025-05-15 15:27:40 +03:00
Manuel Pégourié-Gonnard
7769c16512
Merge pull request #9654 from gabor-mezei-arm/9145_update_depends.py_pkalgs_domain
Update the `pkalgs` domain to use PSA macros in `depends.py`
2025-05-14 08:38:24 +00:00
Gilles Peskine
49b7ef635f
Merge pull request #10166 from gilles-peskine-arm/oid-split-restore-x509
Restore the OID module for use in X.509
2025-05-12 07:59:55 +00:00
Gabor Mezei
f13fd1e272
Use PSA macros for the pkalgs domain
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-05-09 14:51:54 +02:00
Ben Taylor
e718e835ee reverted compat-2.x.h removal from psa-transition.md
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-08 14:55:44 +01:00
Ben Taylor
d056136a4d Correct ChangeLog file extension
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-08 14:55:44 +01:00
Ben Taylor
4c9ad3cfe6 Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-08 14:55:44 +01:00
Ben Taylor
e23afdd765 remove compat-2.x.h
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-05-08 14:55:44 +01:00
Gilles Peskine
46771ff0d6 Remove trace of secp224k1
The curve secp224k1 was supported in the legacy API in Mbed TLS <=3.6, but
removed after 3.6, and was never implemented in PSA. Remove this old trace
of it.

This is a partial cherry-pick of 32c82f0c369117b22d8a40e51723c364156d1aff

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 19:17:35 +02:00
Gilles Peskine
dcff079ea4 Update submodules
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 17:16:20 +02:00
Gilles Peskine
d0e799ad8b Improve comments
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 17:15:37 +02:00
Gilles Peskine
d69bfb9044 Allow gcc-15 to be in $PATH
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 17:15:37 +02:00
Gilles Peskine
27f0713988 Enable drivers when testing with GCC 15
The goal of testing with GCC 15 is to validate fixes for
https://github.com/Mbed-TLS/mbedtls/issues/9814 . The bug is present in
multiple places, and some of them affect third-party drivers but not our
built-in implementation. (The bug is that driver contexts might not be
zero-initialized, but some of our built-in implementations happen not to
care about this.) Thus, enable the test drivers in the test component that
uses GCC 15, to gain the extra checks performed in the driver wrappers.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 17:15:37 +02:00
Gilles Peskine
6e245040d4 GCC 15: Silence -Wunterminated-string-initialization
This is a new warning in GCC 15 that our code base triggers in many places.
Silence it for the time being.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 17:15:37 +02:00
Gilles Peskine
579475d5d3 Test with GCC 15
Non-regression for https://github.com/Mbed-TLS/mbedtls/issues/9814

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 17:15:37 +02:00
Gilles Peskine
06af417cea Disable warning from gcc -pedantic on dlsym/dlopen
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 17:15:37 +02:00
Gilles Peskine
1782587af2
Merge pull request #10130 from valeriosetti/issue8154-development
[development] Restrict MBEDTLS_X509_RSASSA_PSS_SUPPORT
2025-05-07 14:22:34 +00:00
Gilles Peskine
1876efc157 Merge remote-tracking branch 'development' into HEAD 2025-05-07 14:41:13 +02:00
Gilles Peskine
47c8579ed0 Copy OID files that are getting moved to tf-psa-crypto
The OID module is used by both crypto and X.509. It has moved to the
`tf-psa-crypto` subdirectory, and the sibling commit
08d8cc57dbe7be54fe3f88ecbc2729300c48d450 removes this subdirectory from the
`mbedtls` repository in order to make `tf-psa-crypto` a submodule. We want
to access the relevant parts directly from X.509 rather than go through the
crypto repository, because OID functions are only accessible as private
interfaces, and crypto doesn't know when a particular OID function is needed
in the build since it depends on X.509 configuration options.

Make a copy of the OID module and its unit tests. In a follow-up, the X.509
module will switch to consuming this copy rather than the one that went into
TF-PSA-Crypto.

Rename the files from `*oid*` to `*x509_oid*` to follow the naming
convention that submodules of X.509 are prefixed with `x509`. This also
avoids file name clashes with TF-PSA-Crypto.

Since OID is not a public interface of Mbed TLS 4.x, move the header file
into `library`.

This commit only makes the files available. Subsequent commits will take
care of making these files used in the build.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 14:35:04 +02:00
Valerio Setti
b8d5649ab6 tests: test_suite_x509: adapt RSA-PSS tests
Parsing of CRT files with message's hash alg different from the MGF1 was
allowed in the past, but now it fails. So we need to move/adapt tests
relying on this feature, from a "verify" scope to a "parse" one.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-07 09:06:52 +02:00
Valerio Setti
7f6f4e6907 library: pass NULL options parameter to mbedtls_pk_verify_ext()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-07 09:06:52 +02:00
Valerio Setti
d24dfad7af library: x509: remove sig_opts from mbedtls_x509_sig_alg_gets()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-07 09:06:52 +02:00
Valerio Setti
68878ccdd0 library: x509: simplify RSA-PSS management
- Do not store RSA-PSS signature options in CRL/CRT/CSR structures;
- During the parsing phase, just ensure that MGF1 hash alg is the same
  as the one used for the message.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-07 09:06:52 +02:00
Gilles Peskine
2439c4c14a
Merge pull request #10090 from valeriosetti/issue9618-development
[development] MBEDTLS_PLATFORM_GET_ENTROPY_ALT in 4.0
2025-05-06 22:35:03 +02:00
Valerio Setti
7f8b7b768b tf-psa-crypto: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-06 18:30:15 +02:00