Commit Graph

33400 Commits

Author SHA1 Message Date
Valerio Setti 3a682feb75 data_files: update dates and MD alg in server[5|11]-rsa-signed.crt
- use SHA-256 instead of SHA-1 for "server5-rsa-signed.crt". This change is
  not applied to "server11.crt" because the goal there is to have as many
  features as possible which are _not_ part of suite-b (and SHA-1 is not
  part of it).
- move start/end dates forward so that certificates are valid for the
  next 10 years.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-12-02 12:45:31 +01:00
Valerio Setti 85cbd7ae63 data_files: add server11-rsa-signed.crt
This is almost identical to "server5-rsa-signed.crt" in the sense that it
includes an EC public key and it's signed with an RSA one.
The main difference compared to "server5-rsa-signed.crt" is that in this
case we're using a secp256k1 key, instead the companion one uses a
secp256r1. The important thing here is that the "k1" type does not belong
to "suite-b", while "r1" does.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-28 17:44:37 +01:00
Valerio Setti 75e471a66f data_files: add server11.key
This is a secp256k1 EC key. The goal is to use it in tests where a key
that does not belong to the "suite-b" list is required.
For example it can be used as counterpart of "server5.key" since this one
is secp256r1 and this curve type belong to "suite-b".

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-28 17:44:30 +01:00
Valerio Setti ca170622d5 data_files: add server5-rsa-signed.crt
This is basically identical to "server3.crt", i.e. it contains an EC public
key and it's signed by a RSA one. The difference is that in this case
we're using a secp256r1 EC key, instead of the secp192r1 that was used
in "server3.crt".

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-28 16:38:43 +01:00
Ronald Cron 1726775ccc Merge pull request #236 from gilles-peskine-arm/build_info-cleanup-1.0-framework
Clean up after 1.0: generate_config_checks.py, tf-psa-crypto/build_info.h
2025-11-20 17:28:44 +01:00
Gilles Peskine d6f03a4329 Document wildcard matching
The include and exclude lists use different library functions which have
different semantics for wildcards.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-19 19:52:05 +01:00
Gilles Peskine 16236cb8a2 Remove redundant entry in glob list
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-19 19:47:02 +01:00
Valerio Setti 6c9076eef1 Merge pull request #237 from gilles-peskine-arm/config_checks_generator-fix-windows-path
Fix generate_config_checks.py --list on Windows
2025-11-18 12:04:33 +01:00
Gilles Peskine 30bea3d767 Be more robust about exact paths
Don't insist so much on exact directory and file names. In particular, be
tolerant to new subdirectories of `include` directories.

The resulting list of files is almost the same, except that a few more
Everest files are getting parsed, which is harmless (and perhaps technically
a bug fix).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
Gilles Peskine 26adfccaaa Log which files get parsed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
Gilles Peskine fbb7e52304 Avoid splitting file names across lines in problem reports
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-17 23:50:13 +01:00
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
Gilles Peskine 7082fdc9c4 Make sure to list paths with / even on Windows
This is necessary when the tool that consumes the path requires
slash-separated paths, notably when it's CMake. I'm not aware of a potential
consumer that would require a path using backslashes.

Fixes Mbed-TLS/mbedtls#10502.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-11-14 14:59:07 +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