Commit Graph

32930 Commits

Author SHA1 Message Date
Valerio Setti c96be81959 psa_crypto_stubs: add stubs for hash functions
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-01-23 14:26:39 +01:00
Gilles Peskine 8296a73ce0 Merge pull request #104 from gilles-peskine-arm/psa-storage-test-cases-never-supported-negative-framework
Switch generate_psa_test.py to automatic dependencies for negative test cases
2025-01-20 15:53:01 +01:00
Ronald Cron 1ead596839 Merge pull request #118 from Harry-Ramsey/independent-collect-test-cases
Enable collect_test_cases.py to work for TF-PSA-Crypto
2025-01-17 16:48:18 +01:00
Harry Ramsey 049270ef92 Enable collect_test_cases.py to work for TF-PSA-Crypto
This commit adapts collect_test_cases.py to work for Mbed TLS and
TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-17 13:31:05 +00:00
Gilles Peskine 89cc06d8ce Merge remote-tracking branch 'main' into psa-storage-test-cases-never-supported-negative-framework 2025-01-16 19:54:39 +01:00
Ronald Cron 40f125f6df Merge pull request #124 from ronald-cron-arm/framework-ci-3.6-fix
Fix framework CI against mbedtls-3.6
2025-01-15 14:39:16 +01:00
Ronald Cron 0d2f2717a4 Merge pull request #109 from Harry-Ramsey/independent-check-files
Enable check_files.py for TF-PSA-Crypto
2025-01-15 14:39:03 +01:00
Harry Ramsey 024ec9ee85 Update license exemption list
As TF-PSA-Crypto is now a seperate repository, the license does not need
to be checked alongside Mbed TLS and instead has a seperate check.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-15 09:16:08 +00:00
Harry Ramsey f828f9c15e Enable check_files.py for TF-PSA-Crypto
This commit enables check_files.py to run for Mbed TLS and
TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-15 09:16:08 +00:00
Ronald Cron 7fb089ce64 Fix data_files/.gitignore
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-01-15 09:09:07 +01:00
Ronald Cron d67433304b Remove now unnecessary os imports
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-01-15 09:00:17 +01:00
Ronald Cron ee33e9f3ad Improve condition for seedfile in tf-psa-crypto
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-01-14 20:24:00 +01:00
Ronald Cron 7e215c8903 Improve branch checks based on tf-psa-crypto directory
Use build_tree module instead.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-01-14 16:23:08 +01:00
Ronald Cron 57ee691a3e Merge pull request #116 from valeriosetti/issue101-framework
Move pkgconfig.sh to the framework
2025-01-14 09:42:55 +01:00
Ronald Cron 71171b77f5 Merge pull request #105 from valeriosetti/issue86-framework
Move most of min_requirements.py to the framework
2025-01-13 10:02:13 +01:00
Valerio Setti a84269f2f8 scripts: min_requirements.py: small changes to work as module
- prevent the file from being called directly from the command line;
- allow to pass in the default requirement file so that each repo
  can specify its own version.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-01-13 05:36:30 +01:00
Gilles Peskine 8141968693 Fix edge case with half-supported ECDSA: automatic test cases
ECDSA has two variants: deterministic (PSA_ALG_DETERMINISTIC_ECDSA) and
randomized (PSA_ALG_ECDSA). The two variants are different for signature but
identical for verification. Mbed TLS accepts either variant as the algorithm
parameter for verification even when only the other variant is supported,
so we need to handle this as a special case when generating not-supported
test cases.

In this commit, suppress generated test cases for operation failures due to
unsupported ECDSA when exactly one of the two ECDSA variants is supported.
This edge case will only be tested manually (done in mbedtls or
TF-PSA-Crypto in the commit
"Fix edge case with half-supported ECDSA (manual test cases)").

Changes to the generated output: in
`test_suite_psa_crypto_op_fail.generated.data`, wherever one of
`!PSA_WANT_ALG_DETERMINISTIC_ECDSA` or `!PSA_WANT_ALG_ECDSA` appears as a
dependency, add the other one.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Gilles Peskine 78e4c8a73b PSA test case generation: operation fail: simplify NOT_SUPPORTED
In `generate_psa_tests.py, `OpFail.make_test_case()` is only ever used with
a single mechanism being not supported. Take advantage of that to simplify
parts of the function. Call `psa_test_case.TestCase.assumes_not_supported()`
instead of partly reinventing that wheel.

No change to the generated output.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Gilles Peskine bc6f8ac304 PSA test case generation: operation fail: skip never-implemented mechanisms
In `OpFail` test cases, remove the temporary hack whereby test cases were
not skipped when they should be due to a mechanism being never implemented.

This changes many test cases in
`test_suite_psa_crypto_op_fail.generated.data` to be commented out with a
"skipped because" reason instead of having a dependency on an algorithm or
an ECC/DH group that is not implemented.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Gilles Peskine fd0130576c Do run not-supported test cases on not-implemented mechanisms
In automatically generated PSA test cases with automatically inferred
dependencies, we were systematically skipping test cases when a dependency
mentions a mechanism that is not supported, even when that dependency is
negated. Fix this.

This causes more not-supported test cases to run.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Gilles Peskine 58cf9e90b8 PSA test case generation: operation fail: dependency inference class
Use the automatic dependency generation mechanism from
`psa_test_case.TestCase` for operation failure test cases. But tweak them
explicitly to preserve the same set of (not-quite-right) dependencies, to
facilitate understanding and reviewing how the current series of commits
gradually changes the generated dependencies.

No changes to the generated output.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Gilles Peskine 96da26ec65 PSA test case generation: operation fail: fix family dependencies
In operation failure test cases, fix dependencies on DH or ECC groups, which
were not spelled correctly and were missing the size suffix.

This changes the dependencies of many test cases in
`test_suite_psa_crypto_op_fail.generated.data` to no longer have a
never-implemented symbol as a dependency. Thus more test cases will run.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Gilles Peskine 91a3626ab7 PSA test case generation: dependency inference class: key not supported
In `psa_test_case.TestCase`, add a method `assumes_not_supported` which
allows using the automatic dependency calculation framework when the test
case intends to run in configurations where one mechanism is not supported.

Use `psa_test_case.TestCase` for not-supported test cases for key import and
generation.

No change to the generated output.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Gilles Peskine 5dcf16ad7b Be more precise about key pair usage dependencies
Don't always require all of BASIC, IMPORT and EXPORT.

BASIC is always implied by any of the creation methods.

* `KeyTypeNotSupported`: only does an IMPORT (or GENERATE) attempt. EXPORT is
  not needed. This reduces dependencies in
  `test_suite_psa_crypto_not_supported.generated.data`.
* `OpFail`: only does an IMPORT, followed by a BASIC attempt. EXPORT is not
  needed. This reduces dependencies in
  `test_suite_psa_crypto_op_fail.generated.data`.
* `StorageFormat`: only does an IMPORT for save (forward compatibility)
  tests, and only does an EXPORT for read (backward compatibility) tests.
  This reduces dependencies in
  `test_suite_psa_crypto_storage_format.current.data` and
  `test_suite_psa_crypto_storage_format.v0.data` respectively.

Positive test cases that create and exercise a key are still potentially
missing BASIC (which is implied) and EXPORT (which isn't) for exercising the
key, but this is out of scope of this commit.

The generated output has fewer test case dependencies as described above,
with BASIC+IMPORT+EXPORT replaced by only one of IMPORT or EXPORT. Since we
never test partial support for a key type with import or export disabled,
this doesn't change which test cases are executed in each tested
configuration.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Gilles Peskine 8c23ac8520 Be more explicit about key pair usage dependencies
Make the code that generates the test case be explicit about which usage(s)
will be needed for key pairs (`PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_uuu`). Allow
more than one usage specifier.

Do not systematically generalize BASIC to also include IMPORT and EXPORT:
not all tests actually need this, and our test configurations don't try to
have BASIC without IMPORT and EXPORT at the moment because we don't track
those dependencies accurately in manually written tests anyway.

Fix a bug whereby any usage other than BASIC or GENERATE led to the
dependency being silently dropped.

No change to the generated output.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-09 18:24:59 +01:00
Ronald Cron fe852d3b9a Merge pull request #103 from valeriosetti/issue73-framework
Move tests/scripts/check_names.py to the framework
2025-01-09 16:27:38 +01:00
Valerio Setti 9753be6373 Merge branch 'tmp-branch-move-files-to-framework' into issue101-framework 2025-01-09 14:21:31 +01:00
Valerio Setti 98fe7eebd2 Move files into the framework
The following files are added (imported) from the main Mbed TLS repo:

scripts/pkgconfig.sh

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-09 14:21:26 +01:00
Ronald Cron 272ba234ec Merge pull request #9825 from valeriosetti/issue69-main
Move "easy" basic checks scripts to the framework
2025-01-08 15:08:49 +00:00
Valerio Setti 5300725d4f framework: updated reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-08 14:08:20 +01:00
Ronald Cron 32628640f3 Merge pull request #95 from valeriosetti/issue69-framework
Move "easy" basic checks scripts to the framework

PR validated by the CI of https://github.com/Mbed-TLS/mbedtls/pull/9825 and https://github.com/Mbed-TLS/mbedtls/pull/9826. The files moved are not used yet in TF-PSA-Crypto thus no impact there. Merging.
2025-01-08 13:08:24 +01:00
Valerio Setti 976b53fc85 scripts: fix paths for files moved to framework
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-08 09:59:18 +01:00
Valerio Setti ee3cbf56a1 doxygen.sh: use relative script's path to call apidoc_full.sh
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-01-08 09:58:04 +01:00
Valerio Setti 1b2dd2d069 scripts: fix paths in files moved from Mbed TLS
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-01-08 09:58:04 +01:00
Valerio Setti 8bf041ff30 Merge branch 'tmp-branch-move-files-to-framework' into issue69-framework 2025-01-08 09:51:06 +01:00
Valerio Setti cb333f24f0 Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

scripts/assemble_changelog.py
tests/scripts/check-doxy-blocks.pl
tests/scripts/check-python-files.sh
tests/scripts/doxygen.sh
scripts/apidoc_full.sh
tests/scripts/recursion.pl

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-08 09:51:04 +01:00
Valerio Setti 965b829b54 Move files into the framework
The following files are added (imported) from the main Mbed TLS repo:

scripts/assemble_changelog.py
scripts/check-doxy-blocks.pl
scripts/check-python-files.sh
scripts/doxygen.sh
scripts/apidoc_full.sh
scripts/recursion.pl

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-08 09:51:01 +01:00
Janos Follath 0d28fcb082 Merge pull request #9798 from NadavTasher/feature/more-debug-prints
Added debug print in tls13 ssl_tls13_write_key_share_ext
2025-01-07 16:18:35 +00:00
Manuel Pégourié-Gonnard 69a2182a55 Merge pull request #9767 from Harry-Ramsey/tf-psa-crypto-out-of-source-development
TF-PSA-Crypto out of source build
2025-01-07 13:41:54 +00:00
Ronald Cron 9bdec11b31 Merge pull request #9815 from Harry-Ramsey/remove-irrelevant-components
Remove Irrelevant Components for 4.0
2025-01-07 13:18:15 +00:00
Harry Ramsey 1e8992b63e Update TF-PSA-Crypto for out of source builds
This commit updates TF-PSA-Crypto to enable out of source builds by
default.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-07 11:43:46 +00:00
Harry Ramsey 34a0b6dc32 Update framework submodule for CMake TF-PSA-Crypto
This commit updates the framework submodule to include commits relevant
to running TF-PSA-Crypto using CMake build system.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-07 11:43:42 +00:00
Ronald Cron 81dfe001e1 Merge pull request #77 from Harry-Ramsey/tf-psa-crypto-out-of-source-development
Add out of source build functions for TF-PSA-Crypto
2025-01-06 15:13:55 +01:00
David Horstmann 3dd86cd845 Merge pull request #9777 from hughsie/hughsie/sbom
Add a SBOM file in CycloneDX format
2025-01-06 11:51:34 +00:00
David Horstmann 9e0557f290 Merge pull request #88 from hughsie/hughsie/sbom
Add a SBOM template in CycloneDX format
2025-01-06 11:51:29 +00:00
Janos Follath 3c4c647328 Merge pull request #9818 from yanesca/remove_USE_PSA_from_standalone_doc_9632
Remove discussions of MBEDTLS_USE_PSA_CRYPTO in standalone documentation
2025-01-02 15:45:03 +00:00
Harry Ramsey f3044f8d98 Remove duplicate Mbed TLS Framework variable
This commit removes a duplicate variable MBEDTLS_FRAMEWORK_ROOT_DIR as
it is now previously defined as FRAMEWORK.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-24 14:25:04 +00:00
Harry Ramsey 008445c193 Use absolute out of source build path
This commit replaces the relative Mbed TLS out of source build path with
a more generic named absolute out of source build path for both Mbed TLS
and TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-24 14:25:03 +00:00
Harry Ramsey e11462c606 Remove directory change as commands run in subshells
This commit removes unnecessary directory changes as the commands for
components run in subshells which do not affect the main scripts
directory.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-24 14:25:03 +00:00
Harry Ramsey 4c73fc89e9 Revert changing directory to out of source dir
This commit reverts changing the directory to the out of source
directory, enabling tests which require source code to run. Tests that
require building TF-PSA-Crypto will have to change directory to
OUT_OF_SOURCE_DIR.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-24 14:25:03 +00:00