3278 Commits

Author SHA1 Message Date
Manuel Pégourié-Gonnard
d10f42f5e6 Fix making the path of the outcomes file absolute.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-30 09:52:36 +01:00
Gilles Peskine
8ed4d94166
Merge pull request #9614 from gilles-peskine-arm/use_psa_crypto-always_on
Always enable MBEDTLS_USE_PSA_CRYPTO in all.sh
2024-10-29 14:58:55 +00:00
Manuel Pégourié-Gonnard
6ffebef9c4 New all.sh wrapper with reduced scope (CI only)
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-29 12:57:24 +01:00
Manuel Pégourié-Gonnard
26caae8152 Rm forgotten armc5
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-29 12:43:26 +01:00
Manuel Pégourié-Gonnard
705690af69 Drop building with armcc5 in all.sh
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-29 11:46:47 +01:00
Bence Szépkúti
bc8c157bce Add override arguments for new gcc targets
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:16:17 +01:00
Bence Szépkúti
8490f052ae Clarify GCC version requirement
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:15:24 +01:00
Bence Szépkúti
479eb522d7 Split up the Thumb-1 test component
The Thumb-1 tests are by far the slowest, so split the -O0 and -Os tests
into their own components.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:15:24 +01:00
Bence Szépkúti
bb61245007 Remove superfluous invocations of make clean
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:15:24 +01:00
Bence Szépkúti
de146a13b4 Update component speed estimates
The estimates are based on the most recent CI run.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:15:24 +01:00
Bence Szépkúti
65e77c53d6 Initialize result caching variables
This prevents interference from identically named environment variables.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:15:22 +01:00
Bence Szépkúti
924662bea3 Use true/false in place of integers
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:14:32 +01:00
Bence Szépkúti
31906327d3 Ignore missing temporary files during cleanup
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:13:53 +01:00
Bence Szépkúti
c12ebb0811 Fix copypasta in gcc_version
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:13:25 +01:00
Bence Szépkúti
d1d26139ff Add AArch64 default config test
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:12:25 +01:00
Bence Szépkúti
1524b9c3ad Add Arm eabi default config tests
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 11:10:15 +01:00
Gilles Peskine
665df83d34
Merge pull request #9293 from gilles-peskine-arm/outcome-check-repeated-configurations-all.sh-preliminaries
Fix some all.sh components with sub-components
2024-10-25 14:59:15 +00:00
Ronald Cron
5f6e69dae5
Merge pull request #9693 from Harry-Ramsey/split-revert-error-development
Split error.h and move back error.c to mbedtls
2024-10-25 13:12:58 +00:00
Gilles Peskine
3982898c3a Remove legacy components with an equivalent USE_PSA component
Remove all.sh components that explicitly disable MBEDTLS_USE_PSA_CRYPTO, and
for which there is another component with MBEDTLS_USE_PSA_CRYPTO enabled
that does the same or more testing.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-24 20:37:33 +02:00
Manuel Pégourié-Gonnard
a93f988779 all.sh: wrapper for both mbedtls and tf-psa-crypto
In order to avoid changing the CI job's definition (which fewer team
members understand, compared to shell scripts), just have a wrapper so
that all.sh does both mbedtls and tf-psa-crypto under the hood for now.

When tf-psa-crypto has its own CI running its own all.sh (with enough
components migrated to get sufficient coverage) we can remove this hack.

Rejected strategy: modify all-core.sh so that when running in mbedtls,
it also sources components-*.sh from tf-psa-crypto, remembers which
components come from Mbed TLS and which come from crypto, and magically
adjust the environment for each component it runs. Rejected because it's
hard to be confident we're adjusting everything that needs adjusting in
the environment. Having separate processes seems much safer.

The downside is we get more complexity around error handling (check for
components requested but not available, --keep-going). When using
--keep-going with failing component(s) in mbedtls and some components in
tf-psa-crypto, the output is not satisfying for humans as we don't have
a nice summary of all errors at the end like we normally would.

IMO this is acceptable since:
- this wrapper is transitional and should be removed in a few months;
- it is mainly for the benefit of the CI; humans can always invoke the
underlying commands directly.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-24 09:51:22 +02:00
Gilles Peskine
202b69c2b6
Merge pull request #9302 from valeriosetti/psa-use-static-slots
PSA: use static key slots to store keys
2024-10-24 07:27:48 +00:00
Ronald Cron
ed230c4fb3
Merge pull request #9706 from ronald-cron-arm/pkg-install-doc-lcov
tf-psa-crypto: cmake: Add support for pkg install, doc, lcov
2024-10-24 06:39:58 +00:00
Manuel Pégourié-Gonnard
8bcad48ca5 Add tf-psa-crypto's own all.sh
With a first component.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-23 10:41:15 +02:00
Manuel Pégourié-Gonnard
3d41154110 all.sh: improve check for clean config files
The existing check only took care of CONFIG_H. This was both not enough
and too much:
- not enough because config.py can also modify CRYPTO_CONFIG_H and we
want to know about it just as much as CONFIG_H;
- too much because CONFIG_H does not exist in tf-psa-crypto.

Check a list of files instead of a single one, and adjust that list.

Also update an outdated comment about Makefiles

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-23 10:22:39 +02:00
Manuel Pégourié-Gonnard
8da0e9eef7 all.sh: rationalize relative path usage
In preparation for adding tf-psa-crypto/test/scripts/all.sh which will
run from tf-psa-crypto.

Use paths relative to the currently sourced file when including common
files (ie, those that will soon be moved to the framework). Otherwise,
use paths relative to the current directory, aka project's root.

Document that test/script/all.sh must be invoked from the project's root
(that was already the case, but implicit so far).

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-23 10:06:38 +02:00
Gilles Peskine
d2da02b1ce Remove obsolete exemptions from test case coverage
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-22 22:10:42 +02:00
Gilles Peskine
fef912c30b Test partial ECC creation support: switch to MBEDTLS_USE_PSA_CRYPTO
With PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE disabled, test TLS 1.3 and
USE_PSA TLS 1.2.

With PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE disabled, just test crypto,
because the TLS code needs that to generate ephemeral ECDH keys but this is
not tracked properly (the ephemeral ECDH code is only gated on having ECDH).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-22 22:10:42 +02:00
Valerio Setti
ec028d8451 analyze_outcomes.py: allow test with PSA_WANT_ALG_TLS12_PRF disabled
Do not assume that tests with !PSA_WANT_ALG_TLS12_PRF will not
be executed in AnalyzeCoverage task.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 18:02:04 +02:00
Valerio Setti
7213fbc2e2 components-basic-checks: add new exception for MBEDTLS_CTR_DRBG_MAX_REQUEST
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
8bc8172c4a test: disable dynamic key store in test_crypto_with_static_key_slots
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
4d9a8219ac test: properly select MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE value
This value should be:
- OK for all EC/FFDH key pairs/public keys;
- OK for all supported public RSA keys;
- OK for RSA key pairs up to 2048 bits;
- FAIL for RSA key pairs above 2048 bits.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
2a3c9b347c test: extend component_test_crypto_with_static_key_slots
Intentionally set MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE slightly
smaller than the maximum RSA key pair size for an RSA key of 4096
bits. Also add a test in test_suite_psa_crypto to verify this
condition.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
35b0b02e4a test: disable all legacy symbols in test_psa_crypto_without_heap
Disable all MBEDTLS_xxx symbols (keeping only the relevant ones enabled)
when building the main library.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
13aadd7981 test: minor fixes to test_psa_crypto_without_heap and test_crypto_with_static_key_slots
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
a47b045a68 test: add new component to test core library without calloc/free
This commit also fixes issues found in test suites
function/data files.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
dbb646b99a test: add new component to test MBEDTLS_PSA_STATIC_KEY_SLOTS
This commit also fixes related errors in test suites. In all
cases those failures are related to the use of raw keys whose
size cannot be determined a-priori.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Gabor Mezei
b50043b960
Update cipher_id domain to use PSA macros
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-22 16:55:19 +02:00
Manuel Pégourié-Gonnard
6b644938d2
Merge pull request #9657 from mpg/refactor-all.sh-dev
Refactor all.sh
2024-10-22 13:33:45 +00:00
Gabor Mezei
6a986d9122
Update coverage datebase
With the `depend.py` using the crypto config the `PBKDF2_HMAC` can be
enabled so thest cases can be run.

The equivalence (synonym) between `PSA_WANT_ALG_RSA_PSS_ANY_SALT` and
`PSA_WANT_ALG_RSA_PSS` is now done properly, the test can be run.

Dependencies for `MBEDTLS_CIPHER_PADDING_PKCS7' has been updated and
now it can be actually disabled.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-22 10:43:03 +02:00
Gabor Mezei
4fef797450
Update macro dependencies
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:27:23 +02:00
Gabor Mezei
f10402c028
Update macro dependencies
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:27:22 +02:00
Gabor Mezei
c9f01cf8b5
Use f-string instead of concatenation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:27:22 +02:00
Gabor Mezei
224152eec0
Remove unneeded newlines
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:27:22 +02:00
Gabor Mezei
fb06101b9f
Fix recursive dependencies for cross referencing
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:27:22 +02:00
Gabor Mezei
4e10d6c21d
Add consistency check for option avalability
The PSA and MbedTLS options can switch the same functionality separately
so add a check to ensure the cpnsistency.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:26:52 +02:00
Gabor Mezei
8f94485166
Fix dependency
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:26:52 +02:00
Gabor Mezei
610e6e2aea
Add PSA macro dependencies
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:26:52 +02:00
Gabor Mezei
8ec990bc45
Apply config dependecies recursively
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:26:52 +02:00
Gabor Mezei
9ce6d244f1
Remove depends.py option to use without PSA
Also removed test which uses this option.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:26:52 +02:00
Gabor Mezei
035d7c8cfa
Move file backup support to config_common.py
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:26:52 +02:00