31490 Commits

Author SHA1 Message Date
Valerio Setti
efce6052d8 test: add new component to test core library without calloc/free
This commit also fixes issues found in test suites
function/data files.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 13:31:19 +02:00
Valerio Setti
168d24a00d test: add new component to test MBEDTLS_PSA_STATIC_KEY_SLOTS
This commit also fixes related errors in test suites. In all
cases those failures are related to the use of raw keys whose
size cannot be determined a-priori.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 13:31:19 +02:00
Valerio Setti
8d4f15013f 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 13:31:19 +02:00
Gabor Mezei
64ab48da49
Update framework
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-10-21 14:35:09 +02:00
Gilles Peskine
043f6dc0ff
Merge pull request #9680 from gilles-peskine-arm/test-cases-not-executed-enforce-3.6
Backport 3.6: Test cases not executed: switch to enforcement mode
2024-10-18 18:19:30 +00:00
Manuel Pégourié-Gonnard
901f6c1a4c Fix a typo in a comment
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-18 09:57:48 +02:00
Gilles Peskine
2d94866764 Merge remote-tracking branch 'mbedtls-3.6' into test-cases-not-executed-enforce-3.6
Conflicts:
* framework: update to the head of 'main'.
2024-10-17 21:20:56 +02:00
David Horstmann
e905442f7e
Merge pull request #9675 from eleuzi01/backport-9673
[Backport 3.6] Move TLS auxiliary test scripts to the framework
2024-10-17 17:18:57 +00:00
Manuel Pégourié-Gonnard
7f3d37f4bf all.sh: fix missing quotes
Without quotes, when the variable is empty, the shell will see three
tokens: [, -n, ]. After skipping ] as usual, it will see a single token,
so it will consider it not as command, but a string to be tested for "is
it empty", and since "-n" is not empty, the command will return true.

With quotes it see 4 tokens: [, -n, <empty string>, ] and interprets -n
as desired.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-17 09:17:26 +02:00
Gilles Peskine
6d268e3fe1 Update framework to main
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-16 19:33:59 +02:00
Elena Uziunaite
fcda6f1281 Update submodule after the merge
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-16 14:58:07 +01:00
Manuel Pégourié-Gonnard
3eac5080fe all.sh: adjust for when tf-psa-crypto is absent
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:47:07 +02:00
Manuel Pégourié-Gonnard
96bfc17be1 all.sh: re-instate 3.6-specific code
Reverts "all.sh: temporary alignment with development"

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:38:55 +02:00
Manuel Pégourié-Gonnard
41ba526f99 all.sh: update documentation
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:43 +02:00
Manuel Pégourié-Gonnard
5d221de68c all.sh: move top-level code to a function
Now the output of
    grep '^[^ {}#]' tests/scripts/all-*.sh | grep -v '()'
is clean, with the only results being:
- shopt -s extglob which is needing for parsing the rest
- usage message

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:42 +02:00
Manuel Pégourié-Gonnard
327edec3c2 all.sh: document new file structure
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:42 +02:00
Manuel Pégourié-Gonnard
535e8aa1d3 all.sh: move definitions to all-core.sh
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:42 +02:00
Manuel Pégourié-Gonnard
2969280bc5 all.sh: wrap main code into main() function
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:41 +02:00
Manuel Pégourié-Gonnard
23fa1b5edf all.sh: move clang_version() to helpers file
This function is only used in (a few) components, it's not part of the core.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:41 +02:00
Manuel Pégourié-Gonnard
36ae06b842 all.sh: move component helpers to separate file
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:40 +02:00
Manuel Pégourié-Gonnard
03ad80ce97 all.sh: Move some functions to the right section
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:40 +02:00
Manuel Pégourié-Gonnard
452db6050b all.sh: rename a helper function
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:40 +02:00
Manuel Pégourié-Gonnard
6fb63b0ad6 all.sh: extract repeated code to a function
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:39 +02:00
Manuel Pégourié-Gonnard
9a132e2a9f all.sh: group psasim helpers
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:39 +02:00
Manuel Pégourié-Gonnard
cd1148d43a all.sh: rm obsolete functions
The only occurrences found by git grep were the definitions and the
comment saying these are kept for backwards compatibility.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:39 +02:00
Manuel Pégourié-Gonnard
2c3a6241ed all.sh: first define functions, then call them.
Don't interleave defining functions with running some code.

The only exception is calling shopt, which needs to come first as it
affects how the following function definitions are parsed.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:24:38 +02:00
Manuel Pégourié-Gonnard
86c483876c all.sh: temporary alignment with development
This change is not correct for 3.6 and will be reverted. It is only
applied as a temporary measure to avoid conflicts while cherry-pick
changes from development.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:23:41 +02:00
Manuel Pégourié-Gonnard
8535f4c158 all.sh: align-dev: PSAsim functions
Again, useless but harmless for 3.6.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:19:39 +02:00
Manuel Pégourié-Gonnard
6c0c0f20d0 all.sh: align-dev: tf-psa-crypto stuff
For 3.6 this is useless but should be harmless.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:19:38 +02:00
Manuel Pégourié-Gonnard
7955091b17 all.sh: align-dev: move functions to the right place
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:09:08 +02:00
Manuel Pégourié-Gonnard
c97413463a all.sh: align with development: whitespace
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-16 10:08:15 +02:00
Elena Uziunaite
5adc9c304b Add "common.h"
Needed after b81cd1af6418823a2b5ffbd3710ceac9b0e0afa4 (#9671)
since generate_ssl_debug_helpers.py was moved to the framework

Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 16:58:16 +01:00
Janos Follath
7ea648f58a
Merge pull request #9696 from Harry-Ramsey/code-style-framework-submodule-support-3.6
[Backport 3.6] Improve support for submodules in code_style.py
2024-10-15 14:18:12 +00:00
David Horstmann
78542bf85d
Merge pull request #9698 from gilles-peskine-arm/3.6.2-rc2-mergeback-3
Merge 3.6.2 into 3.6 (updated cmake gcc+Asan build flags)
2024-10-15 14:00:21 +00:00
Elena Uziunaite
5446fc1605 Update submodule
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 12:41:42 +01:00
Elena Uziunaite
a739542327 Adjust file path for translate_ciphers.py
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 12:41:42 +01:00
Elena Uziunaite
1d8a2257d8 Adjust file path for generate_tls13_compat_tests.py
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 12:41:42 +01:00
Elena Uziunaite
7f5ec13a12 Adjust file path for generate_ssl_debug_helpers.py
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 12:41:42 +01:00
Elena Uziunaite
6f4ec30bd1 Move some files to framework repository
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-10-15 12:41:12 +01:00
Gilles Peskine
6864fa9b3b Declare a generated file that was added after 3.6.1
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-15 12:06:18 +02:00
David Horstmann
bfb9f71fa3 Revert "Add generated files"
This reverts commit 0d1117692ee261d6d89e2819a742c64e06e5bd42.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-10-15 12:06:18 +02:00
Gilles Peskine
bac001f62e Temporarily comment out tests that are clogging the CI
The pk_write_pubkey_check sometimes take ~3 hours to run with
GCC+Asan on the CI in the full config. Comment out the slowest
ones while we investigate and release 3.6.2.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-15 12:06:18 +02:00
Gilles Peskine
765da156bd Work around GCC 5 performance problem with Asan+UBSan and -O3
Old GCC versions hit a performance problem with test_suite_pkwrite
"Private keey write check EC" tests when building with Asan+UBSan
and -O3: those tests take more than 100x time than normal, with
test_suite_pkwrite taking >3h on the CI. Observed with GCC 5.4 on
Ubuntu 16.04 x86_64 and GCC 6.5 on Ubuntu 18.04 x86_64.
GCC 7.5 and above on Ubuntu 18.04 appear fine.

To avoid the performance problem, use -O2 instead of -O3 in then "Asan"
build type with GCC. It doesn't slow down much even with modern compiler
versions.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-15 12:06:00 +02:00
Harry Ramsey
5098d0474a 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-14 14:58:36 +01:00
Gilles Peskine
107ea89daa Fix completion mistake in changelog entry
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
v3.6.2 mbedtls-3.6.2
2024-10-14 11:34:18 +02:00
David Horstmann
93d421e751 Defer static keystore to 3.6.3
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-10-14 11:08:07 +02:00
David Horstmann
9e1201130f Update BRANCHES.md
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-10-14 11:08:01 +02:00
Gilles Peskine
a712d8dda5 Bump version to 3.6.2
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-14 11:04:31 +02:00
Gilles Peskine
453fd05333 Changelog entry for security fix
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-14 11:03:24 +02:00
Valerio Setti
3b9f4bec3f test_suite_pkwrite: extend coverage of wrong output buffer sizes in pk_write_check_common()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-14 10:37:01 +02:00