Commit Graph

299 Commits

Author SHA1 Message Date
Ronald Cron
5096b4cb4b Revert "Remove mbedtls_test"
This reverts commit 939ce9d0d5.

Build mbedtls_test library of objects to link
with TLS and x509 test suites and programs
with mbedtls framework not TF-PSA-Crypto
one (when it will be there).

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-10 16:56:49 +01:00
Ronald Cron
04baacb228 cmake: Try and simplify test_keys/certs.h generation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-10 16:54:05 +01:00
Ronald Cron
ce3c2dd30c
Merge pull request #9806 from ronald-cron-arm/finalize-split-preparation-1
Finalize split preparation-1
2024-12-05 13:23:09 +00:00
Ronald Cron
d5331ff4e6 cmake: Move cert.o to mbedtls_test_helpers library of objects
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-04 14:25:02 +01:00
Ronald Cron
575833cc34 cmake: Move generation of test_certs.h to mbedtls
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-04 14:25:02 +01:00
Minos Galanakis
4f619e12e7 Renamed MBEDTLS_PSA_CRYPTO_CONFIG_FILE & MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE
Files have been renamed respectively to:
- TF_PSA_CRYPTO_CONFIG_FILE
- TF_PSA_CRYPTO_USER_CONFIG_FILE

As per design proposal:
https://github.com/Mbed-TLS/mbedtls/blob/development/docs/proposed/config-split.md

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-12-04 09:57:56 +00:00
David Horstmann
204eb2cfd9 Re-add tests/include path for test helpers
These must include from both the framework and the main repository since
the test helpers straddle the two locations.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-18 15:50:44 +00:00
David Horstmann
5b93d97b95 Update references to test helpers
Replace:
* tests/src -> framework/tests/src
* tests/include -> framework/tests/include

Except for occurrences of:
* tests/src/test_helpers (since this only contains ssl_helpers.c)
* tests/src/test_certs.h
* tests/include/alt_dummy

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-18 15:50:44 +00:00
Ronald Cron
8237484318 cmake: Use TF_PSA_CRYPTO_CONFIG_FILE to prefix crypto targets
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-15 15:05:34 +01:00
Ronald Cron
d779e95720 Fix cmake option name
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 16:25:34 +01:00
Ronald Cron
939ce9d0d5 Remove mbedtls_test
Use tf_psa_crypto_test instead.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 13:52:36 +01:00
Ronald Cron
0381a98114 cmake: Move copy of crypto libraries to mbedtls
Move copy of crypto libraries to mbedtls as this
copy does not make sense in TF-PSA-Crypto context.
Also copy all of them, not just tfpsacrypto.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:27 +01:00
Ronald Cron
8126a686d9 cmake: Rename mbedcrypto library to tfpsacrypto
Do not do the same in the make build system yet,
cmake build system only scope for this PR.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:27 +01:00
Ronald Cron
b7d0e52e16 cmake: Rename mbedcrypto target to tfpsacrypto
Rename mbedcrypto target to tfpsacrypto and
prefix all cmake related variables with
tfpsacrypto instead of mbedcrypto.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:27 +01:00
Ronald Cron
1a52bc4802 cmake: mbedtls: Propagate options and target prefix
Propagate mbedtls options named differently in
TF-PSA-Crypto.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
a9219ff73d Add project prefix to API documentation targets
To avoid conflict between the two targets when
the integration of the TF-PSA-Crypto build system
into the Mbed TLS one is completed.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
169393e6ae Restrict the definition of memcheck/lcov targets
Restrict the definition of memcheck/lcov targets
to the case where Mbed TLS/TF-PSA-Crypto is the
main project. To avoid conflict between the
targets when the integration of the TF-PSA-Crypto
build system into the Mbed TLS one is completed.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
211bf6de21 cmake: Fix config files compile definitions
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 08:52:20 +01:00
Waleed Elmelegy
4cef20d00b Fix everest build issue
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Manuel Pégourié-Gonnard
e71f3c3a50
Merge pull request #9571 from Harry-Ramsey/improve-submodule-error-messages-development
Improve submodule error messages for Github archives
2024-11-05 10:26:52 +00:00
Harry Ramsey
6d9c389957 Further improve error message clarity
This commit further improves error message clarity.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-28 14:05:23 +00:00
Ronald Cron
051ee711bf Remove now unnecessary shared lib specific compile option
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:40 +02:00
Ronald Cron
6f9d508714 cmake: iar/msvc: Set base compile and link options target by target
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:40 +02:00
Ronald Cron
d9e1109d23 cmake: clang: Set base compile and link options target by target
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:40 +02:00
Ronald Cron
4ae24f4fea cmake: GNU GCC: Add base link options
target_compile_options() does not set
link options as setting CMAKE_C_FLAGS
does. Thus set link options with
set_target_properties(). target_link_options()
is not available in CMake 3.5 used in the CI.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:40 +02:00
Ronald Cron
b2478989e2 cmake: GNU GCC: Set base compile options target by target
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:33 +02:00
Ronald Cron
d77fad2556 Group C_FLAGS settings by compiler type
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 17:40:44 +02:00
Ronald Cron
7323b3e112 cmake: Remove UNSAFE_BUILD option
The UNSAFE_BUILD option was introduced for
the builds with NULL entropy
(option MBEDTLS_TEST_NULL_ENTROPY) but this
configuration option does not exist
anymore.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 17:40:44 +02:00
Gilles Peskine
4e9d77e6e7
Merge pull request #9703 from valeriosetti/fix-9690-workarounds
Revert & fix #9690 workarounds
2024-10-25 11:47:44 +00:00
Ronald Cron
2d453c9b07 cmake: Remove custom LIB_INSTALL_DIR variable to set install dir
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-18 10:23:15 +02:00
Ronald Cron
f584e97aed cmake: Use MBEDTLS/TF_PSA_CRYTPO_AS_SUBPROJECT
Use MBEDTLS/TF_PSA_CRYTPO_AS_SUBPROJECT
instead of using the test employed to set
MBEDTLS/TF_PSA_CRYTPO_AS_SUBPROJECT value.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-18 10:16:35 +02:00
Harry Ramsey
e05cf2e11e Improve submodule error messages for Github archives
This commit improves the error messages informing users that have
downloaded Github archives to instead download a release archive. This
is due to Github not supporting submodules within archives and no
trivial way for users to use git to download them.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-18 08:20:57 +01:00
Valerio Setti
8b675b8c2c CMakeLists: use -O2 as ASAN_FLAG only in GCC versions before 7.0
Since the bug affecting the performance only affects GCC versions
before 7.0, use -O2 flag instead of -O3 for them and keep the
better optimization for newer compilers.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-16 16:22:24 +02:00
Gilles Peskine
c76f82db27 Work around GCC 5 performance problem with Asan+UBSan and -O3
Old GCC versions hit a performance problem with test_suite_pkwrite
"Private keey write check EC" tests when building with Asan+UBSan
and -O3: those tests take more than 100x time than normal, with
test_suite_pkwrite taking >3h on the CI. Observed with GCC 5.4 on
Ubuntu 16.04 x86_64 and GCC 6.5 on Ubuntu 18.04 x86_64.
GCC 7.5 and above on Ubuntu 18.04 appear fine.

To avoid the performance problem, use -O2 instead of -O3 in then "Asan"
build type with GCC. It doesn't slow down much even with modern compiler
versions.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-16 10:31:29 +02:00
Ronald Cron
b6254f5b97 cmake: Add MBEDTLS_FRAMEWORK_DIR
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-01 15:32:01 +02:00
Ronald Cron
d3f717d536 CMake: Move build of crypto test suites to tf-psa-crypto
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-01 15:32:01 +02:00
Ronald Cron
e82ad15f5e CMake: Move build of the crypto library to tf-psa-crypto
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-01 15:32:01 +02:00
Ronald Cron
ac01d6eb7c CMake: Move build of legacy crypto modules to tf-psa-crypto
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-01 15:32:01 +02:00
Ronald Cron
f8a3f28b6d CMake: Move library options to the top CMakeLists.txt
Move library options to the top CMakeLists.txt.
That way:
- we will be able to set the TF-PSA-Crypto
library options according to the Mbed TLS ones.
- we can define the crypto library target names
in the top CMakeLists.txt and not in the library
one that is dedicated to the TLS and x509
libraries now.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-01 15:32:01 +02:00
Gilles Peskine
63068d69cb Have make ssl-opt generate tls13-compat.sh
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 19:09:57 +02:00
Gilles Peskine
40c090f61b Move generation of tls13-compat.sh to tests/CMakeLists.txt
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 19:02:11 +02:00
Gilles Peskine
3943a1a3bf Automatically generate tests/opt-testcases/tls13-compat.sh
`tests/opt-testcases/tls13-compat.sh` is supposed to be automatically
generated by `tests/scripts/generate_tls13_compat_tests.py`. So far, the
output has been updated by running the script manually and committing the
output. Switch to using our framework for generated files.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 18:59:31 +02:00
David Horstmann
7ba04a298c Bump version to 4.0.0
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-09-10 10:43:14 +02:00
Michael Schuster
1da4ed1df8 Move the -Wmissing-prototypes option from library/CMakeLists.txt to the top-level CMakeLists.txt for GCC & Clang
Signed-off-by: Michael Schuster <michael@schuster.ms>
2024-08-09 10:29:58 +01:00
Gilles Peskine
62ee8fdcf5 Test cpp_dummy_build in pedantic mode
In public headers, we want to avoid things that are not standard C++,
including features that GCC and Clang support as extensions, such as
flexible array members. So compile with `-pedantic`.

Non-regression for https://github.com/Mbed-TLS/mbedtls/issues/9020.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:32 +02:00
Ronald Cron
9a93073710 Add tf-psa-crypto test suites build
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-19 10:07:27 +02:00
Ronald Cron
7af1bea3b1 CMake: Include CMakePrintHelpers
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-19 10:07:27 +02:00
Ronald Cron
aef8cf3b2e Adjust build systems
Adjust build systems such as we can built
Mbed TLS in the default and full configuration.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-10 08:10:40 +02:00
Ronald Cron
c29afb684e Adjust build systems
Adjust build systems such as we can built
Mbed TLS in the default and full configuration.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-10 08:07:38 +02:00
Ronald Cron
3d817add46 Adjust build systems
Adjust build systems such as we can built
Mbed TLS in the default and full configuration.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-01 14:59:35 +02:00