Commit Graph

1940 Commits

Author SHA1 Message Date
Gilles Peskine 8d85112a44 Fix cipher suite syntax in requires call
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-06 09:32:20 +01:00
Gilles Peskine 8a534d9d78 Pacify pylint
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-06 09:32:20 +01:00
Gilles Peskine 38bc126e4b Assert log for both initial and subsequent handshake fragments
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-06 09:32:20 +01:00
Gilles Peskine 52d8701b99 Don't skip defragmentation test cases wih length < 16
Require the bug with defragmentation of encrypted handshake messages to be
fixed.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-06 09:32:20 +01:00
Gilles Peskine 3c889a4f3a Tweak log message assertions
In preparation for reworking mbedtls_ssl_prepare_handshake_record(),
don't assert negatively on "reassembled record".

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-06 09:32:20 +01:00
Gilles Peskine d850a6fe35 Tweak "waiting for more handshake fragments" log message
In preparation for reworking mbedtls_ssl_prepare_handshake_record(), tweak
the "waiting for more handshake fragments" log message in
ssl_consume_current_message(), and add a similar one in
mbedtls_ssl_prepare_handshake_record(). Assert both.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-06 09:32:20 +01:00
Gilles Peskine 67e3374460 Diversify handshake defragmentation tests in TLS 1.2 by encryption
The symmetric encryption used for transportation matters for TLS 1.2
defragmentation, since the code is sensitive to the presence of an
explicit IV. So have separate test cases for each class of symmetric
encryption.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-06 09:32:20 +01:00
Gilles Peskine 35c4387550 Clarify test case description
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-06 09:32:20 +01:00
Gilles Peskine 4a009d4b3c Improve --help
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-04 18:50:33 +01:00
Gilles Peskine c69a7f6c26 Use more abstractions for protocol version formatting
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-04 18:49:29 +01:00
Gilles Peskine 6749a8dcf7 Briefly explain BRE
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-04 18:45:34 +01:00
Gilles Peskine 69385652d0 Fix TLS 1.3 tests with OpenSSL failing in pure-PSK builds
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-04 18:29:21 +01:00
Gilles Peskine f88eb21ff1 Don't embed a path in the generated output
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-02 21:07:56 +01:00
Gilles Peskine e453777af1 Generate handshake defragmentation test cases
The output is identical to the manually written tests in
`tests/opt-testcases/handshake-manual.sh`, except that the script doesn't
generate explanatory comments (they're in the generator script instead).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-02 21:07:56 +01:00
Gilles Peskine 11e4f5ac1c New script to generate handshake tests for ssl-opt.sh
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-03-02 21:07:56 +01:00
Harry Ramsey 8067657142 Update filepath to demo_common.sh
This commit updates the filepath to demo_common.sh in dlopen_demo.sh and
the comment in demo_common.sh regarding how to use demo_common.sh.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-19 15:20:04 +00:00
Harry Ramsey 90e869ef4c Merge branch 'tmp-branch-move-files-to-framework' into move-files-into-framework 2025-02-19 15:18:08 +00:00
Harry Ramsey 98257b4e0f Move programs into the framework
This commit moves demo_common.sh, dlopen_demo.sh, metatest.c
query_compile_time_config.c, query_config.h, query_included_headers.c,
zeroize.c and test_zeroize.gdb from MbedTLS into the MbedTLS framework.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-19 15:17:23 +00:00
Ronald Cron 9c2eb756ca Merge pull request #137 from valeriosetti/issue136-framework
[framework] Add components-compliance.sh
2025-02-17 12:13:36 +01:00
Valerio Setti 843a8b0f5d test_psa_compliance.py: adapt for executing in tf-psa-crypto repo
components-compliance.sh has been moved from the Mbed TLS repo to the
TF-PSA-Crypto one. This means that the test_psa_compliance.py script
can be executed in the following scenarios:
* TF-PSA-Crypto repo in development branch;
* Mbed TLS repo in mbedtls-3.6 branch.

This commit includes all the required changes to make the script working
in both scenarios. It also fixes some paths management making them more
pythonic.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-02-14 15:20:25 +01:00
Harry Ramsey 8172207a63 Adapt doxygen scripts to run for TF-PSA-Crypto
This commit adapts the scripts apidoc_full.sh and doxygen.sh to run for
TF-PSA-Crypto out of source builds.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-11 13:53:49 +00:00
Harry Ramsey 2f62067dfd Adapt check-doxy-blocks to run for TF-PSA-Crypto
This commit adapts check-doxy-blocks to run for TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-11 13:53:49 +00:00
Valerio Setti 97d7e2adfa scripts: remove references to DHE-RSA
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-02-06 10:27:16 +01:00
Ronald Cron 2000db4295 Merge pull request #132 from valeriosetti/issue94-framework
[Framework] Move test_psa_*.py scripts to the framework
2025-02-05 09:56:29 +01:00
Harry Ramsey 94c386a8ea Update config paths in scripts
This commit updates the moved config paths in multiple script files.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-04 12:54:15 +00:00
Valerio Setti b66476cf12 check-python-files.sh: update path for test_psa_constant_names.py
Update the path of the file now that it has been moved to the framework
repo.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-02-04 11:46:49 +01:00
Valerio Setti 9d3a14412e test_psa_constant_names.py: reconcile 3.6 and development branches
The script had small differences between the development branch and the
mbedtls-3.6 ones. The goal of this commit is to reconcile those
differences in order to make it usable from both branches. This is
necessary now that the scripts lives in the framework repo.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-02-03 14:54:53 +01:00
Harry Ramsey e65f684879 Refactor TFPSACryptoCodeParser in check_names.py
This commit refactors TFPSACryptoCodeParser to throw exceptions for
usage in MbedTLS 3.6 as it is not compatible. This commit also removes
comments not related to building TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:56:33 +00:00
Harry Ramsey eaaf91ecd9 Refactor MBEDTLSCodeParer in check_names.py
This commit refactors MBEDTLSCodeParser to contain code necessary for
obtaining the required parse results from TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:51:28 +00:00
Harry Ramsey b54f3279b7 Improve documentation of check_names.py
This commit improves the documentation of check_names.py specifically
for the new class MBEDTLSCodeParser and TFPSACryptoCodeParser.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:51:28 +00:00
Harry Ramsey a58d44adbe Remove psa include for Mbed TLS Code Parser
This commit removes unncessary TF-PSA-crypto includes for the Mbed TLS
code parser class.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:51:28 +00:00
Harry Ramsey f1367be905 Fix pylint errors
This commit fixes numerous pylint errors where possible. For simplicty,
it is easier to keep the many arguments instead of refactoring into an
object.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-30 14:51:25 +00:00
Valerio Setti 24f398e0bc scripts: adapt import for python files being moved to the framework
Affected files are:

- test_psa_compliance.py
- test_psa_constant_names.py

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-01-29 17:21:37 +01:00
Valerio Setti 846f9471ea Merge branch 'tmp-branch-move-files-to-framework' into issue94-framework 2025-01-29 15:12:12 +01:00
Valerio Setti ca357e9c70 Move files into the framework
The following files are added (imported) from the main Mbed TLS repo:

scripts/test_psa_compliance.py
scripts/test_psa_constant_names.py

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-29 15:12:06 +01:00
Harry Ramsey 9c5b278942 Enable independent TF-PSA-Crypto name checks
This commit separates CodeParser into three classes. CodeParser a base
class containing methods for parsing .c and .h files as well as
retrieving symbols from compiled libraries.

As well as two subclasses of CodeParser: TF-PSA-Crypto_CodeParser and
MBEDTLS_CodeParser, which are responsible for parsing the TF-PSA-Crypto
and Mbed TLS libraries.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-24 14:29:55 +00:00
Gilles Peskine 8296a73ce0 Merge pull request #104 from gilles-peskine-arm/psa-storage-test-cases-never-supported-negative-framework
Switch generate_psa_test.py to automatic dependencies for negative test cases
2025-01-20 15:53:01 +01:00
Harry Ramsey 049270ef92 Enable collect_test_cases.py to work for TF-PSA-Crypto
This commit adapts collect_test_cases.py to work for Mbed TLS and
TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-17 13:31:05 +00:00
Gilles Peskine 89cc06d8ce Merge remote-tracking branch 'main' into psa-storage-test-cases-never-supported-negative-framework 2025-01-16 19:54:39 +01:00
Ronald Cron 40f125f6df Merge pull request #124 from ronald-cron-arm/framework-ci-3.6-fix
Fix framework CI against mbedtls-3.6
2025-01-15 14:39:16 +01:00
Harry Ramsey 024ec9ee85 Update license exemption list
As TF-PSA-Crypto is now a seperate repository, the license does not need
to be checked alongside Mbed TLS and instead has a seperate check.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-15 09:16:08 +00:00
Harry Ramsey f828f9c15e Enable check_files.py for TF-PSA-Crypto
This commit enables check_files.py to run for Mbed TLS and
TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-01-15 09:16:08 +00:00
Ronald Cron d67433304b Remove now unnecessary os imports
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-01-15 09:00:17 +01:00
Ronald Cron ee33e9f3ad Improve condition for seedfile in tf-psa-crypto
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-01-14 20:24:00 +01:00
Ronald Cron 7e215c8903 Improve branch checks based on tf-psa-crypto directory
Use build_tree module instead.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-01-14 16:23:08 +01:00
Ronald Cron 57ee691a3e Merge pull request #116 from valeriosetti/issue101-framework
Move pkgconfig.sh to the framework
2025-01-14 09:42:55 +01:00
Valerio Setti 3730e4a6b7 scripts: add new min_requirements.py script
This call into the "old" script that has been moved to the framework
repository. The *.requirements.txt files are kept on this repo though.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-13 13:16:40 +01:00
Valerio Setti f62b8baf27 Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

scripts/min_requirements.py

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-13 13:16:40 +01:00
Ronald Cron 71171b77f5 Merge pull request #105 from valeriosetti/issue86-framework
Move most of min_requirements.py to the framework
2025-01-13 10:02:13 +01:00
Valerio Setti a84269f2f8 scripts: min_requirements.py: small changes to work as module
- prevent the file from being called directly from the command line;
- allow to pass in the default requirement file so that each repo
  can specify its own version.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-01-13 05:36:30 +01:00