Gilles Peskine
92b90b848a
Fix mixup between secp224r1 and secp224k1 in test scripts
...
secp224k1 is the one with 225-bit private keys.
The consequences of this mistake were:
* We emitted positive test cases for hypothetical SECP_R1_225 and
SECP_K1_224 curves, which were never executed.
* We emitted useless not-supported test cases for SECP_R1_225 and SECP_K1_224.
* We were missing positive test cases for SECP_R1_224 in automatically
generated tests.
* We were missing not-supported test cases for SECP_R1_224 and SECP_K1_225.
Thus this didn't cause test failures, but it caused missing test coverage
and some never-executed test cases.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-09 09:53:54 +01:00
Dave Rodgman
ffb18d2012
Merge pull request #8670 from daverodgman/default-compiler-all-2.28
...
Backport CI perf: Use clang by default in all.sh
2024-01-04 12:58:50 +00:00
Dave Rodgman
0fd07d5e10
Mark test function with MBEDTLS_MAYBE_UNUSED
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 11:37:35 +00:00
Dave Rodgman
52c294acb4
backport MBEDTLS_MAYBE_UNUSED
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 11:37:17 +00:00
Dave Rodgman
e42c23569b
Don't use full path for setting CC
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:35:35 +00:00
Dave Rodgman
9d2c67f8e2
Use gcc in test_full_deprecated_warning
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:35:16 +00:00
Dave Rodgman
ce04f24737
Add -O2 to some CFLAGS which were not setting it
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:34:31 +00:00
Dave Rodgman
374b188468
Don't specify gcc unless the test requires it
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:30:57 +00:00
Dave Rodgman
b046b9a96b
Enable -O2 in depends.py
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:26:22 +00:00
Dave Rodgman
5b00fb111f
Use gcc in test_psa_compliance
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:26:17 +00:00
Dave Rodgman
b0660c22d9
Ensure test_psa_compliance uses gcc
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:26:07 +00:00
Dave Rodgman
e0a2f6d08d
Ensure clang is present
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:24:34 +00:00
Dave Rodgman
62be456449
Use clang by default
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-01-04 10:24:30 +00:00
Tom Cosgrove
0071830a4f
Merge pull request #8386 from paul-elliott-arm/remove_ssl_null_tls12_2_28
...
[Backport 2.28] Remove NULLing of ssl context in TLS1.2 transform population
2023-12-21 13:28:28 +00:00
Gilles Peskine
1631d1336b
Merge pull request #8638 from bensze01/fix_supported_components_2.28
...
[Backport 2.28] all.sh: Parse arguments before checking if a test is supported
2023-12-21 12:09:16 +00:00
Bence Szépkúti
b80ac7d73b
Merge pull request #8628 from tom-cosgrove-arm/ip_len-2.28
...
Backport 2.28: Avoid use of `ip_len` as it clashes with a macro in AIX system headers
2023-12-18 02:02:49 +00:00
Bence Szépkúti
2064c9b595
all.sh: Parse arguments before checking if a test is supported
...
Support for each test was checked before the command line had been
parsed, causing the support_ functions to ignore arguments that set a
tool's location.
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2023-12-15 20:40:18 +01:00
Dave Rodgman
4966eb8ce8
Merge pull request #8625 from davidhorstmann-arm/fix-uninit-mpi-test-2.28
...
[Backport 2.28] Fix possible free of uninitialized MPI
2023-12-13 11:19:21 +00:00
Tom Cosgrove
e1f6d3bebd
Backport 2.28: Avoid use of ip_len
as it clashes with a macro in AIX system headers
...
Fixes #8624
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-12-08 21:53:18 +00:00
David Horstmann
ec4c47f62b
Move MPI initialization to start of function
...
This prevents a call to mbedtls_mpi_free() on uninitialized data when
USE_PSA_INIT() fails.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-08 18:36:07 +00:00
Paul Elliott
0dc3ed029a
Merge pull request #8620 from davidhorstmann-arm/fix-selftest-doublefree-2.28
...
[Backport 2.28] Fix potential double-free in calloc selftest
2023-12-08 12:23:05 +00:00
David Horstmann
05fde60d89
Fix potential double-free in calloc selftest
...
Where calloc returns two references to the same buffer, avoid calling
free() on both references by setting one to NULL.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-07 14:28:52 +00:00
Dave Rodgman
f09b837977
Merge pull request #8614 from daverodgman/backport-filter-components-in-pr-job
...
Do not run Valgrind tests in PR jobs - backport 2.28
2023-12-06 23:05:31 +00:00
Bence Szépkúti
e1c6c4c962
Do not run Valgrind tests in PR jobs
...
Co-authored-by: Dave Rodgman <dave.rodgman@arm.com>
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2023-12-06 16:47:51 +00:00
Gilles Peskine
7655fd2d93
Merge pull request #8570 from yuhaoth/pr/fix-ciphersuite-list-wrong-for-mbedtls-2.28
...
Backport 2.28: ssl-opt.sh: Fix getting the list of supported ciphersuites.
2023-11-29 11:31:35 +00:00
Ronald Cron
ba77a66475
Align forced ciphersuite with test description
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2023-11-29 10:15:14 +08:00
Ronald Cron
6f2183f756
ssl-opt.sh: Remove unnecessary symmetric crypto dependencies
...
Same test cases as in the previous commit.
Remove the redundant symmetric crypto dependency.
The dependency is ensured by the fact that:
1) the test case forces a cipher suite
2) ssl-opt.sh enforces automatically that the
forced ciphersuite is available.
3) The fact that the forced ciphersuite is
available implies that the symmetric
cipher algorithm it uses is available as
well.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2023-11-29 10:15:12 +08:00
Ronald Cron
237e3f8e53
ssl-opt.sh: Fix some symmetric crypto dependencies
...
Fix some dependencies on symmetric crypto that
were not correct in case of driver but not
builtin support. Revealed by "Analyze driver
test_psa_crypto_config_accel_cipher_aead vs reference
test_psa_crypto_config_reference_cipher_aead" in
analyze_outcomes.py.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2023-11-29 10:13:50 +08:00
Ronald Cron
a8b474f42f
ssl-opt.sh: Add a check of the list of supported ciphersuites
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2023-11-29 10:11:47 +08:00
Ronald Cron
46a660a2c5
ssl-opt.sh: Fix getting the list of supported ciphersuites.
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2023-11-29 10:11:17 +08:00
Dave Rodgman
60dcdd1686
Merge pull request #8558 from gilles-peskine-arm/MBEDTLS_TEST_HAVE_xSAN-2.28
...
Backport 2.28: Fix test_suite_platform failure with Asan on modern Clang
2023-11-23 14:04:09 +00:00
Paul Elliott
20e76134ea
Merge pull request #8557 from gilles-peskine-arm/metatest-gcc-12-2.28
...
Backport 2.28: Fix metatest.c with gcc-12 -Wuse-after-free
2023-11-23 11:09:24 +00:00
Gilles Peskine
c3a9bdb2b5
Detect enabled GCC/Clang sanitizers
...
Occasionally we want tests to take advantage of sanitizers, or work around
them.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-22 18:00:31 +01:00
Gilles Peskine
e9616fdbc9
Fix the build with gcc-12 -Wuse-after-free
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-22 17:37:57 +01:00
Dave Rodgman
b9c70581a0
Merge pull request #8222 from tgonzalezorlandoarm/tg/backport-psa-low-hash-mac-size
...
Backport 2.28: Start testing the PSA built-in drivers: hashes
2023-11-21 15:39:36 +00:00
Gilles Peskine
feb98ccada
Merge pull request #8497 from ronald-cron-arm/remove-cocci-files-2.28
...
[Backport 2.28] Remove unused *.cocci files
2023-11-20 14:07:36 +00:00
Gilles Peskine
181844fa1f
Merge pull request #8491 from mschulz-at-hilscher/mbedtls-2.28
...
Backport 2.28: "CSR parsing with critical fields fails" #8377
2023-11-20 14:07:31 +00:00
Dave Rodgman
04a8d02f31
Merge pull request #8543 from gilles-peskine-arm/metatest-create-2.28
...
Backport 2.28: Create a metatest program
2023-11-20 10:16:39 +00:00
Gilles Peskine
e00255c41c
Improve explanations of what bad thing a metatest does
...
Especially clarify the situation with respect to mutex usage.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:52 +01:00
Gilles Peskine
96c87c4e7b
Uniformly use MBEDTLS_THREADING_C guards
...
Since the code compiles with MBEDTLS_THREADING_C, not just with
MBEDTLS_THREADING_PTHREAD, use MBEDTLS_THREADING_C as the guard. The runtime
behavior is only as desired under certain conditions that imply
MBEDTLS_THREADING_PTHREAD, but that's fine: no metatest is expected to pass
in all scenarios, only under specific build- and run-time conditions.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:52 +01:00
Gilles Peskine
d4084fd899
Readability improvement
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:52 +01:00
Gilles Peskine
c41133b90d
Add documentation
...
Explain the goals of metatests, how to write them, and how to read their
output.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:52 +01:00
Gilles Peskine
efc57cabd0
Uninitialized read: make the pointer non-volatile rather than the buffer
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:52 +01:00
Gilles Peskine
226f1bc080
More consistent usage of volatile
...
Fix MSVC warning C4090.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:52 +01:00
Gilles Peskine
53833516bf
Strengthen against possible compiler optimizations
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:52 +01:00
Gilles Peskine
2c04f57ffc
programs/test/metatest indirectly includes library/common.h
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:50 +01:00
Gilles Peskine
510c01c6ad
Add missing program to .gitignore
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:23 +01:00
Gilles Peskine
e38eb79e89
Add metatests for mutex usage
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:23 +01:00
Gilles Peskine
db2b5c94a6
Don't use %llx in printf
...
We still do MinGW builds on our CI whose printf doesn't support it!
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:23 +01:00
Gilles Peskine
6b3b7f832b
Fix cast from pointer to integer of different size
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-16 15:56:23 +01:00