3056 Commits

Author SHA1 Message Date
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
David Horstmann
0a8abdea8b Update wrapper generation script and regenerate
Update the guards generated by the wrapper generation script to use
!MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS and regenerate the PSA test
wrappers.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-14 14:47:48 +00:00
David Horstmann
4a48becdba Invert and rename config option
Replace MBEDTLS_PSA_COPY_CALLER_BUFFERS with inverse:
!MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS. This ensures that buffer
protection is enabled by default without any change to the Mbed TLS
config file.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-14 14:47:48 +00:00
Manuel Pégourié-Gonnard
93071cfeec
Merge pull request #8920 from valeriosetti/issue8919
Generalize some PK functions from MBEDTLS_PSA_CRYPTO_C to MBEDTLS_PSA_CRYPTO_CLIENT
2024-03-14 11:32:23 +00:00
Dave Rodgman
775c7768ee
Merge pull request #8877 from gilles-peskine-arm/split-minimal-3.6
Create a minimal framework submodule
2024-03-13 14:30:09 +00:00
Bence Szépkúti
fac1122b85 Rename solution files to referece VS2017
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-03-13 11:23:16 +01:00
Paul Elliott
4de4cc4a29
Merge pull request #8891 from Ryan-Everett-arm/document-SE_C-not-threadsafe
Officially document non thread-safety of MBEDTLS_PSA_CRYPTO_SE_C
2024-03-13 09:42:49 +00:00
Valerio Setti
63097759f8 all.sh: modify/add test components for CRYPTO_CLIENT
The already existing component_test_psa_crypto_client() is renamed
as component_test_default_psa_crypto_client_without_crypto_provider()
while component_build_full_psa_crypto_client_without_crypto_provider()
was added.

- Both of them check that the missing symbols at link time (if any)
  belong to the psa_xxx() family.
- The former builds with default config + CRYPTO_CLIENT - CRYPTO_C and
  then runs test suites.
- The latter only perform the builds using the full config and then
  it checks that PK-PSA bridge functions are present.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-13 09:52:36 +01:00
Gilles Peskine
68f46414cb
Merge pull request #8894 from daverodgman/quietbuild2
Follow-up non-verbose logs
2024-03-13 00:50:42 +00:00
David Horstmann
93fa4e1b87 Merge branch 'development' into buffer-sharing-merge 2024-03-12 15:05:06 +00:00
Manuel Pégourié-Gonnard
d7e7f48323
Merge pull request #8774 from valeriosetti/issue8709
Implement mbedtls_pk_copy_from_psa
2024-03-12 13:45:27 +00:00
Dave Rodgman
235799bc23 Simplify locating original tool
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-03-12 13:33:09 +00:00
Dave Rodgman
294a3c2ccb Remove unnecessary use of export
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-03-12 13:32:36 +00:00
Dave Rodgman
a7f3c4e1d0
Merge pull request #8822 from daverodgman/sha3-perf
SHA-3 performance & code size
2024-03-12 13:14:40 +00:00
David Horstmann
5ba3f5f7a5 Flip logic of generate_psa_wrappers.py
Change from a long list of PSA functions to a list of excluded
false-positives.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-11 15:57:43 +00:00
David Horstmann
5d64c6acca Generate memory poisoning in wrappers
Generate memory poisoning code in test wrappers for:
* psa_sign_hash_start()
* psa_sign_hash_complete()
* psa_verify_hash_start()

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-11 15:56:13 +00:00
David Horstmann
63dfb45e5e
Merge pull request #1181 from tom-daubney-arm/key_agreement_buffer_protection
Implement safe buffer copying in key agreement
2024-03-11 15:10:49 +00:00
Valerio Setti
3a815cbd2f all.sh: keep RSA_C enabled in component_full_no_pkparse_pkwrite()
This is possible because after #8740 RSA_C no longer depends on
PK to parse and write private/public keys.

This commit also solves related issues that arose after this change
in "pk.c" and "test_suite_pk". In particular now we can use
rsa's module functions for parsing and writing keys without need
to rely on pk_parse and pk_write functions.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-11 11:34:53 +01:00
Valerio Setti
a41654d5b1 all.sh: add test component based on full config without PK_[PARSE|WRITE]_C
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-11 09:48:40 +01:00
Dave Rodgman
4c4f1f1428 Avoid recursion for relative paths
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-03-07 17:25:52 +00:00
Dave Rodgman
c02c5b1520 Follow-up for less verbose logging
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-03-07 17:25:52 +00:00
tom-daubney-arm
d4c57c0ad2
Merge branch 'development-restricted' into key_agreement_buffer_protection
Signed-off-by: tom-daubney-arm <74920390+tom-daubney-arm@users.noreply.github.com>
2024-03-06 16:47:13 +00:00
Ryan Everett
63c1cf7eaa Remove MBEDTLS_THREADING_C check in check_test_dependencies
At the moment our tests only check for MBEDTLS_THREADIN_PTHREAD

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-06 16:46:15 +00:00
Paul Elliott
16d5160504 Allow the use of threading dependancies in PSA tests.
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-03-06 16:46:15 +00:00
Ryan
b0b3c0d80a Disable MBEDTLS_SELF_TEST in the TSan config
Enabling this causes TSan warnings, as some self-tests use unprotected globals
(see X_count variables in ecp.c). This isn't an issue, as these globals are only
read in self tests, which do not use threads.

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-06 16:46:08 +00:00
Paul Elliott
8a2062c538
Merge pull request #8892 from paul-elliott-arm/add_threading_to_drivers
Ensure drivers have threading enabled if required
2024-03-06 14:35:49 +00:00