11358 Commits

Author SHA1 Message Date
Ronald Cron
0417a2c746 Adapt component_test_when_no_ciphersuites_have_mac
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 09:45:01 +02:00
Ronald Cron
cd33cd6abf test_when_no_ciphersuites_have_mac: Fix logs
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 09:24:32 +02:00
Ronald Cron
cfce75f4c4 Remove component_test_full_no_bignum
Remove test_full_no_bignum as duplicate
of the test of the reference config
confgi-symmetric-only.h and
component_test_psa_crypto_config_accel_ecc_no_bignum().
Specifically, component_test_full_no_bignum was
added as part of preparation work for that component.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 09:24:32 +02:00
Ronald Cron
7062d3d936 tests: src: Fix PSA test wrappers for PAKE
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 09:24:28 +02:00
Ronald Cron
8dbea48958 Adapt test_full_no_cipher_ components
Adapt test_full_no_cipher_ components with
MBEDTLS_PSA_CRYPTO_CONFIG enabled.

Remove the component with no PSA crypto and
the one with MBEDTLS_PSA_CRYPTO_CONFIG disabled.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 09:13:52 +02:00
Ronald Cron
a67f1beb46 Adapt test_crypto_full_md_light_only
Adapt test_crypto_full_md_light_only with
MBEDTLS_PSA_CRYPTO_CONFIG enabled.

No need to disable PSA_WANT_ALG_HKDF as
the PSA implementation of HKDF is independent
of hkdf.c and thus of MAC through md.c.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 09:13:52 +02:00
Ronald Cron
de0d7e6cd0
Merge pull request #9247 from ronald-cron-arm/move-psa-headers
Move PSA headers to a new tf-psa-crypto directory
2024-06-18 18:48:24 +00:00
Valerio Setti
2687e4797d psa_sim: make server ping time much faster
Reduce server's ping time for messages from 50ms to 1us because
otherwise tests suites will take forever to execute.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-18 10:37:30 +02:00
Tom Cosgrove
7c52100fbd
Merge pull request #9238 from tom-cosgrove-arm/psasim_update_for_operation_types
Update PSA simulator C code to do operations by handles
2024-06-13 10:13:40 +00:00
Ronald Cron
30ea2b9191 all.sh: Update clean-up of Makefiles generated by CMake
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-13 09:51:27 +02:00
Ronald Cron
36c3ae98cb Adapt check files
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-13 09:51:27 +02:00
Ronald Cron
7e5d61c41a Adjust more paths to PSA headers
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-13 09:51:20 +02:00
Ronald Cron
1451a76958 Adapt libtestdriver1 build
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-13 09:02:30 +02:00
Ronald Cron
c7e9e367bb Adjust build systems
Adjust build systems such as we can build
Mbed TLS in the default and full configuration.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-13 09:02:24 +02:00
Ronald Cron
5cdc22b458 all.sh: Fix clean-up of Makefiles generated by CMake
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-12 15:22:26 +02:00
Tom Cosgrove
0fe5b8d4a3 Add support for and run (a copy of) the PSA aead_demo program under PSA sim
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-11 17:26:17 +01:00
Tom Cosgrove
98760124b8 Make it possible to pass arguments to PSA sim psa_client
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-11 17:21:15 +01:00
Tom Cosgrove
b923b473e7 Have PSA sim client wrappers say which call fails, if one does
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-11 17:19:31 +01:00
Gilles Peskine
797991dd51
Merge pull request #9149 from gilles-peskine-arm/ssl-test-no-skip-all
ssl-opt.sh, compat.sh: Error out if not executing any tests
2024-06-11 13:59:09 +00:00
Ronald Cron
0133d84a3d
Merge pull request #9199 from tom-daubney-arm/modify_test_everest_curve25519_only_for_psa
Make everest component work with PSA_CRYPTO_CONFIG set
2024-06-11 13:58:00 +00:00
Valerio Setti
f98635c360 psasim: build server library and binary before client's ones
This allows to keep the same CONFIG_H while building the Mbed TLS
library and the application (no matter if it's client or server).

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-11 14:26:42 +01:00
Valerio Setti
75129e2ce3 psa_sim_crypto_[client/server]: check if CRYPTO_C is enabled
CRYPTO_C must or must-not be enabled on client and server
sides as follows:

- if it's enabled while building the client side it's a failure;
- it it's NOT enabled while building the server it's a failure.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-11 14:26:36 +01:00
Tom Cosgrove
51b2c86852 Use our own copy of programs/psa/psa_hash.c in the PSA simulator tests
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-11 14:26:03 +01:00
Tom Cosgrove
5ddd6591c3 Revert "Correctly build client-side code that's to be run under the PSA crypto sim"
This reverts commit e7a2230df7e9468f3a276edabe20a0705a492940.

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-11 14:26:03 +01:00
Tom Cosgrove
f252f61611 psa_sim_serialise.pl now creates the updated .c file
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-10 15:50:53 +01:00
Tom Cosgrove
db87a44898 psa_sim_serialise.pl now creates the updated .h file
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-10 15:50:13 +01:00
Tom Cosgrove
0d0415e6e0 Move the comment block in psa_sim_serialise.c back to where it belongs
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-10 15:49:02 +01:00
Tom Cosgrove
9ab19695b5 Make psa_sim_generate.pl output the new type of server wrapper we want
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-10 14:24:28 +01:00
Tom Cosgrove
517f4a1b4d Store operation_ts on PSA sim server side; only send handle to client
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-10 14:08:04 +01:00
Tom Cosgrove
d6048a459c We want the PSA hash code if MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-10 14:07:26 +01:00
Tom Cosgrove
e7a2230df7 Correctly build client-side code that's to be run under the PSA crypto sim
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-06-10 14:07:26 +01:00
Bence Szépkúti
d28534c5b0
Merge pull request #9062 from tom-daubney-arm/crypto_config-tls1_2_default_stream_cipher_only_use_psa
Make TLS 1.2 components work with PSA_CRYPTO_CONFIG set
2024-06-10 11:54:37 +00:00
David Horstmann
8493452d6f Extend python checks to framework scripts
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-06-07 11:09:31 +01:00
Bence Szépkúti
c085cc767d
Merge pull request #9200 from davidhorstmann-arm/move-test-generation-files
Move test generation files to framework
2024-06-04 09:23:17 +00:00
David Horstmann
f6f3bcae43 Update file paths for moved files
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-05-31 15:49:02 +01:00
David Horstmann
a7b0bb4de8 Move some test generation files to framework
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-05-31 15:49:02 +01:00
Tom Cosgrove
30a9b6f2fc
Merge pull request #9198 from tom-cosgrove-arm/psa-sim-hashing
Test psa_hash_xxx() APIs in the PSA crypto simulator
2024-05-31 11:13:55 +00:00
Gilles Peskine
d961929615
Merge pull request #9155 from ttytm/fix-typo
fix typo
2024-05-30 17:24:55 +00:00
Gilles Peskine
c15544e217
Merge pull request #9088 from ronald-cron-arm/check-framework-files
Extend basic checks and C coding style check to framework files
2024-05-30 17:24:18 +00:00
Thomas Daubney
f29bf87696 Modify everest component for MBEDTLS_PSA_CRYPTO_CONFIG_ENABLED
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-05-30 16:28:57 +01:00
Tom Cosgrove
0ca70d51d7 Add missing licences
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-30 11:12:22 +01:00
Tom Cosgrove
8bfb758e87 PSA crypto sim's server wrappers need to free deseraliased buffers when they're no longer needed
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 22:48:45 +01:00
Tom Cosgrove
ca0c147354 Mark temporary PSA crypto sim Perl scripts as executable
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 16:52:38 +01:00
Tom Cosgrove
e2f0e3012a Extend PSA crypto simulator tests to run psa_hash.c under the simulator
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 15:19:27 +01:00
Tom Cosgrove
61ee59f041 Add the rest of the psa_hash_xxx() functions to the simulator
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 15:19:27 +01:00
Tom Cosgrove
39f8b09f5b Add PSA crypto sim serialisation functions needed for the remaining PSA hash APIs
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 15:19:27 +01:00
Tom Cosgrove
3ebb880f90 Hook the new psa_sim_crypto_{client,server} into the build and tests
- smoke test client.c becomes a trivial call to psa_crypto_init()
- server.c now uses psa_sim_crypto_server.c's psa_crypto_call()
- Makefile is updated to build all the modules, and allow a different MAIN
- all.sh's test_psasim now tests the simulation of psa_hash_compute() too

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 15:19:10 +01:00
Tom Cosgrove
cb12604d55
Merge pull request #9191 from tom-cosgrove-arm/psa-sim-fixes
Some fixes to the PSA simulator
2024-05-29 12:31:05 +00:00
Tom Cosgrove
a4952f9450 The PSA sim logs aren't very many lines, so show them during tests
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 12:39:40 +01:00
Tom Cosgrove
54b4ccdbf8 Add PSA crypto sim client and server implementations of psa_hash_compute()
A Perl script that creates them is also included as reference. This is not the
final script (that will be in Python) but a proof-of-concept to show that
creaation client and server wrappers can be scripted.

It is not hooked into the build: it must be run manually. It is not part of the
deliverables for this PR.

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 10:27:01 +01:00