Core: PSA APIs alignment
Update PSA Client and Secure Partition APIs and some related files:
- Add psa_panic() to indicate an internal fault in a secure partition.
- Introduce a message type parameter to the psa_call() function which
is delivered as part of the psa_msg_t data to the RoT Service.
- Change 'minor version' to 'version'.
- Add PSA_HANDLE_IS_VALID() and PSA_HANDLE_TO_ERROR() macros.
- Move the definition of PSA_MAX_IOVEC and PSA_IPC_CALL from
psa/service.h to psa/client.h.
- Change the error code returned by psa_get() when the message could
not be delivered. It now returns PSA_ERROR_DOES_NOT_EXIST.
Change-Id: Ia717f591c80484699f4f491d1ed6dbc4fd7c050f
Signed-off-by: Summer Qin <summer.qin@arm.com>
diff --git a/secure_fw/services/crypto/crypto_cipher.c b/secure_fw/services/crypto/crypto_cipher.c
index 590b457..466cbfe 100644
--- a/secure_fw/services/crypto/crypto_cipher.c
+++ b/secure_fw/services/crypto/crypto_cipher.c
@@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
-/* FixMe: Use PSA_CONNECTION_REFUSED when performing parameter
+/* FixMe: Use PSA_ERROR_CONNECTION_REFUSED when performing parameter
* integrity checks but this will have to be revised
* when the full set of error codes mandated by PSA FF
* is available.
@@ -33,12 +33,12 @@
psa_cipher_operation_t *operation = NULL;
if ((in_len != 1) || (out_len != 2)) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
(out_vec[0].len != sizeof(uint32_t))) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
@@ -79,12 +79,12 @@
psa_cipher_operation_t *operation = NULL;
if ((in_len != 2) || (out_len != 1)) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
(out_vec[0].len != sizeof(uint32_t))) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
uint32_t handle = iov->op_handle;
@@ -122,12 +122,12 @@
psa_cipher_operation_t *operation = NULL;
if ((in_len != 1) || (out_len != 1)) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
if ((out_vec[0].len != sizeof(uint32_t)) ||
(in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec))) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
uint32_t handle = iov->op_handle;
@@ -169,12 +169,12 @@
psa_cipher_operation_t *operation = NULL;
if ((in_len != 1) || (out_len != 1)) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
if ((out_vec[0].len != sizeof(uint32_t)) ||
(in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec))) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
uint32_t handle = iov->op_handle;
@@ -216,12 +216,12 @@
psa_cipher_operation_t *operation = NULL;
if ((in_len != 2) || (out_len != 2)) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
(out_vec[0].len != sizeof(uint32_t))) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
uint32_t handle = iov->op_handle;
@@ -265,12 +265,12 @@
psa_cipher_operation_t *operation = NULL;
if ((in_len != 1) || (out_len != 2)) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
(out_vec[0].len != sizeof(uint32_t))) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
uint32_t handle = iov->op_handle;
@@ -313,12 +313,12 @@
psa_cipher_operation_t *operation = NULL;
if ((in_len != 1) || (out_len != 1)) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
(out_vec[0].len != sizeof(uint32_t))) {
- return PSA_CONNECTION_REFUSED;
+ return PSA_ERROR_CONNECTION_REFUSED;
}
const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
uint32_t handle = iov->op_handle;