1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-05 19:01:12 +03:00
Commit Graph

1618 Commits

Author SHA1 Message Date
c19f8aea8a Update config.py crypto for version files
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-04 13:37:42 +01:00
468c0aede9 Revert move of version.h to tf-psa-crypto libray
This commit moves version.h back into /include/mbedtls from
tf-psa-crypto/drivers/builtin/include. This commit also changes the
necessary build files and scripts to generate version_features.c

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-04 13:37:42 +01:00
560265154c Merge pull request #9604 from gilles-peskine-arm/config-full-booleans-only
config.py: don't rely on section names
2024-09-26 10:03:19 +00:00
3943a1a3bf Automatically generate tests/opt-testcases/tls13-compat.sh
`tests/opt-testcases/tls13-compat.sh` is supposed to be automatically
generated by `tests/scripts/generate_tls13_compat_tests.py`. So far, the
output has been updated by running the script manually and committing the
output. Switch to using our framework for generated files.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 18:59:31 +02:00
edc27bc080 Merge pull request #9128 from gilles-peskine-arm/make_generated_files-document_CC
make_generated_files.bat: document C compiler requirement
2024-09-24 12:36:14 +00:00
475ed86c7a Merge pull request #9600 from gilles-peskine-arm/use_psa_crypto-key_id_encodes_owner-compatible-config-dev
Fix obsolete comment about MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
2024-09-24 10:44:56 +00:00
00b9144608 Don't pass the section name to adapters
We have finished removing the reliance of named configuration on section
names.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-23 15:56:26 +02:00
36571d6d8a Change "realfull" to activate everything
Change "realfull" to activate everything. After investigation, it seems that
having "realfull" not activate everything was a historical oddity due to
proximity with "full", not a goal in itself.

https://github.com/Mbed-TLS/mbedtls/issues/520#issuecomment-727190862
https://github.com/Mbed-TLS/mbedtls/pull/965/files#r523409092

This changes the output of `scripts/config.py realfull`: now all non-boolean
options are uncommented.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-23 15:44:46 +02:00
e4c6955e43 Change "full" to affect boolean settings rather than use sections
To get rid on the reliance on sections, change "full" and friends to enable
settings based on whether the setting is boolean, rather than based on the
section it contains.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-23 15:44:46 +02:00
702d75a2f9 Pass the setting's value to adapters
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-23 15:44:33 +02:00
a22b95a91c Fix obsolete comment about MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER has been compatible with
MBEDTLS_USE_PSA_CRYPTO since https://github.com/Mbed-TLS/mbedtls/pull/5380.
We still don't want to enable it in the full config because it's a behavior
change, even an interface change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-19 13:43:57 +02:00
cd326bfc49 Apply the parameter change
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:15 +02:00
317a2a3fed Fix documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
568808a41a Update member variable names
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
f5f130879c Fix documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
0e9e4cbbd8 Move commonly used part to config_common
Move the Setting, Config, ConfigFile and ConfigTool classes to config_common.
Also update the referencies to the moved classes.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
a12ed6bcb7 Unify spacing
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
24d7cc71af Create a class for command line config manipulation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
776ee9068d Fix header file detection
Make the include directory check relative to the source file in case not called
from the project root.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
d53080da2a Make the Config a proper base class
Due to the forward declaration issues, move the common descendant functions
and configfile handling to the `Config` base class.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
daf807f02d Fix pylint issues
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:13 +02:00
c659c1b164 Move config file modification flag handling to the Config class
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:13 +02:00
9f2b817fa7 Update documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:08 +02:00
fbb59bd73b Document the C compiler requirement
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-18 13:10:58 +02:00
73c4096442 Make the file a bit more readable
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-18 13:10:56 +02:00
2d5b17be03 Merge pull request #8609 from tom-daubney-arm/standardise_proj_detection
Standardise Project Detection in Shell Scripts
2024-08-07 07:18:36 +00:00
6b3bca5c78 Follow include path updates for C++ builds
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
ae8fa71669 Rename internal function psa_key_production_parameters_are_default
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
62ee8fdcf5 Test cpp_dummy_build in pedantic mode
In public headers, we want to avoid things that are not standard C++,
including features that GCC and Clang support as extensions, such as
flexible array members. So compile with `-pedantic`.

Non-regression for https://github.com/Mbed-TLS/mbedtls/issues/9020.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:32 +02:00
f9408282e8 Implement psa_generate_key_custom
Implement `psa_generate_key_custom()` and
`psa_key_derivation_output_key_custom()`. These functions replace
`psa_generate_key_ext()` and `psa_key_derivation_output_key_ext()`.
They have the same functionality, but a slightly different interface:
the `ext` functions use a structure with a flexible array member to pass
variable-length data, while the `custom` functions use a separate parameter.

Keep the `ext` functions for backward compatibility with Mbed TLS 3.6.0.
But make them a thin wrapper around the new `custom` functions.

Duplicate the test code and data. The test cases have to be duplicated
anyway, and the test functions are individually more readable this way.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
bda3e46846 Check for file at script startup
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-07-30 15:52:58 +01:00
5e9ffa9096 Redirect error message to stderr
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-07-29 12:09:57 +01:00
6a864dc5fe Add check for existence of project name file
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-07-26 17:31:46 +01:00
91f1746f35 Remove sanity check for None value
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:20 +02:00
4706fe7f03 Update documentation and comments
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:08 +02:00
3de658664b Adjust temporarily the crypto config file location
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:08 +02:00
33dd293723 Give better name for class
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:08 +02:00
c5ff33cedf Move config file modification checking to the Config superclass
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:08 +02:00
3e2a550f12 Pass ConfigFile object as parameter for MultiConfig constructor
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:07 +02:00
8d72ac60b3 Fix error type
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:07 +02:00
de6e192fd4 Add documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:07 +02:00
f77722d67f Rename calss
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:07 +02:00
9b0f9e77a0 Simplify set creation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:07 +02:00
e7742b360d Unify the _format_parameter function among the ConfigFile subclasses
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:07 +02:00
93a6d1f6ec Make the name parameter mandatory for the constructor of ConfigFile
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:07 +02:00
8a64d8e346 Only write config files if it is modified
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:07 +02:00
542fd38437 Update unsupported and deprecated psa fearues handling
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:06 +02:00
d723b51bef Fix for crypto config default value
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:06 +02:00
ee521b6137 Restructure the configuration representation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:06 +02:00
92065ed28d Fix pylint issues
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-07-25 11:00:06 +02:00