Commit Graph

33107 Commits

Author SHA1 Message Date
Gilles Peskine 6a7a144a08 Merge pull request #143 from gilles-peskine-arm/defragment-incremental-framework
Incremental TLS handshake defragmentation tests
2025-03-07 13:17:32 +01:00
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 0a94d05233 Merge pull request #142 from gilles-peskine-arm/tls-defragment-generate-tests-framework
Generate TLS handshake defragmentation tests
2025-03-05 16:48:37 +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
Ronald Cron 523a12d05b Merge pull request #131 from Harry-Ramsey/move-programs-from-mbedtls-to-framework
Move programs from mbedtls to framework
2025-02-20 09:44:47 +01:00
Harry Ramsey 483262b2a2 Update comments regarding the zeroize program
This commit updates comments regarding the moved zeroize files.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-19 15:20:04 +00:00
Harry Ramsey 18c5767d1d Update path of moved zeroize.c for GDB script
This commit updates the path of zeroize.c in the GDB script
test_zeroize.gdb.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-19 15:20:04 +00: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 7ef0c60260 Merge pull request #9992 from Harry-Ramsey/move-zeroize-memset-configuration
Move zeroize memset configuration
2025-02-19 10:11:05 +00:00
Harry Ramsey 82c42190a1 Update TF-PSA-Crypto pointer
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-19 08:04:35 +00:00
Harry Ramsey 2a75a60d34 Update path to user-config-zeroize-memset.h
This commit updates the path to user-config-zeroize-memset.h as it has
been moved to TF-PSA-Crypto.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-19 08:03:57 +00:00
Harry Ramsey 76e476245a Move zeroize config to TF-PSA-Crypto
This commit moves user-config-zeroize-memset.h to TF-PSA-Crypto where it
more appropriately belongs.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2025-02-19 08:03:57 +00:00
Ronald Cron 39e2e4c3cb Merge pull request #9957 from valeriosetti/issue136-development
[development] Add components-compliance.sh
2025-02-18 09:56:47 +00:00
Valerio Setti 1e781adb62 tf-psa-crypto: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-18 06:02:01 +01:00
Valerio Setti e06f9f3eba framework: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-17 17:43:15 +01:00
Valerio Setti 24e6ecb502 tests: move components-compliance.sh to tf-psa-crypto repo
This file is cancelled from the Mbed TLS repo and copied to the
TF-PSA-Crypto one.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-17 17:40:08 +01: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
Ronald Cron 655a117995 Merge pull request #115 from Harry-Ramsey/tf-psa-crypto-doxygen
TF-PSA-Crypto Doxygen Adaptations
2025-02-11 18:10:20 +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
Ronald Cron 03e704018a Merge pull request #9917 from valeriosetti/issue9685
[development] Remove the DHE-RSA key exchange
2025-02-09 11:43:50 +00:00
Valerio Setti bfc1ec15e6 tf-psa-crypto: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-07 17:48:11 +01:00
Valerio Setti 683e49e781 framework: update reference
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-07 17:47:59 +01:00
Ronald Cron 2eb60b8da3 Merge pull request #127 from valeriosetti/issue9685-framework
[Framework] Remove the DHE-RSA key exchange
2025-02-07 11:48:48 +01: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
Valerio Setti c8cac1d22f changelog: add note abot DHE-RSA removal
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:12:02 +01:00
Valerio Setti 1494a09ff7 test_suite_ssl: require GCM or ChaChaPoly in handshake_serialization()
Hanshake serialization requires that the selected ciphersuite uses
an AEAD algorithm. However, following the DHE-RSA removal, trying to
still use RSA signature might select a ciphersuite which is not using
AEAD, but CBC instead (see preference order in "ssl_ciphersuite.c").

This is especially problematic in tests scenarios where both GCM and
ChaChaPoly are disabled, so that CCM remains as the only AEAD algorithm.
Ciphersuites using RSA signature and CCM are very low on the preference
list, so very unlikely to be picked in tests. This cause a CBC one to
be selected in this case and the handshake_serialization() function
to fail.

In order to prevent failures from happening, in this commit we require
that either GCM or ChaChaPoly are enabled, so that ciphersuites using one
of these are likely to be picked.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:12:02 +01:00
Valerio Setti d137f15e1b mbedtls_config.h: remove definition of MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:12:02 +01:00
Valerio Setti f886924eec docs: remove references to DHE-RSA
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:12:01 +01:00
Valerio Setti 02ae66830e check_config.h: remove checks for DHE-RSA
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:05:58 +01:00
Valerio Setti 8438c637ee tests: remove references to DHE-RSA
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:05:58 +01:00
Valerio Setti b7e2eccf1f ssl_ciphersuites: remove MBEDTLS_KEY_EXCHANGE_SOME_XXDH_1_2_ENABLED
This symbol is unused in the code so it can be removed.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:05:58 +01:00
Valerio Setti b8621b6f9d ssl_ciphersuites: remove references to DHE-RSA key exchanges
In this commit also MBEDTLS_KEY_EXCHANGE_SOME_DHE_ENABLED is removed.
This cause some code in "ssl_ciphersuites_internal.h" and
"ssl_tls12_server.c" to became useless, so these blocks are removed
as well.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:05:58 +01:00
Valerio Setti 89743b5db5 ssl_tls: remove code related to DHE-RSA
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-02-06 10:05:58 +01:00