3186 Commits

Author SHA1 Message Date
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
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
Gabor Mezei
f5408f0909
Enable usage of crypto config in depends.py
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:26:52 +02:00
Ronald Cron
4cd797e7fb tf-psa-crypto: Add cmake_package test program
We cannot add the equivalent of
cmake_package_install yet as the build in
tf-psa-crypto still references some headers
in ./include/mbedtls like mbedtls_config.h.

We cannot add the equivalent of
cmake_subproject yet as currently only
the case of the Mbed TLS parent project is
supported.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-18 11:42:17 +02:00
Ronald Cron
4870e613f8 Refactor pkgconfig.sh
Refactor pkgconfig.sh to be able to use it
for Mbed TLS and TF-PSA-Crypto packages.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-18 10:23:15 +02:00
Manuel Pégourié-Gonnard
fd4f2831d7 Fix a typo in a comment
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-18 09:58:11 +02:00
Gilles Peskine
f5025e2680 Merge remote-tracking branch 'development' into test-cases-not-executed-enforce-development
Conflicts:
* framework: update to the head of 'main'.
2024-10-17 21:20:01 +02:00
David Horstmann
13d2939563
Merge pull request #9673 from eleuzi01/issue-54-fw
Move TLS auxiliary test scripts to the framework
2024-10-17 17:15:46 +00:00
Manuel Pégourié-Gonnard
dea880f035 all.sh: fix missing quotes
Without quotes, when the variable is empty, the shell will see three
tokens: [, -n, ]. After skipping ] as usual, it will see a single token,
so it will consider it not as command, but a string to be tested for "is
it empty", and since "-n" is not empty, the command will return true.

With quotes it see 4 tokens: [, -n, <empty string>, ] and interprets -n
as desired.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-17 09:21:19 +02:00
Gilles Peskine
e1f37c58a2
Merge pull request #9566 from gilles-peskine-arm/error-codes-4.0-enforce-add-macro
Error codes: enforce add macro
2024-10-16 17:28:04 +00:00
Gilles Peskine
8085f51108 Use MBEDTLS_ERROR_ADD instead of explicit addition: enforcement
Reject direct additions of error constants (regex-based approximation).

Fix the lone straggler.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-16 11:52:27 +02:00
Manuel Pégourié-Gonnard
6c0b4e73c0 all.sh: adjust for when tf-psa-crypto is absent
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:50:43 +02:00
Manuel Pégourié-Gonnard
f48d4edd0c all.sh: re-instate 3.6-specific code
This aligns development and 3.6 in preparation for moving to the
framework repo.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:50:15 +02:00
Ronald Cron
ede04b34d1 Remove unnecessary -O2 compilation flag
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-16 10:47:15 +02:00
Ronald Cron
a0afbfb2a4 Fix/Add documentation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-15 17:09:36 +02:00
Ronald Cron
67cc6a73aa Use config_adjust_test_accelerators.h
Use config_adjust_test_accelerators.h
to adjust the configuration needed for
test_psa_crypto_drivers all.sh component
with PSA_CRYPTO_CONFIG enabled.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-15 17:09:36 +02:00
Elena Uziunaite
9669eeabcf Adjust file path for translate_ciphers.py
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 11:45:15 +01:00
Elena Uziunaite
b74c3eaf87 Adjust file path for generate_tls13_compat_tests.py
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 11:45:05 +01:00
Elena Uziunaite
09fee364a3 Adjust file path for generate_ssl_debug_helpers.py
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 11:43:51 +01:00
Elena Uziunaite
2df289290f Move some files to framework repository
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 11:41:39 +01:00
Gilles Peskine
5e3ed3f8a0 Minor readability improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-11 12:00:44 +02:00
Gilles Peskine
095561cca1 Switch outcome analysis to enforcing that all tests are executed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
d9c40f538d We never test without the PSA client code.
Should we? To be decided later.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
24b03d8b72 Add ignore list for restartable ECDH in TLS
TLS only supports actual restartable ECDH with the legacy code that's going
away, not with the MBEDTLS_USE_PSA_CRYPTO code that's becoming the only
variant. This leaves a few test cases that validate restartable ECDH in TLS
as desirable, but not currently able to pass.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
2fd25bb2a5 Add ignore list entries for configurations that are not tested
For each ignore list entry, link to a GitHub issue for its resolution,
except for a few configurations which there is a good reason to leave
uncovered.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
b0ec85dcc6 Add ignore list entries for crypto tests that are not executed
For each ignore list entry, link to a GitHub issue for its resolution.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
de2316b8ea Add ignore list entries for TLS tests that are not executed
For each ignore list entry, link to a GitHub issue for its resolution,
except for ssl-opt Valgrind tests which we never intend to run on the CI.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
ab5cc9bd30 In PSA generated tests, ignore patterns for which an issue has been raised
Ignore certain test cases which either should not be generated or should be
executed. For each ignore list entry, link to a GitHub issue whose
definition of done includes removing the entry.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
5872c0d4c0 In PSA generated tests, don't ignore not-implemented in some negative tests
Some negative tests involving unsupported mechanisms are executed, because
they're testing what happens if the mechanism is unsupported. Refine the
ignore list for `test_suite_psa_crypto_generate_key.generated` and
`test_suite_psa_crypto_op_fail.generated` accordingly.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
2a71fac470 In PSA generated tests, ignore mechanisms that are not implemented
This clears more than half of the test cases that are not executed.
This also captures a few negative test cases that are executed.
Subsequent commits will refine the filtering.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-10 17:26:11 +02:00
Gilles Peskine
80352ac58c
Merge pull request #9668 from gilles-peskine-arm/analyze_outcome-split-dev
Split check_test_cases.py and outcome_analysis.py
2024-10-10 13:45:49 +00:00
Manuel Pégourié-Gonnard
58c09bd642 all.sh: update documentation
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-10 10:13:19 +02:00
Manuel Pégourié-Gonnard
e4e65aa10a all.sh: move top-level code to a function
Now the output of
    grep '^[^ {}#]' tests/scripts/all-*.sh | grep -v '()'
is clean, with the only results being:
- shopt -s extglob which is needing for parsing the rest
- usage message

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-10 10:13:19 +02:00
Manuel Pégourié-Gonnard
7b556951f9 all.sh: document new file structure
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-10 10:13:19 +02:00
Manuel Pégourié-Gonnard
1cb8ee81f6 all.sh: move definitions to all-core.sh
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-10 10:13:18 +02:00
Manuel Pégourié-Gonnard
731128ce50 all.sh: wrap main code into main() function
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-10 10:13:17 +02:00
Manuel Pégourié-Gonnard
e953a7adac all.sh: move clang_version() to helpers file
This function is only used in (a few) components, it's not part of the core.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-10 10:13:17 +02:00
Manuel Pégourié-Gonnard
e6df2e4dbc all.sh: move component helpers to separate file
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-10 10:13:16 +02:00