3031 Commits

Author SHA1 Message Date
Ronald Cron
7661aa0e20 Do not use --recurse-submodules
On the CI, the git version when running on
Ubuntu 16.04 is 2.7 and it does not support
the "--recurse-submodules" option of
"git ls-files" thus do not use it.

Another argument to not use it is that
when TF-PSA-Crypto will be a submodule of
mbedtls we will not want check_files.py to
check the TF-PSA-Crypto files as well.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-05-03 16:25:07 +02:00
Valerio Setti
d74d2ab9db check-generated-files: add test_certs.h file to the list of checked items
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-03 15:51:21 +02:00
Valerio Setti
5f37b25862 generate_test_cert_macros: minor fixes
- use build_tree to get the project root path
- remove "if True" in an "if" statement

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-03 15:51:11 +02:00
Valerio Setti
7f6eabd9b1 generated_test_keys: minor fixes
- rewrite output file (do not append)
- remove useless "os" import
- move pylint for main() function

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-03 15:33:18 +02:00
Valerio Setti
19f5566843 generate_test_keys: remove left-over variable
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-02 16:11:26 +02:00
Ronald Cron
1e05debd60 Extend basic checks of files to framework files
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-05-02 15:53:28 +02:00
Valerio Setti
5ce51b153c generate_test_keys: do not quit script if output file already exists
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-02 14:40:03 +02:00
Thomas Daubney
1ca1f3d62f Restore Mbed TLS style AEAD options for now
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-05-02 09:48:29 +01:00
Gilles Peskine
ff3b8211ff Driver-only FFDH is not good enough for DHE support in TLS 1.2
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-30 16:20:20 +02:00
Valerio Setti
0ddab0ecee generate_test_keys: add missing flush at the end of script
Ensure that all the data is actually written to the output file.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-30 10:37:39 +02:00
Valerio Setti
84dc3297fb generate_test_keys: use build_tree to guess the MbedTLS root path
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-29 17:33:48 +02:00
Valerio Setti
f27d407332 generate_test_cert_macros: minor fixes
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-29 17:16:41 +02:00
Valerio Setti
455fb4e803 generate_test_cert_macros: embed input args
- Embed input arguments inside the script so as to simplify the
  calls in Makefiles/CMakeLists.
- add a new "--list-dependencies" command line option to print
  out the list of dependencies.
- Modify tests/Makefile accordinlgy.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-29 17:16:41 +02:00
Valerio Setti
96daf67701 fix "make generated_files" for test_keys.h and test_certs.h
This also add the check in tests/scripts/check-generated-files.sh

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-29 17:16:41 +02:00
Valerio Setti
52516a6a86 generate_test_keys: add default output file option
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-29 17:16:41 +02:00
Valerio Setti
270dcd15d9 tests: update Makefile to generate tests/src/test_keys.h
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-29 17:14:50 +02:00
Manuel Pégourié-Gonnard
024d3daa7d
Merge pull request #8986 from valeriosetti/issue8871
Improve test key generation in test_suite_pk
2024-04-29 09:25:37 +00:00
Thomas Daubney
ff33abd599 Modify component_test_tls1_2_default_cbc_legacy_cbc_etm_cipher_only_use_psa
Replace relevant Mbed TLS API config options with their PSA
API equivalents.

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-04-26 17:08:34 +01:00
Thomas Daubney
6258621a0b Modify component_test_tls1_2_deafult_cbc_legacy_cipher_only_use_psa
Replace relevant Mbed TLS API config options with their PSA
API equivalents.

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-04-26 17:01:16 +01:00
Thomas Daubney
b8cbbe7c90 Modify component_test_tls1_2_default_stream_cipher_only_use_psa
Replace relevant Mbed TLS API config options with their PSA
API equivalents.

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-04-26 16:46:06 +01:00
Manuel Pégourié-Gonnard
771fd7d1dc
Merge pull request #9022 from mpg/compat-fixes-dev
[dev] Small fixes to compat.sh (partial forward-port)
2024-04-24 07:11:49 +00:00
Ryan Everett
fcd744fe69 Set MBEDTLS_PSA_CRYPTO_CONFIG in component_test_no_rsa_key_pair_gen
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-04-22 10:44:24 +01:00
Manuel Pégourié-Gonnard
eb86b906d7 Fix full invocation of ssl-opt.sh
The previous commit had:
- one obvious mistake (-f NULL with default -e runs nothing)
- one unforeseen issue: OPENSSL_NEXT skips static ECDH
- arguably scope creep: the stated goal was to simplify the full
invocation (in particular, make it obvious that everything is run
without having to remember the default value of EXCLUDE), but it also
made an unrelated change: running most tests with OPENSSL_NEXT (hence
the previous point).

This commit should fix all this, in particular it switches back to
running most tests with OPENSSL and using OPENSSL_NEXT only when needed.

Hopefully in the future we'll do the opposite: most tests will run with
a recent OpenSSL, and only those that need an older one will use
something older. But that will be another PR.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-22 10:25:09 +02:00
Ryan Everett
daa322a2de Update component_test_psa_crypto_rsa_no_genprime
Prepare this component for PSA_CRYPTO_CONFIG to be on by default.
Rename it so that the name is still accurate when we remove legacy symbols

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-04-18 16:50:02 +01:00
Valerio Setti
36188219fc generate_test_keys: split group_id and key bitsize in the generated structure
- group_id is only used for EC keys;
- key bitsize only for RSA.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-17 17:06:26 +02:00
Valerio Setti
ee74339180 generate_test_keys: minor improvements
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-17 17:06:21 +02:00
Manuel Pégourié-Gonnard
62d0bb8f2c Simplify full invocation of compat.sh
We actually only need two invocations.

This also moves all the default tests to OPENSSL_NEXT, which is good
because OPENSSL is ancient.

I have no idea why NULL doesn't work with OPENSSL_NEXT (1.1.1a) server,
because according to the manpage [1], "ALL,COMPLEMENTOFALL" (which is
what we are using) should do it, and indeed

    $OPENSSL_NEXT ciphers "ALL,COMPLEMENTOFALL" | tr ':' '\n'

lists NULL ciphersuites, and also they work client-side with
OPENSSL_NEXT...

[1] https://www.openssl.org/docs/man1.1.1/man1/ciphers.html

Also, while at it, remove partial invocation (only non-default) from one
component, as we already have a full invocation in the same config (plus
ASan) in another component.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-17 12:39:00 +02:00
Manuel Pégourié-Gonnard
68deadd455
Merge pull request #8566 from mpg/driver-status
Document driver testing status
2024-04-17 07:57:15 +00:00
Valerio Setti
9aa4fa9572 generate_test_keys: generate also look-up table in script
Remove static declaration of look-up table from test_suite_pk
and generate it automatically with Python.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-16 14:10:02 +02:00
Valerio Setti
7031a4ebd8 generate_test_keys: generate arrays for all keys in asymmetric_key_data.py
Only unused (from test_suite_pk point of view) EC curves are skipped.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-16 10:31:15 +02:00
Valerio Setti
59c614be39 generate_test_keys: generate also RSA public key arrays
This is to manage RSA and EC keys in the same way in order to
prepare for the following commits.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-15 18:44:39 +02:00
Valerio Setti
862d14e694 generate_test_keys: minor improvements
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-15 17:58:43 +02:00
Valerio Setti
8f40460b2b generate_test_keys: fix mypy issue for imported path
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-15 15:09:10 +02:00
Manuel Pégourié-Gonnard
1fb4750aed
Merge pull request #8998 from ronald-cron-arm/openssl3
Use latest installed OpenSSL 3 as OPENSSL_NEXT
2024-04-15 08:32:42 +00:00
Manuel Pégourié-Gonnard
1f4c9051cd all.s: Rm redundant build-only accel components
Most of them (2 exceptions, see below) are of the "driver + built-in"
type, so they're all a subset of test_psa_crypto_driver which tests
everything with driver + built-in at once.

Furthermore, all those components were build-only, while
test_psa_crypto_driver runs the test suites.

Special cases: two of the components looked like they were trying to go for
driver-only (ecdh disabling ECDH_C and hkdf disabling HKDF_C).

For ECDH, built-in would actually be re-enabled because not enough was
accelerated: you also need ECC key types and curves - see
component_test_psa_crypto_config_accel_ecdh which does this correctly.

For HKDF, we don't have test driver support for key derivation yet. I
guess that shows how little testing value these build-only components
really had.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
1ad29c818b Rm redundant driver+built-in all.sh component
As the comment says, this component's only goal was to make sure the
legacy+driver test cases in test_suite_md.psa were executed.

But actually these are already executed in
component_test_psa_crypto_drivers which tests with everything having
both a driver and the built-in, as can be seen in the outcomes file.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
733a67bb9a all.sh: group helper functions in sections
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Valerio Setti
6bda5f5717 generate_test_keys: use keys from asymmetric_key_data.py
asymmetric_key_data.py already provides EC/RSA key pair values that
are suitable for generate_test_keys.py. So instead of re-generating
the keys using gen_key program, we use those keys.

This commit also:
- extends asymmetric_key_data.py to introduce
RSA bit sizes that are used in test_suite_pk but were missing from
asymmetric_key_data.py.
- updates test_keys.h with new keys.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-10 12:33:21 +02:00
Manuel Pégourié-Gonnard
a4b773d3bb
Merge pull request #6955 from inorick/nofa_no_session_tickets
Guard ticket specific TLS 1.3 function with macro
2024-04-08 08:56:17 +00:00
Valerio Setti
3e22bf2a31 generate_test_keys.py: minor improvements
- remove BEGIN_FILE/END_FILE lines from output header file.
- add single disclaimer at the beginning of the file instead
  of having it repeated for every array.
- improved exception message for missing key generation program.

This commits also regenerates "test_keys.h" in order to fully
comply with the new format.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-03 14:10:36 +02:00
Ronald Cron
dd96c0a2df all.sh: Use full instead of default as the base for the new component
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-02 17:46:44 +02:00
Ronald Cron
c5e81d2e64 Use latest installed OpenSSL 3 as OPENSSL_NEXT
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-02 15:20:41 +02:00
Valerio Setti
7126ba52e0 test_suite_pk: add python script to generate predefined keys
This commit adds "generate_test_keys.py" script to generate
predefined keys used in test_suite_pk. Keys are generated with
"programs/pkey/gen_key" tool and converted to C array using
the python script.

tests/src/test_keys.h is automatically generated using the
above mentioned script.

test_suite_pk is updated in order to use the new format.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-02 10:11:34 +02:00
Norbert Fabritius
d30e91150e all.sh: Add component testing default minus session tickets
Signed-off-by: Norbert Fabritius <norbert.fabritius@esrlabs.com>
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-27 09:37:37 +01:00
Minos Galanakis
b70f0fd9a9 Merge branch 'development' into 'development-restricted'
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-03-19 22:24:40 +00:00
Ronald Cron
d2cb7f4268 all.sh: Add TLS 1.2 only component
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-18 13:07:00 +01:00
Ronald Cron
46ac0658cf all.sh: Adapt/Fix some components
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-18 13:06:59 +01:00
Ronald Cron
a3f385d1a8 all.sh: Disable TLS 1.3 when pre-requisites are not meet
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-18 13:06:59 +01:00
Bence Szépkúti
567591eec7
Merge pull request #8923 from bensze01/drop-old-compilers
Drop Support for MSVC 2013, 2015 and Arm Compiler 5
2024-03-15 12:56:21 +00:00
Manuel Pégourié-Gonnard
e7c08af465
Merge pull request #8575 from lpy4105/issue/wrong-suite-name-in-check_test_cases_py
Fix wrong suite name in check_test_cases.py
2024-03-14 15:31:27 +00:00