21 Commits

Author SHA1 Message Date
Tom Cosgrove
2fc5687b21 Add PSA crypto sim serialisation functions for basic types
Not hooked into the build yet

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 10:03:06 +01:00
Tom Cosgrove
92024566fb Fix code style in psa_ff_server.c
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-29 09:58:56 +01:00
Tom Cosgrove
38f6c86724 Remove unnecessary blank lines at top of functions in psa_ff_server.c
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-28 14:31:48 +03:00
Tom Cosgrove
9919543f5c Only print PSA crypto sim server messages when DEBUG defined
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-28 14:31:48 +03:00
Tom Cosgrove
f69445ccaf Fix sending a response of more than 184 bytes in psa_ff_server.c:psa_write()
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-28 14:31:48 +03:00
Tom Cosgrove
bdc4c2d750 Fix PSA sim test awk script by removing extra $
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-28 14:31:48 +03:00
Tom Cosgrove
0a57a253cc Fix psa_ff_server.c to calculate the amount of data from client correctly
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-28 14:31:48 +03:00
Tom Cosgrove
b7e5f31e2a Replace final sprintf() with snprintf() in psa_ff_server.c
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-05-28 14:31:48 +03:00
Valerio Setti
1f3c99c774 psa_autogen.py: improve management of output files
While at this, fix also Makefile so that "make clean" does not
complain if some of the files to be cancelled do not exist.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-16 16:13:38 +02:00
Valerio Setti
87d99fbd6c psasim: create a seedfile to be used for the crypto server
This allows to re-enable MBEDTLS_ENTROPY_NV_SEED since the
seedfile is correctly found in the "test" folder at runtime.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-14 10:57:35 +02:00
Valerio Setti
dce6b85af8 psa_ff_client: fix typos and useless blank lines
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-14 10:43:14 +02:00
Valerio Setti
c98f8ab5f7 crypto-client: allow debug build of libraries and test binaries
Add DEBUG=1 in test_psasim() to helpers and final make to build
the libraries and the final binaries with debug symbols
enabled.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-10 15:53:40 +02:00
Valerio Setti
237a64ef07 crypto-client: remove log files on "make clean"
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-10 12:32:10 +02:00
Valerio Setti
400168cd1a crypto-client: fix the SID
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-10 12:31:41 +02:00
Valerio Setti
cd89c1ffc8 crypto-client: simplify build of mbedtls static libraries
Instead of copying the entire library & include folders twice
to build libraries for client and server:

- change the main config file (mbedtls_config.h)
- build in the root library folder
- move the generated library in the psasim folder
- use those library for linking the client/server binaries

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-10 11:23:30 +02:00
Valerio Setti
66fb1c17ff crypto-client: reorganize source files/folders
The goal is to keep psasim as simple as possible:

- do not build a separate lib for psa-ff; build those source
  files as part of server or client
- do not have lot of different makefiles: just 1 that does all
  we need
- do not have several subfolders for headers: only 1 is enough
  for this kind of project

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-10 07:59:22 +02:00
Valerio Setti
655b9793c0 crypto-client test: implement the first IPC call for psa_crypto_init()
This commit implements the first useful IPC communication between
the client and the server. The implemented command is simple,
psa_crypto_init(), and its return value is sent back to the client.

Note: the newly added file psa_functions_codes.h is temporary
and it's probably the one that needs to be automatically
generated by a python script to support all crypto functions.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-10 05:22:23 +02:00
Valerio Setti
4362aaef7f crypto-client test: ensure that client/server are linked against proper MbedTLS libraries
Ensure that both server and client can call mbedtls_version_get_string_full()
to verify that they are linked against proper libraries.

Note: each side (client/server) performs the call against its own
MbedTLS library. There is no IPC communication involved in this
test. Client/server communication will come later.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-09 09:23:46 +02:00
Valerio Setti
d1b6ef1959 crypto-client test: add mechanism to build crypto library for client and server
It includes changes to:
- tests/Makefile: build the library for client and server in different
  folders. It mimica the libtestdriver1 behavior (without functions
  renaming though).
- tests/scripts/all.sh: helper function to build for client and
  server with some default configuration for each of them.
- crypto_spe.h: this is dummy file taken from the already existing
  tests. It's just meant to pacify the compiler, not to provide
  something useful. It will likely be changed in the future.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-09 07:31:54 +02:00
Valerio Setti
4f4ade9c34 psa-client-server: move psasim from framework repo to the mbedtls one
This is a temporary fix that will be reverted once the framework
repository will have CI checks.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-03 17:28:04 +02:00
Minos Galanakis
c16048887e Added work directory for the psa client/server testing epic
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-05-03 15:55:12 +01:00