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>
diff --git a/tests/psa-client-server/psasim/include/psa/client.h b/tests/psa-client-server/psasim/include/psa/client.h
index d1af993..1044c84 100644
--- a/tests/psa-client-server/psasim/include/psa/client.h
+++ b/tests/psa-client-server/psasim/include/psa/client.h
@@ -15,7 +15,9 @@
#include <stdint.h>
#include <stddef.h>
-#include "psa/error.h"
+#include "psa/crypto.h"
+
+#include "psa/error_ext.h"
/*********************** PSA Client Macros and Types *************************/
#define PSA_FRAMEWORK_VERSION (0x0100)
diff --git a/tests/psa-client-server/psasim/include/psa/common.h b/tests/psa-client-server/psasim/include/psa/common.h
index d0205d2..ee5b5a3 100644
--- a/tests/psa-client-server/psasim/include/psa/common.h
+++ b/tests/psa-client-server/psasim/include/psa/common.h
@@ -27,7 +27,6 @@
#define NON_SECURE (1 << 30)
-typedef int32_t psa_status_t;
typedef int32_t psa_handle_t;
#define PSA_MAX_IOVEC (4u)
diff --git a/tests/psa-client-server/psasim/include/psa/error.h b/tests/psa-client-server/psasim/include/psa/error.h
deleted file mode 100644
index 44fc0b1..0000000
--- a/tests/psa-client-server/psasim/include/psa/error.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* PSA status codes used by psasim. */
-
-/*
- * Copyright The Mbed TLS Contributors
- * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
- */
-
-#ifndef PSA_ERROR_H
-#define PSA_ERROR_H
-
-#include <stdint.h>
-
-#include "psa/common.h"
-
-#define PSA_SUCCESS ((psa_status_t) 0)
-
-#define PSA_ERROR_PROGRAMMER_ERROR ((psa_status_t) -129)
-#define PSA_ERROR_CONNECTION_REFUSED ((psa_status_t) -130)
-#define PSA_ERROR_CONNECTION_BUSY ((psa_status_t) -131)
-#define PSA_ERROR_GENERIC_ERROR ((psa_status_t) -132)
-#define PSA_ERROR_NOT_PERMITTED ((psa_status_t) -133)
-#define PSA_ERROR_NOT_SUPPORTED ((psa_status_t) -134)
-#define PSA_ERROR_INVALID_ARGUMENT ((psa_status_t) -135)
-#define PSA_ERROR_INVALID_HANDLE ((psa_status_t) -136)
-#define PSA_ERROR_BAD_STATE ((psa_status_t) -137)
-#define PSA_ERROR_BUFFER_TOO_SMALL ((psa_status_t) -138)
-#define PSA_ERROR_ALREADY_EXISTS ((psa_status_t) -139)
-#define PSA_ERROR_DOES_NOT_EXIST ((psa_status_t) -140)
-#define PSA_ERROR_INSUFFICIENT_MEMORY ((psa_status_t) -141)
-#define PSA_ERROR_INSUFFICIENT_STORAGE ((psa_status_t) -142)
-#define PSA_ERROR_INSUFFICIENT_DATA ((psa_status_t) -143)
-#define PSA_ERROR_SERVICE_FAILURE ((psa_status_t) -144)
-#define PSA_ERROR_COMMUNICATION_FAILURE ((psa_status_t) -145)
-#define PSA_ERROR_STORAGE_FAILURE ((psa_status_t) -146)
-#define PSA_ERROR_HARDWARE_FAILURE ((psa_status_t) -147)
-#define PSA_ERROR_INVALID_SIGNATURE ((psa_status_t) -149)
-
-#endif
diff --git a/tests/psa-client-server/psasim/include/psa/error_ext.h b/tests/psa-client-server/psasim/include/psa/error_ext.h
new file mode 100644
index 0000000..efbba86
--- /dev/null
+++ b/tests/psa-client-server/psasim/include/psa/error_ext.h
@@ -0,0 +1,19 @@
+/* PSA status codes used by psasim. */
+
+/*
+ * Copyright The Mbed TLS Contributors
+ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+ */
+
+#ifndef PSA_ERROR_H
+#define PSA_ERROR_H
+
+#include <stdint.h>
+
+#include "psa/common.h"
+
+#define PSA_ERROR_PROGRAMMER_ERROR ((psa_status_t) -129)
+#define PSA_ERROR_CONNECTION_REFUSED ((psa_status_t) -130)
+#define PSA_ERROR_CONNECTION_BUSY ((psa_status_t) -131)
+
+#endif
diff --git a/tests/psa-client-server/psasim/include/psa/service.h b/tests/psa-client-server/psasim/include/psa/service.h
index c8c0024..b6c9684 100644
--- a/tests/psa-client-server/psasim/include/psa/service.h
+++ b/tests/psa-client-server/psasim/include/psa/service.h
@@ -17,6 +17,8 @@
#include "psa/common.h"
+#include "psa/crypto.h"
+
/********************** PSA Secure Partition Macros and Types ****************/
/* PSA wait timeouts */