Commit graph

27889 commits

Author SHA1 Message Date
Tomás González
12787c9ba5 Remove invalid -l option from test scripts
The -l option mentioned in previous commits for both ssl-opt.sh and
compat.sh scripts should only be a --list-test-cases option.

Remove -l option from the help list.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:43:15 +01:00
Tomás González
38ecf9fa1e check_test_cases: Avoid removing duplicated test cases
One of the jobs of check_test_cases is to check for duplicate test
descriptions and to have them ordered:

 * Stop using a set to collect the different test cases from the
   test scripts.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:43:15 +01:00
Tomás González
4a86da2460 check_test_cases: Unify walk_compat_sh and walk_opt_sh into one
walk_compat_sh and walk_opt_sh are basically the same now, so:

 * Merge them into one function.
 * Use the --list-test-cases option for both of them.
 * Rename this merged function as collect_from_script which seems
   more appropriate as since it isn't iterating the script but
   calling it.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:43:15 +01:00
Tomás González
37a8739e4d ssl-opt.sh: Don't affect the order at which functions are printed
When adding the LIST_TESTS option, print_name can be called
before checking if the test case should be excluded or not.
Change this back to its previous state while still taking into
account the LIST_TESTS option.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:43:15 +01:00
Tomás González
be2c66e548 ssl-opt.sh: Simplify the implementation of the -l option
Instead of verifying if the LIST_TESTS variable has been set in
every function to avoid using the P_QUERY variable and avoid
calling a program that has not necessarily been compiled yet:

 * Define P_QUERY=":" when LIST_TESTS has been set.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:43:15 +01:00
Tomás González
06956a12aa Skip unnecessary logic when -l option is used
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:43:14 +01:00
Tomás González
f162b4f497 Only use CONFIGS_ENABLED when not listing tests
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Tomás González
0e8a08a1f7 Get options at beginning of program
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Tomás González
787428a08c Avoid skipping test when printing
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Tomás González
3a65d6368a Remove formatted string to make pylint happy
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Tomás González
970b39fb38 tests/check_test_cases: Use subprocess.check_output instead of run
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Tomás González
079eaee8ca Use file_name parameter in walk_ssl_opt_sh()
Remove hardcoded file_name and use the parameter provided in the
function.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Tomás González
546fc9ce9e Revert "Add opt-testcases into check list"
ssl-opt.sh now takes care of looking at the files in the
opt-testcases subdirectory, so use ssl-opt.sh directly
in walk_ssl_opt_sh().

 * Revert commit f17a60f147.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Tomás González
754f8cd959 tests/check_test_cases: Use ssl-opt.sh -l option instead of parsing
* Use the newly added ssl-opt.sh -l option to list all the tests
   cases and their used parameters instead of having to parse the
   file to discover them. This avoids having to add further parsing
   complexity in the future as discussed in
   https://github.com/Mbed-TLS/mbedtls/pull/8080#issuecomment-1681064743

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Tomás González
24552ff84e ssl-opt/run_test: Introduce -l option to list test case names
* Add an option in ssl-opt test case to list all the run_test calls
   and their names. This allows to show the parameters used and can
   make us avoid having to parse ssl-opt to look for extra
   parameters in the future.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-27 11:29:28 +01:00
Bence Szépkúti
51328162e6
Merge pull request #8374 from sergio-nsk/sergio-nsk/8372/2
Fix compiling AESNI in Mbed-TLS with clang on Windows
2023-10-26 21:21:01 +00:00
Dave Rodgman
2db1e354e3
Merge pull request #8408 from daverodgman/iar-fix-aes
Fix MBEDTLS_MAYBE_UNUSED for IAR
2023-10-26 15:53:11 +00:00
Gilles Peskine
b3d0ed2e6e
Merge pull request #8303 from valeriosetti/issue6316
Add test component with all ciphers and AEADs accelerated only
2023-10-26 15:53:10 +00:00
Gilles Peskine
e960ddd3df
Merge pull request #8306 from yanesca/psa_threads_design
Add the PSA threading design to the documentation
2023-10-26 15:53:10 +00:00
Gilles Peskine
4f144093ba
Merge pull request #8294 from gilles-peskine-arm/test-datax-chdir
Support running unit tests from another directory
2023-10-26 15:53:10 +00:00
Janos Follath
a365efc6f1 Threading design: fix internal links
Signed-off-by: Janos Follath <janos.follath@arm.com>
2023-10-26 10:22:55 +01:00
Ronald Cron
95b735530c
Merge pull request #6719 from yuhaoth/pr/tls13-early-data-add-early-data-of-client-hello
TLS 1.3: EarlyData SRV: Add early data extension parser.
2023-10-26 08:31:53 +00:00
Gilles Peskine
5d055f8206
Merge pull request #7844 from mpg/ssl-progs-usage
Fix usage & error reporting in SSL programs
2023-10-26 08:19:25 +00:00
Valerio Setti
507e08f9af analyze_outcomes: update cipher/aead data
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-26 10:05:01 +02:00
Valerio Setti
bbc46b4cc2 cipher: improve code readibility in mbedtls_cipher_setup()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-26 09:00:21 +02:00
Gilles Peskine
cc2bbfe905 Fix invocation with explicit .datax file
Don't chdir when invoking a test suite executable with an explicit .datax
file. The point of the chdir is to automatically find the .datax file (and
the relative location of the data_files directory) in typical cases. This
conflicts with the expectation that passing a relative path to a .datax file
will work.

(This is what I had originally intended, and what is documented in the
comment, but I forgot to add the argc check in the initial commit.)

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-25 17:45:50 +02:00
Gilles Peskine
bf3c3fa122 Define try_chdir everywhere
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-25 17:43:10 +02:00
Dave Rodgman
d1c4fb07ee Support older IAR versions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-10-25 15:07:35 +01:00
Valerio Setti
ad8b7f0306 all.sh: accelerate ALG_[STREAM_CIPHER/ECB_NO_PADDING] in accel_cipher_aead()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:39:50 +02:00
Valerio Setti
97454fde54 all.sh: accelerate CMAC in test_psa_crypto_config_accel_cipher_aead()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:27:12 +02:00
Valerio Setti
3b1559060a test_suite_psa_crypto: replace builtin dependencies with PSA_WANT
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
9d9b4b547f test_suite_cipher: use TEST_ASSUME() to evaluate supported ciphers
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
5cd18f9150 analyze_oucomes.py: ignore line-too-long error for skipped tests
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
b680fc4f0b all.sh: add a common configuration function for accel/reference components
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
93941440c1 all.sh: keep PKCS5/12 enabled in the reference component
This commit also add proper "ignore" fields to the "analyze_outcomes.py"
script.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
29bcd01cf3 all.sh: move [accel/reference]_cipher_aead to crypto_full
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
79a02de79f cipher: check that ctx_alloc_func is not NULL before calling it
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
a6c0761c43 cipher_wrap: fix guards for GCM/CCM AES
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
e86677d0c3 pkparse: fix missing guards for pkcs5/12 functions
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
58d2b1aff2 all.sh: fix minor issues
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
7448cee8f0 analyze_outcomes.py: skip tests that depends on builtin features
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
d3bdccc063 test_suite_cipher: successfully quit test if no cipher is supported
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Valerio Setti
b6b301fa8d test: add component accelerating both ciphers and AEADs
This also adds a new task in analyze_outcomes.py for checking
the accelaration coverage against the reference element.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-25 12:03:36 +02:00
Dave Rodgman
d69d3cda34
Merge pull request #8298 from daverodgman/sha-armce-thumb2
Support SHA256 acceleration on Armv8 thumb2 and arm
2023-10-24 21:23:15 +00:00
Dave Rodgman
f842868dd9 Fix MBEDTLS_MAYBE_UNUSED for IAR
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-10-24 14:18:38 +01:00
Manuel Pégourié-Gonnard
a675ef8537
Merge pull request #8368 from valeriosetti/issue8315
Clarify driver handling of ALG_STREAM and ALG_ECB
2023-10-24 07:32:12 +00:00
Dave Rodgman
514590210b Merge remote-tracking branch 'origin/development' into sha-armce-thumb2
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-10-23 15:35:07 +01:00
Dave Rodgman
66d5512571 Remove dependency on asm/hwcap.h
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-10-23 15:12:32 +01:00
Dave Rodgman
bcb810252c
Merge pull request #8363 from daverodgman/iar-fixes-2
Stop IAR warning about goto skipping variable definition
2023-10-23 14:59:15 +01:00
Valerio Setti
0244fbbf28 all.sh: accelerate ALG_ECB_NO_PADDING in test_psa_crypto_config_accel_cipher()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-23 15:07:43 +02:00