1643 Commits

Author SHA1 Message Date
David Horstmann
d9ad663cea Update common.mk with test helper object paths
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-18 15:50:44 +00:00
David Horstmann
bc06e2acb5 Add framework test include path to common.mk
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-18 15:50:44 +00:00
David Horstmann
5b93d97b95 Update references to test helpers
Replace:
* tests/src -> framework/tests/src
* tests/include -> framework/tests/include

Except for occurrences of:
* tests/src/test_helpers (since this only contains ssl_helpers.c)
* tests/src/test_certs.h
* tests/include/alt_dummy

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-18 15:50:44 +00:00
Manuel Pégourié-Gonnard
705690af69 Drop building with armcc5 in all.sh
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-29 11:46:47 +01:00
Ronald Cron
5f6e69dae5
Merge pull request #9693 from Harry-Ramsey/split-revert-error-development
Split error.h and move back error.c to mbedtls
2024-10-25 13:12:58 +00:00
Gilles Peskine
202b69c2b6
Merge pull request #9302 from valeriosetti/psa-use-static-slots
PSA: use static key slots to store keys
2024-10-24 07:27:48 +00:00
Valerio Setti
678e0fb3e5 psa: allow to use static key buffers instead of dynamic ones
This helps reducing heap memory usage and, if heap memory is
not used anywhere else in an embedded device, it also reduces
code footprint since there is no need for heap management code
in this case.

A new build symbol is added for this purpose, named
MBEDTLS_PSA_STATIC_KEY_SLOTS. It's disabled by default so that
normal usage of Mbed TLS library is not affected.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Harry Ramsey
08007ed23d Update guards for crypto only builds
This commit updates the guards for crypto only builds to prevent error.c
being built.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-22 16:35:31 +01:00
Harry Ramsey
924dca9d39 Move mbedtls_test_hook_error_add from error.c to helpers.c
This commit moves mbedtls_test_hook_error_add from error.c to helpers.c.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-18 15:16:05 +01:00
Harry Ramsey
c44f67b581 Fix error.c generation issue with headers
This commit fixes include issues with error.c. Since error_common.h now
defines error codes, this is a mandatory include. The macro
MBEDTLS_ERROR_C guards functions for strerror which is now found in
error.h.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-18 11:17:50 +01:00
Ronald Cron
4802aaab56 Adapt lcov.sh to multiple source directories
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-18 11:45:37 +02:00
Harry Ramsey
d2bcdba9ca Update generate_errors.pl for error header split
This commit updates generated_errors.pl to create the error.c file and
correctly include the error_common.h header file, which contains error
code definitions.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-18 08:19:50 +01: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
Janos Follath
c1cb3dcc0f
Merge pull request #9597 from Harry-Ramsey/code-style-framework-submodule-support
Improve support for submodules in code_style.py
2024-10-15 14:18:16 +00: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
Ronald Cron
cb81d8086f
Merge pull request #9671 from Harry-Ramsey/duplicate-common-header-file-development
Refactor duplicate common header file
2024-10-15 06:05:07 +00:00
Harry Ramsey
b81cd1af64 Update includes for generated files
This commit replaces the include of "common.h" with "ssl_misc.h" for
generated files.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-14 08:41:23 +01:00
Tom Cosgrove
0b4ccdd7c9
Merge pull request #9674 from gergelykarm/development
Fix driver schema json default type requirements
2024-10-10 13:53:14 +00: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
Gergely Korcsák
a3c2a8f2a2 Fix driver schema json default type requirements
Signed-off-by: Gergely Korcsák <gergely.korcsak@arm.com>
2024-10-10 13:16:32 +02:00
Gilles Peskine
041a84d1dc Downgrade mypy to a version that works with our code base
mypy >=0.960 rejects macro_collector.py.
https://github.com/Mbed-TLS/mbedtls-framework/issues/50

We currently need mypy >=0.940, <0.960. Pick 0.942, which works, and is the
system version on Ubuntu 22.04.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-09 14:12:59 +02:00
Gilles Peskine
1c5a252729 Upgrade mypy to the last version supporting Python 3.6
Upgrade mypy to 0.971, which is the last version that supports Python 3.6
(the oldest Python version that we currently run on the CI).

This fixes the error
```
framework/scripts/mbedtls_framework/outcome_analysis.py:119: error: Incompatible return value type (got "IO[Any]", expected "TextIO")
framework/scripts/mbedtls_framework/outcome_analysis.py:121: error: Incompatible return value type (got "IO[Any]", expected "TextIO")
```
As far as I can tell the fix is https://github.com/python/mypy/pull/9275
which was released in mypy 0.940.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-09 14:12:59 +02:00
Harry Ramsey
da8f42a357 Improve support for submodules in code_style.py
This commit improves support for submodules within code_style.py. A new
function get_submodule_hash retrieves the submodule hash at the time of
a commit allowing an appropriate diff to be seen.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-07 10:41:47 +01:00
Harry Ramsey
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
Harry Ramsey
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
Manuel Pégourié-Gonnard
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
Gilles Peskine
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
Paul Elliott
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
Tom Cosgrove
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gabor Mezei
cd326bfc49
Apply the parameter change
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:15 +02:00
Gabor Mezei
317a2a3fed
Fix documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
Gabor Mezei
568808a41a
Update member variable names
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
Gabor Mezei
f5f130879c
Fix documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
Gabor Mezei
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
Gabor Mezei
a12ed6bcb7
Unify spacing
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:14 +02:00
Gabor Mezei
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
Gabor Mezei
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
Gabor Mezei
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
Gabor Mezei
daf807f02d
Fix pylint issues
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:13 +02:00
Gabor Mezei
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
Gabor Mezei
9f2b817fa7
Update documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-19 10:47:08 +02:00
Gilles Peskine
fbb59bd73b Document the C compiler requirement
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-18 13:10:58 +02:00
Gilles Peskine
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