Commit Graph

33388 Commits

Author SHA1 Message Date
Gilles Peskine 02eef2a48b Update config information about TF-PSA-Crypto 1.0 and Mbed TLS 4.0
Update data collected a few weeks before the release to the actual releases.

This fixes `check_names.py` failing on `MBEDTLS_DES_C` in
`tf_psa_crypto_config_check_user.h` when generated files are present in the
source tree.

```
scripts/save_config_history.sh mbedtls-4.0.0 4.0
scripts/save_config_history.sh tf-psa-crypto-1.0.0 1.0
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
Gilles Peskine 203ff5e165 Support new location of crypto_adjust_config_synonyms.h in TF-PSA-Crypto >1.0.0
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
Gilles Peskine 76fe5edd98 Use scripts/generate_config_checks.py unconditionally
`scripts/generate_config_checks.py` had to be included conditionally so that
consuming branches could transition from it not existing to it existing. Now
that both TF-PSA-Crypto/development and mbedtls/development have this
script, include it unconditionally.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
Valerio Setti 32e01d4688 Merge pull request #235 from valeriosetti/issue435-part2-framework
[framework] tests: migrate tests using secp192[k|r]1 toward secp256[r|k]1 --> EC [1/3]
2025-11-12 09:07:07 +01:00
Valerio Setti 9232f41572 scripts: ecp.py: do not test secp192 curves in development
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-06 23:43:25 +01:00
David Horstmann 7e2b53a0fd Merge pull request #223 from valeriosetti/issue435-framework
tests: migrate tests using secp192[k|r]1 toward secp256[r|k]1 --> PK [1/2]
2025-11-05 16:06:49 +00:00
David Horstmann cdc1ca0056 Merge pull request #233 from gilles-peskine-arm/uncrustify-warnings
Make code_style.py more user-friendly
2025-11-05 09:58:31 +00:00
Valerio Setti 4fb0db47d0 data_files: remove unnecessary ec_256_prv.sec1[.comp].pem files
Their generation was removed from the Makefile, but physical files were
not deleted.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-04 12:02:33 +01:00
Gilles Peskine 9707b5c138 Also apply --uncrustify to --fix mode
Before this commit, verify mode still hard-coded "uncrustify" as the command
name.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-03 18:54:09 +01:00
Gilles Peskine eaf2b3e358 Allow specifying a diffent uncrustify command
This makes it easier to run the script on a machine where the
system-installed uncrustify is a different version.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-03 18:51:58 +01:00
Gilles Peskine 3bf133525f Make a wrong uncrustify version a fatal error
We know that using a different version of uncrustify produces different
results. So make that an error rather than a warning.

Also make the error output more helpful if uncrustify is not found.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-03 18:50:52 +01:00
Manuel Pégourié-Gonnard ae9df49173 Merge pull request #184 from gilles-peskine-arm/config-error-on-removed-options-spec
Framework to generate config checks: specification
2025-11-03 10:23:20 +01:00
Gilles Peskine f56fd874f4 Mention how config checks are generated from historical information about config symbols
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine edebb385b1 We can now have generated checks on the finalized config as well
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine 9510120ba9 Clarify that including *_after.h is not the normal behavior of build_info.h
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine a70a7c7507 Recall that config checks are an internal matter
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine 927b641b7d Fix formatting inside <code>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine 0b7f20705f Note that changing a subproject option is bad
There was a section about this, but the idea was missing in the introductory
section.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine 2cdc7b3fcb Typos
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine 8035d8e2da Do include the generated checks in make generated_files
Now that they aren't public headers any longer, there's no reason to have a
different mechanism.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine 3c0d70037d Initial specification document
Discuss why some configurations are undesirable. Document the current
`check_config.h`. Document new generated checks: why and how, but not the
details of what (RTFS).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-10-31 21:12:55 +01:00
Gilles Peskine 5ef7a4c9d8 Merge pull request #228 from ruiliio/psa_aes_xts
AES-XTS: update test generation for double-size key handling
2025-10-31 16:18:07 +01:00
Manuel Pégourié-Gonnard 875ec308e7 Merge pull request #224 from bjwtaylor/move-lcov
Add adapted lcov.sh to the framework
2025-10-24 10:46:14 +02:00
Valerio Setti a7de749187 data_files: remove duplicate of ec_256 files and regorganize
- there was already a SEC1 formatted EC file for secp256r1 so
  ec_256_prv.sec1.der was useless;
- all other ec_256_[pub|priv] files should be generated starting from
  ec_256_prv.pem

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-23 23:53:11 +02:00
Valerio Setti c1be4dc753 data_files: fix format of ec_256_prv.pk8.der
Previously the file format was PEM even though the extension suggests it
should be DER. This commit set the correct format.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-23 23:10:57 +02:00
Valerio Setti c0011b3574 data_files: fix Makefile's target commands for EC secp256 curves
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-23 18:25:57 +02:00
Valerio Setti 3b52387aef data_files: add files for EC secp256r1 with PKCS8 and DER/PEM formats
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-21 16:11:28 +02:00
Valerio Setti 8f8fbfabc1 data_files: add EC public key file for secp256r1 in RFC 5480 and DER format
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-21 16:11:28 +02:00
Valerio Setti 460f64cd7d data_files: add EC secp256r1 private key data files in SEC1 format
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-21 16:11:28 +02:00
Ben Taylor 23fe0158c6 Correct to use lowercase crypto in library name
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-21 11:22:12 +01:00
Ben Taylor b39e6ae045 Correct lcov target title
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-21 11:21:02 +01:00
ruiliio 2f8c92d2a5 AES-XTS: update test generation for double-size key handling
Signed-off-by: ruiliio <ruili3422@gmail.com>
2025-10-20 13:27:09 -07:00
Ben Taylor d6d579a240 Remove debug from lcov script
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-20 09:25:10 +01:00
Ben Taylor 092a5bad38 Add improvements to the lcov script to better handle 3.6
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-20 09:25:10 +01:00
Ben Taylor bce82f78ca Add adapted lcov.sh to the framework
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-10-20 09:25:10 +01:00
Minos Galanakis 4579964747 Merge remote-tracking branch 'restricted/main-restricted' into framework-common
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
mbedtls-4.0.0_tf-psa-crypto-1.0.0
2025-10-02 15:25:04 +01:00
Bence Szépkúti d80c4f9ec3 Merge pull request #209 from gilles-peskine-arm/compliance-split-framework
Split test_psa_compliance.py
2025-09-30 11:00:51 +02:00
Gilles Peskine ab4d9cee6d Merge pull request #218 from gilles-peskine-arm/PSA_KEY_USAGE_DERIVE_PUBLIC-framework
PSA_KEY_USAGE_DERIVE_PUBLIC is not valid in key policies
2025-09-25 16:25:48 +02:00
Gilles Peskine 0920bdab56 PSA_KEY_USAGE_DERIVE_PUBLIC is not valid in key policies
We have a new usage flag `PSA_KEY_USAGE_DERIVE_PUBLIC` which is (so far)
only meant for checking a key's capabilities, and not valid in key policies.
Exclude this flag from systematic checking of usage flags.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-25 11:44:27 +02:00
Gilles Peskine 0bfaf0ed97 Merge pull request #164 from gilles-peskine-arm/config-error-on-removed-options-framework
Mechanism to error out on removed configuration options
2025-09-24 17:18:13 +02:00
Gilles Peskine 0acab5c3c6 Improve documentation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-23 16:26:04 +02:00
Gilles Peskine 48a1cbc930 Use -C as the option to convey a directory to run git in
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-23 16:24:27 +02:00
Gilles Peskine 00dddd271f Fix save_config_history.sh when options are passed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-23 16:24:05 +02:00
Gilles Peskine 4402172a0f Remove redundant assignment
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-23 16:18:17 +02:00
Gilles Peskine fcfe1920c4 Remove subproject as a constructor argument
There's only one subproject and that's unlikely to change, so being able to
specify a subproject at runtime is overkill.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-23 16:14:57 +02:00
Ronald Cron 59d77ef052 Merge pull request #217 from ronald-cron-arm/fix-clang-warning
Fix clang warning
2025-09-22 16:56:08 +02:00
Ronald Cron fe3e56f8af Fix clang warning
Fix clang warning related to mismatch
between function prototype and
function definition: void func(void) vs void func().

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-09-22 10:32:51 +02:00
Gilles Peskine 8943efa136 Save config information about TF-PSA-Crypto 1.0 and Mbed TLS 4.0
Use today's `development` head and the crypto submodule there.

We may update this again before the release. Once the release is out, we
should update to the release tags.

```
scripts/save_config_history.sh 06bae1e110ce71b44c3f4d17974d24feea4d2a92 1.0
scripts/save_config_history.sh 07912c9e36 4.0
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-19 21:12:22 +02:00
Gilles Peskine 013438891a Save config information about Mbed TLS 3.6
Use the latest patch release at this time, namely 3.6.4. This is the last
release made before the first non-beta release of the next major version.

```
scripts/save_config_history.sh mbedtls-3.6.4 3.6
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-19 21:12:22 +02:00
Gilles Peskine 83e8568dcf New script to save historical config options information
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-09-19 21:12:22 +02:00