SST: Use get caller client ID API in SST
This change modifies SST service to use
tfm_core_get_caller_client_id(...), provided by the TF-M core, instead
of use the client ID provided by the dummy ID manager via the SST APIs.
The details of this change are:
- Remove client_id from the veneer API of SST (except for the read
operation, as referenced read is still possible)
- Remove the dummy ID manager
- Add documentation on how to integrate this new method to a NS
application
- Change Asset management to work with non-hardcoded secure
client ID
Change-Id: Ic97ea7aa5840d7e212adc009fa39c1c505440965
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 2be76fd..00f7b00 100755
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -46,7 +46,6 @@
"${INTERFACE_DIR}/src/tfm_sst_api.c"
"${INTERFACE_DIR}/src/tfm_audit_api.c"
"${INTERFACE_DIR}/src/tfm_nspm_svc_handler.c"
- "${INTERFACE_DIR}/src/tfm_id_mngr_dummy.c"
"${INTERFACE_DIR}/src/tfm_nspm_api.c"
"${INTERFACE_DIR}/src/tfm_ns_lock_rtx.c"
)
diff --git a/docs/user_guides/services/tfm_sst_integration_guide.md b/docs/user_guides/services/tfm_sst_integration_guide.md
index ee26c05..d808778 100644
--- a/docs/user_guides/services/tfm_sst_integration_guide.md
+++ b/docs/user_guides/services/tfm_sst_integration_guide.md
@@ -366,19 +366,17 @@
}};
```
-### Non-Secure Identity Manager
+### Client Identification
-The SST service requires, from the non-secure side, a mechanism to retrieve
-a numerical ID associated to the running application/thread which performs
-the call to the SST service. That identifier is the one used to validate the
-access permissions against the requested asset.
-For API specification, please check:
-`interface/include/tfm_id_mngr.h`
+TF-M core tracks the current client IDs running in the secure or non-secure
+processing environment. It provides a dedicated API to retrieve the client ID
+which performs the service request.
-A stub implementation is provided in `interface/src/tfm_id_mngr_dummy.c`
+[ns client identification documentation](../tfm_ns_client_identification.md)
+provides further details on how client identification works.
-The system integrators **must** implement the non-secure ID manager based on
-their application/threat model.
+SST service uses that TF-M core API to retrieve the client ID and validate the
+access permission against the requested asset.
The [integration guide](../tfm_integration_guide.md) provides further
details of non-secure implementation requirements for TF-M.
diff --git a/docs/user_guides/tfm_integration_guide.md b/docs/user_guides/tfm_integration_guide.md
index 93182eb..895bb34 100755
--- a/docs/user_guides/tfm_integration_guide.md
+++ b/docs/user_guides/tfm_integration_guide.md
@@ -67,15 +67,11 @@
a collection of functions in the `<build_dir>/install/export/tfm/inc`
directory. For example, the interface for the Secure STorage (SST) service
is described in the file `psa_sst_api.h` as a collection of
-functions that call service veneer functions. The services can be called from the
-non-secure world applications (running in Thread mode) using the wrapper API
-which is described in `psa_sst_api.h`. This API is a wrapper for the secure
-veneers, and returns the return value from the service to the caller.
-The secure storage service also needs the NS side to provide an implementation
-for the function `tfm_sst_get_cur_id()` which is used to retrieve the numerical
-ID associated to the running thread. A primitive implementation is
-provided in `tfm_sst_id_mngr_dummy.c`. It is system integrators responsibility
-to implement the SST ID manager based on their threat model.
+functions that call service veneer functions. This API is a wrapper for the
+secure veneers, and returns the return value from the service to the caller.
+The secure storage service uses a numerical ID, to identify the clients that use
+the service. For details see
+[ns client identification documentation](tfm_ns_client_identification.md).
#### interface with non-secure world regression tests
A non-secure application that wants to run the non-secure regression tests
@@ -93,6 +89,9 @@
needs to provide the implementation of these wrappers to be able to run the
tests.
+#### NS client Identification
+See [ns client identification documentation](tfm_ns_client_identification.md).
+
--------------
*Copyright (c) 2017-2018, Arm Limited. All rights reserved.*
diff --git a/docs/user_guides/tfm_ns_client_identification.md b/docs/user_guides/tfm_ns_client_identification.md
new file mode 100644
index 0000000..21eba4d
--- /dev/null
+++ b/docs/user_guides/tfm_ns_client_identification.md
@@ -0,0 +1,42 @@
+# Non-Secure Identity Manager
+
+The ID of the current application/thread is known by TF-M, and the SST service
+queries the ID of the currently running client via a dedicated API.
+
+The identity of secure clients can be tracked by TF-M core, because it also
+manages the contexts of the partitions. However to differentiate NS clients, it
+relies on the services provided by the NS OS.
+
+Tracking of context changes are possible by relying on the NS OS calling the
+Thread Context Management for Armv8-M TrustZone APIs, as described
+[here](https://www.keil.com/pack/doc/CMSIS/Core/html/group__context__trustzone__functions.html)
+
+However TF-M needs an extra API, to assign a client ID to the TZ context created
+as a result of the
+`TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module)` call.
+
+To do this, the
+`enum tfm_status_e tfm_register_client_id (int32_t ns_client_id)` have to be
+called from an SVC handler, with the client ID of the currently running client.
+
+In the current implementation of TF-M, an SVC call is provided for the NS
+clients to be called at the beginning of their main function.
+
+```SVC(SVC_TFM_NSPM_REGISTER_CLIENT_ID);```
+
+The SVC call handler of the above SVC maps the name of the current thread to a
+hardcoded client id, and sends it to the TF-M core via the earlier discussed
+API.
+
+The mapping is implemented in `interface/src/tfm_nspm_svc_handler.c`.
+
+The system integrators **may** implement the non-secure ID mapping based on
+their application/threat model.
+
+In case the NS OS doesn't use the Thread Context Management for Armv8-M TrustZone
+APIs, then TF-M considers the NS SW as a single client, and assigns a client ID
+to it automatically.
+
+--------------
+
+*Copyright (c) 2018, Arm Limited. All rights reserved.*
diff --git a/interface/include/tfm_api.h b/interface/include/tfm_api.h
index c450c7c..efe24e9 100644
--- a/interface/include/tfm_api.h
+++ b/interface/include/tfm_api.h
@@ -14,6 +14,26 @@
#include <stdint.h>
+#define TFM_INVALID_CLIENT_ID 0
+
+/**
+ * \brief Checks if the provided client ID is a secure client ID.
+ *
+ * \param[in] client_id Client ID to check
+ *
+ * \return Returns 1 if the client Id is secure. Otherwise, returns 0.
+ */
+#define TFM_CLIENT_ID_IS_S(client_id) ((client_id)>0)
+
+/**
+ * \brief Checks if the provided client ID is a non-secure client ID.
+ *
+ * \param[in] client_id Client ID to check
+ *
+ * \return Returns 1 if the client Id is non-secure. Otherwise, returns 0.
+ */
+#define TFM_CLIENT_ID_IS_NS(client_id) ((client_id)<0)
+
/* FixMe: sort out DEBUG compile option and limit return value options
* on external interfaces */
/* Note:
diff --git a/interface/include/tfm_id_mngr.h b/interface/include/tfm_id_mngr.h
deleted file mode 100644
index cb25225..0000000
--- a/interface/include/tfm_id_mngr.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_ID_MNGR_H__
-#define __TFM_ID_MNGR_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-
-/**
- * \brief Gets SST current client ID
- *
- * \return Returns the SST current client ID
- */
-int32_t tfm_sst_get_cur_id(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TFM_ID_MNGR_H__ */
diff --git a/interface/include/tfm_sst_veneers.h b/interface/include/tfm_sst_veneers.h
index df62f75..6cfd5c1 100644
--- a/interface/include/tfm_sst_veneers.h
+++ b/interface/include/tfm_sst_veneers.h
@@ -18,7 +18,6 @@
* \brief Allocates space for the asset, referenced by asset UUID,
* without setting any data in the asset.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[in] asset_uuid Asset UUID \ref tfm_sst_asset_id_t
*
@@ -28,14 +27,12 @@
* PSA_SST_ERR_STORAGE_SYSTEM_FULL. If application id doesn't have the
* write rights, it returns PSA_SST_ERR_PERMS_NOT_ALLOWED.
*/
-enum psa_sst_err_t tfm_sst_veneer_create(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_create(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token);
/**
* \brief Gets asset's information referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[out] info Pointer to store the asset's information
@@ -43,15 +40,13 @@
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t tfm_sst_veneer_get_info(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_get_info(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct psa_sst_asset_info_t *info);
/**
* \brief Gets asset's attributes referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[out] attrs Pointer to store the asset's attributes
@@ -59,15 +54,13 @@
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t tfm_sst_veneer_get_attributes(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_get_attributes(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct psa_sst_asset_attrs_t *attrs);
/**
* \brief Sets asset's attributes referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[in] attrs Pointer to new the asset's attributes
@@ -75,8 +68,7 @@
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t tfm_sst_veneer_set_attributes(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_set_attributes(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
const struct psa_sst_asset_attrs_t *attrs);
@@ -105,7 +97,6 @@
/**
* \brief Writes data into an asset referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[in] data Pointer to data vector \ref tfm_sst_buf_t which
@@ -114,15 +105,13 @@
* \return Returns the number of bytes written or a castable \ref psa_sst_err_t
* value
*/
-enum psa_sst_err_t tfm_sst_veneer_write(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_write(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct tfm_sst_buf_t *data);
/**
* \brief Deletes the asset referenced by the asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
*
@@ -130,8 +119,7 @@
* to by this app ID. Returns PSA_SST_ERR_ASSET_REF_INVALID, if asset
* no longer exists. Otherwise, PSA_SST_ERR_SUCCESS.
*/
-enum psa_sst_err_t tfm_sst_veneer_delete(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_delete(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token);
#ifdef __cplusplus
}
diff --git a/interface/src/tfm_id_mngr_dummy.c b/interface/src/tfm_id_mngr_dummy.c
deleted file mode 100644
index 69fb4b7..0000000
--- a/interface/src/tfm_id_mngr_dummy.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-/* FIXME: this TFM ID manager is only a stub implementation. It is system
- * integrators responsibility to define a way of identifying the app id and
- * based on their non secure side of the threat model. The secure side only
- * checks if this is an ID belonging to NS side entities. The secure side
- * doesn't make any attempt to challenge the app id value, this is left for NS
- * side privileged code to implement.
- */
-
-#include "tfm_id_mngr.h"
-
-#include <string.h>
-#include "cmsis_os2.h"
-
-#define INVALID_CLIENT_ID 0
-
-/* FIXME: following two functions are meant to be internally
- * available to RTX. The header file containing prototype of
- * these functions has complex header inclusion which leads
- * to compiler specific paths in CMSIS, which currently doesn't have
- * clang variant. To simplify this, following functions are directly
- * declared here (as opposed to header inclusion). After clear
- * separation of S and NS builds this will require to be revisited
- */
-extern osThreadId_t svcRtxThreadGetId(void);
-extern const char *svcRtxThreadGetName(osThreadId_t thread_id);
-
-/* Translation table pair between OS threads and SST client IDs */
-struct thread_sst_clientid_pair {
- const char* t_name; /*!< Task/Thread name */
- int32_t client_id; /*!< Client ID used in assets definition */
-};
-
-static struct thread_sst_clientid_pair sst_ns_policy_table[] =
-{
- {"Thread_A", -9},
- {"Thread_B", -10},
- {"Thread_C", -11},
- {"Thread_D", -12},
-};
-
-static const char* get_active_task_name(void)
-{
- const char* thread_name;
-
- thread_name = svcRtxThreadGetName(svcRtxThreadGetId());
-
- return thread_name;
-}
-
-int32_t tfm_sst_get_cur_id(void)
-{
- uint32_t i;
- static uint32_t sst_table_size = (sizeof(sst_ns_policy_table) /
- sizeof(sst_ns_policy_table[0]));
- const char* p_thread_name;
-
- p_thread_name = get_active_task_name();
-
- for (i = 0; i < sst_table_size; i++) {
- if (strcmp(sst_ns_policy_table[i].t_name, p_thread_name) == 0) {
- return sst_ns_policy_table[i].client_id;
- }
- }
-
- return INVALID_CLIENT_ID;
-}
diff --git a/interface/src/tfm_sst_api.c b/interface/src/tfm_sst_api.c
index 8a3fec8..317032c 100644
--- a/interface/src/tfm_sst_api.c
+++ b/interface/src/tfm_sst_api.c
@@ -8,25 +8,25 @@
#include "tfm_sst_veneers.h"
#include "tfm_sst_defs.h"
#include "tfm_ns_lock.h"
-#include "tfm_id_mngr.h"
+
+/* This define uses the TF-M invalid client ID to specify a direct client read,
+ * as that it can not be used to identify a client.
+ */
+#define SST_DIRECT_CLIENT_READ TFM_INVALID_CLIENT_ID
enum psa_sst_err_t psa_sst_create(uint32_t asset_uuid, const uint8_t *token,
uint32_t token_size)
{
struct tfm_sst_token_t s_token;
- int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- client_id = tfm_sst_get_cur_id();
-
return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_create,
- client_id,
asset_uuid,
(uint32_t)&s_token,
- 0);
+ 0, 0);
}
enum psa_sst_err_t psa_sst_get_info(uint32_t asset_uuid,
@@ -35,19 +35,16 @@
struct psa_sst_asset_info_t *info)
{
struct tfm_sst_token_t s_token;
- int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- client_id = tfm_sst_get_cur_id();
-
return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_get_info,
- client_id,
asset_uuid,
(uint32_t)&s_token,
- (uint32_t)info);
+ (uint32_t)info,
+ 0);
}
enum psa_sst_err_t psa_sst_get_attributes(uint32_t asset_uuid,
@@ -56,19 +53,16 @@
struct psa_sst_asset_attrs_t *attrs)
{
struct tfm_sst_token_t s_token;
- int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- client_id = tfm_sst_get_cur_id();
-
return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_get_attributes,
- client_id,
asset_uuid,
(uint32_t)&s_token,
- (uint32_t)attrs);
+ (uint32_t)attrs,
+ 0);
}
enum psa_sst_err_t psa_sst_set_attributes(uint32_t asset_uuid,
@@ -77,19 +71,16 @@
const struct psa_sst_asset_attrs_t *attrs)
{
struct tfm_sst_token_t s_token;
- int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- client_id = tfm_sst_get_cur_id();
-
return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_set_attributes,
- client_id,
asset_uuid,
(uint32_t)&s_token,
- (uint32_t)attrs);
+ (uint32_t)attrs,
+ 0);
}
enum psa_sst_err_t psa_sst_read(uint32_t asset_uuid,
@@ -101,7 +92,6 @@
{
struct tfm_sst_token_t s_token;
struct tfm_sst_buf_t s_data;
- int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
@@ -112,10 +102,8 @@
s_data.offset = offset;
s_data.data = data;
- client_id = tfm_sst_get_cur_id();
-
return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_read,
- client_id,
+ SST_DIRECT_CLIENT_READ,
asset_uuid,
(uint32_t)&s_token,
(uint32_t)&s_data);
@@ -130,7 +118,6 @@
{
struct tfm_sst_token_t s_token;
struct tfm_sst_buf_t s_data;
- int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
@@ -141,13 +128,11 @@
s_data.offset = offset;
s_data.data = (uint8_t *)data;
- client_id = tfm_sst_get_cur_id();
-
return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_write,
- client_id,
asset_uuid,
(uint32_t)&s_token,
- (uint32_t)&s_data);
+ (uint32_t)&s_data,
+ 0);
}
enum psa_sst_err_t psa_sst_delete(uint32_t asset_uuid,
@@ -155,17 +140,13 @@
uint32_t token_size)
{
struct tfm_sst_token_t s_token;
- int32_t client_id;
/* Pack the token information in the token structure */
s_token.token = token;
s_token.token_size = token_size;
- client_id = tfm_sst_get_cur_id();
-
return tfm_ns_lock_dispatch((veneer_fn)tfm_sst_veneer_delete,
- client_id,
asset_uuid,
(uint32_t)&s_token,
- 0);
+ 0, 0);
}
diff --git a/secure_fw/ns_callable/tfm_sst_veneers.c b/secure_fw/ns_callable/tfm_sst_veneers.c
index 87793a3..9c63e14 100644
--- a/secure_fw/ns_callable/tfm_sst_veneers.c
+++ b/secure_fw/ns_callable/tfm_sst_veneers.c
@@ -12,42 +12,38 @@
#include "secure_fw/spm/spm_partition_defs.h"
__tfm_secure_gateway_attributes__
-enum psa_sst_err_t tfm_sst_veneer_create(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_create(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token)
{
TFM_CORE_SFN_REQUEST(TFM_SP_STORAGE_ID, sst_am_create,
- client_id, asset_uuid, s_token, 0);
+ asset_uuid, s_token, 0, 0);
}
__tfm_secure_gateway_attributes__
-enum psa_sst_err_t tfm_sst_veneer_get_info(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_get_info(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct psa_sst_asset_info_t *info)
{
TFM_CORE_SFN_REQUEST(TFM_SP_STORAGE_ID, sst_am_get_info,
- client_id, asset_uuid, s_token, info);
+ asset_uuid, s_token, info, 0);
}
__tfm_secure_gateway_attributes__
-enum psa_sst_err_t tfm_sst_veneer_get_attributes(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_get_attributes(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct psa_sst_asset_attrs_t *attrs)
{
TFM_CORE_SFN_REQUEST(TFM_SP_STORAGE_ID, sst_am_get_attributes,
- client_id, asset_uuid, s_token, attrs);
+ asset_uuid, s_token, attrs, 0);
}
__tfm_secure_gateway_attributes__
-enum psa_sst_err_t tfm_sst_veneer_set_attributes(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_set_attributes(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
const struct psa_sst_asset_attrs_t *attrs)
{
TFM_CORE_SFN_REQUEST(TFM_SP_STORAGE_ID, sst_am_set_attributes,
- client_id, asset_uuid, s_token, attrs);
+ asset_uuid, s_token, attrs, 0);
}
__tfm_secure_gateway_attributes__
@@ -61,20 +57,18 @@
}
__tfm_secure_gateway_attributes__
-enum psa_sst_err_t tfm_sst_veneer_write(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_write(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct tfm_sst_buf_t *data)
{
- TFM_CORE_SFN_REQUEST(TFM_SP_STORAGE_ID, sst_am_write, client_id,
- asset_uuid, s_token, data);
+ TFM_CORE_SFN_REQUEST(TFM_SP_STORAGE_ID, sst_am_write,
+ asset_uuid, s_token, data, 0);
}
__tfm_secure_gateway_attributes__
-enum psa_sst_err_t tfm_sst_veneer_delete(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t tfm_sst_veneer_delete(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token)
{
- TFM_CORE_SFN_REQUEST(TFM_SP_STORAGE_ID, sst_am_delete, client_id,
- asset_uuid, s_token, 0);
+ TFM_CORE_SFN_REQUEST(TFM_SP_STORAGE_ID, sst_am_delete,
+ asset_uuid, s_token, 0, 0);
}
diff --git a/secure_fw/services/secure_storage/sst_asset_management.c b/secure_fw/services/secure_storage/sst_asset_management.c
index fd156b1..e811817 100644
--- a/secure_fw/services/secure_storage/sst_asset_management.c
+++ b/secure_fw/services/secure_storage/sst_asset_management.c
@@ -102,7 +102,7 @@
err = sst_utils_validate_secure_caller();
if (err == PSA_SST_ERR_SUCCESS) {
- if (client_id != S_CLIENT_ID) {
+ if (TFM_CLIENT_ID_IS_S(client_id) == 0) {
if (request_type & SST_PERM_REFERENCE) {
access = SST_PERM_REFERENCE;
} else {
@@ -116,7 +116,7 @@
*/
access = SST_PERM_BYPASS;
}
- } else if (client_id == S_CLIENT_ID) {
+ } else if (TFM_CLIENT_ID_IS_S(client_id) == 1) {
/* non secure caller spoofing as secure caller */
access = SST_PERM_FORBIDDEN;
} else {
@@ -282,7 +282,7 @@
return bound_check;
}
-enum psa_sst_err_t sst_am_get_info(int32_t client_id, uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_get_info(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct psa_sst_asset_info_t *info)
{
@@ -291,6 +291,11 @@
struct psa_sst_asset_info_t tmp_info;
enum psa_sst_err_t err;
uint8_t all_perms = SST_PERM_REFERENCE | SST_PERM_READ | SST_PERM_WRITE;
+ int32_t client_id;
+
+ if (tfm_core_get_caller_client_id(&client_id) != TFM_SUCCESS) {
+ return PSA_SST_ERR_SYSTEM_ERROR;
+ }
bound_check = sst_utils_memory_bound_check(info, PSA_SST_ASSET_INFO_SIZE,
client_id,
@@ -317,8 +322,7 @@
return err;
}
-enum psa_sst_err_t sst_am_get_attributes(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_get_attributes(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct psa_sst_asset_attrs_t *attrs)
{
@@ -327,6 +331,11 @@
struct sst_asset_policy_t *db_entry;
enum psa_sst_err_t err;
struct psa_sst_asset_attrs_t tmp_attrs;
+ int32_t client_id;
+
+ if (tfm_core_get_caller_client_id(&client_id) != TFM_SUCCESS) {
+ return PSA_SST_ERR_SYSTEM_ERROR;
+ }
bound_check = sst_utils_memory_bound_check(attrs, PSA_SST_ASSET_ATTR_SIZE,
client_id,
@@ -353,8 +362,7 @@
return err;
}
-enum psa_sst_err_t sst_am_set_attributes(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_set_attributes(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
const struct psa_sst_asset_attrs_t *attrs)
{
@@ -362,6 +370,11 @@
enum psa_sst_err_t bound_check;
struct sst_asset_policy_t *db_entry;
enum psa_sst_err_t err;
+ int32_t client_id;
+
+ if (tfm_core_get_caller_client_id(&client_id) != TFM_SUCCESS) {
+ return PSA_SST_ERR_SYSTEM_ERROR;
+ }
bound_check = sst_utils_memory_bound_check((uint8_t *)attrs,
PSA_SST_ASSET_ATTR_SIZE,
@@ -392,11 +405,16 @@
return err;
}
-enum psa_sst_err_t sst_am_create(int32_t client_id, uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_create(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token)
{
enum psa_sst_err_t err;
struct sst_asset_policy_t *db_entry;
+ int32_t client_id;
+
+ if (tfm_core_get_caller_client_id(&client_id) != TFM_SUCCESS) {
+ return PSA_SST_ERR_SYSTEM_ERROR;
+ }
db_entry = sst_am_get_db_entry(client_id, asset_uuid, SST_PERM_WRITE);
if (db_entry == NULL) {
@@ -413,18 +431,15 @@
const struct tfm_sst_token_t *s_token,
struct tfm_sst_buf_t *data)
{
- uint32_t caller_id;
+ int32_t caller_id;
struct sst_asset_policy_t *db_entry;
enum psa_sst_err_t err;
struct tfm_sst_buf_t local_data;
- /* FIXME: For the moment, the secure callers can not be identified and
- * all the secure requests have the same client ID
- * (S_CLIENT_ID).
- */
- if (sst_utils_validate_secure_caller() == PSA_SST_ERR_SUCCESS) {
- caller_id = S_CLIENT_ID;
- if (client_id != S_CLIENT_ID) {
+ /* Check if it is a read by reference request */
+ if (client_id != SST_DIRECT_CLIENT_READ) {
+ /* Only secure partitions can request it */
+ if (sst_utils_validate_secure_caller() == PSA_SST_ERR_SUCCESS) {
/* Reference read access requested, check if the client has
* reference permission, otherwise reject the request.
*/
@@ -433,16 +448,16 @@
if (db_entry == NULL) {
return PSA_SST_ERR_ASSET_NOT_FOUND;
}
+ } else {
+ /* A non-secure caller is not allowed to specify any client ID to
+ * request a read by reference.
+ */
+ return PSA_SST_ERR_ASSET_NOT_FOUND;
}
- } else {
- /* In a request from NSPE client, client_id is the caller ID and
- * can not be a secure client ID.
- */
- if (SST_IS_CID_NSPE_CID(client_id) == 0) {
- return PSA_SST_ERR_ASSET_NOT_FOUND;
- }
+ }
- caller_id = client_id;
+ if (tfm_core_get_caller_client_id(&caller_id) != TFM_SUCCESS) {
+ return PSA_SST_ERR_SYSTEM_ERROR;
}
/* Check client ID permissions */
@@ -470,13 +485,18 @@
return err;
}
-enum psa_sst_err_t sst_am_write(int32_t client_id, uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_write(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
const struct tfm_sst_buf_t *data)
{
struct tfm_sst_buf_t local_data;
enum psa_sst_err_t err;
struct sst_asset_policy_t *db_entry;
+ int32_t client_id;
+
+ if (tfm_core_get_caller_client_id(&client_id) != TFM_SUCCESS) {
+ return PSA_SST_ERR_SYSTEM_ERROR;
+ }
/* Check client ID permissions */
db_entry = sst_am_get_db_entry(client_id, asset_uuid, SST_PERM_WRITE);
@@ -511,11 +531,16 @@
return err;
}
-enum psa_sst_err_t sst_am_delete(int32_t client_id, uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_delete(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token)
{
enum psa_sst_err_t err;
struct sst_asset_policy_t *db_entry;
+ int32_t client_id;
+
+ if (tfm_core_get_caller_client_id(&client_id) != TFM_SUCCESS) {
+ return PSA_SST_ERR_SYSTEM_ERROR;
+ }
db_entry = sst_am_get_db_entry(client_id, asset_uuid, SST_PERM_WRITE);
if (db_entry == NULL) {
diff --git a/secure_fw/services/secure_storage/sst_asset_management.h b/secure_fw/services/secure_storage/sst_asset_management.h
index e51b562..6967c2f 100644
--- a/secure_fw/services/secure_storage/sst_asset_management.h
+++ b/secure_fw/services/secure_storage/sst_asset_management.h
@@ -15,29 +15,10 @@
extern "C" {
#endif
-/* FIXME: the secure client ID should not be share with the non-secure code
- * as it is revealing information about secure code implementation.
+/* This define uses the TF-M invalid client ID to specify a direct client read,
+ * as that it can not be used to identify a client.
*/
-#define S_CLIENT_ID 0x00000001
-
-/* Invalid client ID (CID) */
-#define SST_INVALID_CLIENT_ID 0x00000000
-
-/* Non-Secure Processing Environment (NSPE) client ID mask */
-#define SST_NSPE_CLIENT_ID_MASK 0x80000000
-
-/**
- * \def SST_IS_CID_NSPE_CID
- *
- * \brief Checks if the client ID is from a non-secure client ID.
- *
- * \param[in] cid Client ID to check
- *
- * \return Returns 1 if the pid is a non-secure client ID. Otherwise,
- * it returns 0.
- */
-#define SST_IS_CID_NSPE_CID(cid) ((cid & SST_NSPE_CLIENT_ID_MASK) != 0)
-
+#define SST_DIRECT_CLIENT_READ TFM_INVALID_CLIENT_ID
#define SST_PERM_BYPASS (1<<3) /*!< Permission check bypassed. Used when
* secure a secure entity calls as itself
@@ -74,20 +55,17 @@
* \brief Allocates space for the asset, referenced by asset UUID,
* without setting any data in the asset.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[in] asset_uuid Asset UUID
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_am_create(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_create(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token);
/**
* \brief Gets the asset's info referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[out] info Pointer to store the asset's information
@@ -95,15 +73,13 @@
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_am_get_info(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_get_info(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct psa_sst_asset_info_t *info);
/**
* \brief Gets the asset's attributes referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[out] attrs Pointer to store the asset's attributes
@@ -111,15 +87,13 @@
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_am_get_attributes(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_get_attributes(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
struct psa_sst_asset_attrs_t *attrs);
/**
* \brief Sets the asset's attributes referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[in] attrs Pointer to new the asset's attributes
@@ -127,18 +101,17 @@
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_am_set_attributes(int32_t client_id,
- uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_set_attributes(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
const struct psa_sst_asset_attrs_t *attrs);
/**
* \brief Reads asset's data referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service.
- * In case, the caller is a secure partition, this
- * parameter can be a non-secure client ID if the
- * read is in behalf of that non-secure client ID.
+ * \param[in] client_id In case, the caller is a secure partition, this
+ * parameter can be a non-secure or secure client ID if
+ * the read is in behalf of that client.
+ * Otherwise, it must be 0.
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[out] data Pointer to data vector \ref tfm_sst_buf_t to store
@@ -153,7 +126,6 @@
/**
* \brief Writes data into an asset referenced by asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[in] data Pointer to data vector \ref tfm_sst_buf_t which
@@ -161,20 +133,19 @@
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_am_write(int32_t client_id, uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_write(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token,
const struct tfm_sst_buf_t *data);
/**
* \brief Deletes the asset referenced by the asset UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] asset_uuid Asset UUID
* \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_am_delete(int32_t client_id, uint32_t asset_uuid,
+enum psa_sst_err_t sst_am_delete(uint32_t asset_uuid,
const struct tfm_sst_token_t *s_token);
#ifdef __cplusplus
diff --git a/secure_fw/services/secure_storage/tfm_sst_secure_api.c b/secure_fw/services/secure_storage/tfm_sst_secure_api.c
index 7526e24..78bb4b3 100644
--- a/secure_fw/services/secure_storage/tfm_sst_secure_api.c
+++ b/secure_fw/services/secure_storage/tfm_sst_secure_api.c
@@ -7,6 +7,7 @@
#include "psa_sst_api.h"
#include "tfm_sst_veneers.h"
+#include "tfm_secure_api.h"
#include "secure_fw/services/secure_storage/sst_asset_management.h"
__attribute__(( section("SFN")))
@@ -19,11 +20,7 @@
s_token.token = token;
s_token.token_size = token_size;
- /* FIXME: Currently, TF-M framework does not provide any mechanism to
- * identify the secure partition. So, the same partition ID
- * (S_CLIENT_ID) is used for all the calls.
- */
- return tfm_sst_veneer_create(S_CLIENT_ID, asset_uuid, &s_token);
+ return tfm_sst_veneer_create(asset_uuid, &s_token);
}
@@ -39,12 +36,7 @@
s_token.token = token;
s_token.token_size = token_size;
- /* FIXME: Currently, TF-M framework does not provide any mechanism to
- * identify the secure partition. So, the same partition ID
- * (S_CLIENT_ID) is used for all the calls.
- */
- return tfm_sst_veneer_get_info(S_CLIENT_ID, asset_uuid,
- &s_token, info);
+ return tfm_sst_veneer_get_info(asset_uuid, &s_token, info);
}
__attribute__(( section("SFN")))
@@ -59,12 +51,7 @@
s_token.token = token;
s_token.token_size = token_size;
- /* FIXME: Currently, TF-M framework does not provide any mechanism to
- * identify the secure partition. So, the same partition ID
- * (S_CLIENT_ID) is used for all the calls.
- */
- return tfm_sst_veneer_get_attributes(S_CLIENT_ID, asset_uuid,
- &s_token, attrs);
+ return tfm_sst_veneer_get_attributes(asset_uuid, &s_token, attrs);
}
__attribute__(( section("SFN")))
@@ -79,12 +66,7 @@
s_token.token = token;
s_token.token_size = token_size;
- /* FIXME: Currently, TF-M framework does not provide any mechanism to
- * identify the secure partition. So, the same partition ID
- * (S_CLIENT_ID) is used for all the calls.
- */
- return tfm_sst_veneer_set_attributes(S_CLIENT_ID, asset_uuid,
- &s_token, attrs);
+ return tfm_sst_veneer_set_attributes(asset_uuid, &s_token, attrs);
}
__attribute__(( section("SFN")))
@@ -107,7 +89,10 @@
s_data.offset = offset;
s_data.data = data;
- return tfm_sst_veneer_read(S_CLIENT_ID, asset_uuid, &s_token, &s_data);
+ return tfm_sst_veneer_read(SST_DIRECT_CLIENT_READ,
+ asset_uuid,
+ &s_token,
+ &s_data);
}
__attribute__(( section("SFN")))
@@ -154,11 +139,7 @@
s_data.offset = offset;
s_data.data = (uint8_t *)data;
- /* FIXME: Currently, TF-M framework does not provide any mechanism to
- * identify the secure partition. So, the same partition ID
- * (S_CLIENT_ID) is used for all the calls.
- */
- return tfm_sst_veneer_write(S_CLIENT_ID, asset_uuid, &s_token, &s_data);
+ return tfm_sst_veneer_write(asset_uuid, &s_token, &s_data);
}
__attribute__(( section("SFN")))
@@ -172,9 +153,5 @@
s_token.token = token;
s_token.token_size = token_size;
- /* FIXME: Currently, TF-M framework does not provide any mechanism to
- * identify the secure partition. So, the same partition ID
- * (S_CLIENT_ID) is used for all the calls.
- */
- return tfm_sst_veneer_delete(S_CLIENT_ID, asset_uuid, &s_token);
+ return tfm_sst_veneer_delete(asset_uuid, &s_token);
}
diff --git a/test/test_services/tfm_sst_test_service/sst_test_service.c b/test/test_services/tfm_sst_test_service/sst_test_service.c
index 175366a..5588921 100644
--- a/test/test_services/tfm_sst_test_service/sst_test_service.c
+++ b/test/test_services/tfm_sst_test_service/sst_test_service.c
@@ -52,14 +52,18 @@
return err;
}
-enum psa_sst_err_t sst_test_service_sfn_dummy_encrypt(int32_t client_id,
- uint32_t key_uuid,
+enum psa_sst_err_t sst_test_service_sfn_dummy_encrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size)
{
enum psa_sst_err_t err;
uint32_t i;
uint8_t key_data[SST_TEST_SERVICE_KEY_SIZE];
+ int32_t client_id;
+
+ if (tfm_core_get_caller_client_id(&client_id) != TFM_SUCCESS) {
+ return PSA_SST_ERR_SYSTEM_ERROR;
+ }
/* Read the key from the asset using the non-secure caller's client ID */
err = psa_sst_reference_read(client_id, key_uuid, ASSET_TOKEN,
@@ -84,15 +88,14 @@
return PSA_SST_ERR_SUCCESS;
}
-enum psa_sst_err_t sst_test_service_sfn_dummy_decrypt(int32_t client_id,
- uint32_t key_uuid,
+enum psa_sst_err_t sst_test_service_sfn_dummy_decrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size)
{
- /* In the current implementation encrypt and decrypt are the same operation
+ /* In the current implementation encrypt and decrypt are the same
+ * operation.
*/
- return sst_test_service_sfn_dummy_encrypt(client_id, key_uuid,
- buf, buf_size);
+ return sst_test_service_sfn_dummy_encrypt(key_uuid, buf, buf_size);
}
enum psa_sst_err_t sst_test_service_sfn_clean(void)
diff --git a/test/test_services/tfm_sst_test_service/sst_test_service.h b/test/test_services/tfm_sst_test_service/sst_test_service.h
index ccd1c93..d283576 100644
--- a/test/test_services/tfm_sst_test_service/sst_test_service.h
+++ b/test/test_services/tfm_sst_test_service/sst_test_service.h
@@ -27,15 +27,13 @@
* \brief Performs a dummy encryption on the supplied buffer, using the key
* stored in the asset with the given UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] key_uuid UUID of asset containing key
* \param[in,out] buf Plaintext buffer
* \param[in] buf_size Size of buf
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_test_service_sfn_dummy_encrypt(int32_t client_id,
- uint32_t key_uuid,
+enum psa_sst_err_t sst_test_service_sfn_dummy_encrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size);
@@ -43,15 +41,13 @@
* \brief Performs a dummy decryption on the supplied buffer, using the key
* stored in the asset with the given UUID.
*
- * \param[in] client_id Client ID which calls the service
* \param[in] key_uuid UUID of asset containing key
* \param[in,out] buf Ciphertext buffer
* \param[in] buf_size Size of buf
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_test_service_sfn_dummy_decrypt(int32_t client_id,
- uint32_t key_uuid,
+enum psa_sst_err_t sst_test_service_sfn_dummy_decrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size);
diff --git a/test/test_services/tfm_sst_test_service/sst_test_service_api.c b/test/test_services/tfm_sst_test_service/sst_test_service_api.c
index 1bcc12b..40e6370 100644
--- a/test/test_services/tfm_sst_test_service/sst_test_service_api.c
+++ b/test/test_services/tfm_sst_test_service/sst_test_service_api.c
@@ -7,7 +7,6 @@
#include "sst_test_service_api.h"
#include "sst_test_service_veneers.h"
-#include "tfm_id_mngr.h"
enum psa_sst_err_t sst_test_service_setup(void)
{
@@ -18,24 +17,14 @@
uint8_t *buf,
uint32_t buf_size)
{
- int32_t client_id;
-
- client_id = tfm_sst_get_cur_id();
-
- return sst_test_service_veneer_dummy_encrypt(client_id, key_uuid, buf,
- buf_size);
+ return sst_test_service_veneer_dummy_encrypt(key_uuid, buf, buf_size);
}
enum psa_sst_err_t sst_test_service_dummy_decrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size)
{
- int32_t client_id;
-
- client_id = tfm_sst_get_cur_id();
-
- return sst_test_service_veneer_dummy_decrypt(client_id, key_uuid, buf,
- buf_size);
+ return sst_test_service_veneer_dummy_decrypt(key_uuid, buf, buf_size);
}
enum psa_sst_err_t sst_test_service_clean(void)
diff --git a/test/test_services/tfm_sst_test_service/sst_test_service_veneers.c b/test/test_services/tfm_sst_test_service/sst_test_service_veneers.c
index 0a53513..fcbb709 100644
--- a/test/test_services/tfm_sst_test_service/sst_test_service_veneers.c
+++ b/test/test_services/tfm_sst_test_service/sst_test_service_veneers.c
@@ -20,25 +20,23 @@
}
__tfm_secure_gateway_attributes__
-enum psa_sst_err_t sst_test_service_veneer_dummy_encrypt(uint32_t app_id,
- uint32_t key_uuid,
+enum psa_sst_err_t sst_test_service_veneer_dummy_encrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size)
{
TFM_CORE_SFN_REQUEST(TFM_SP_SST_TEST_PARTITION_ID,
sst_test_service_sfn_dummy_encrypt,
- app_id, key_uuid, buf, buf_size);
+ key_uuid, buf, buf_size, 0);
}
__tfm_secure_gateway_attributes__
-enum psa_sst_err_t sst_test_service_veneer_dummy_decrypt(uint32_t app_id,
- uint32_t key_uuid,
+enum psa_sst_err_t sst_test_service_veneer_dummy_decrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size)
{
TFM_CORE_SFN_REQUEST(TFM_SP_SST_TEST_PARTITION_ID,
sst_test_service_sfn_dummy_decrypt,
- app_id, key_uuid, buf, buf_size);
+ key_uuid, buf, buf_size, 0);
}
__tfm_secure_gateway_attributes__
diff --git a/test/test_services/tfm_sst_test_service/sst_test_service_veneers.h b/test/test_services/tfm_sst_test_service/sst_test_service_veneers.h
index 296f600..de5cd59 100644
--- a/test/test_services/tfm_sst_test_service/sst_test_service_veneers.h
+++ b/test/test_services/tfm_sst_test_service/sst_test_service_veneers.h
@@ -27,30 +27,26 @@
* \brief Performs a dummy encryption on the supplied buffer, using the key
* stored in the asset with the given UUID.
*
- * \param[in] app_id Application ID
* \param[in] key_uuid UUID of asset containing key
* \param[in,out] buf Plaintext buffer
* \param[in] buf_size Size of buf
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_test_service_veneer_dummy_encrypt(uint32_t app_id,
- uint32_t key_uuid,
+enum psa_sst_err_t sst_test_service_veneer_dummy_encrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size);
/**
* \brief Performs a dummy decryption on the supplied buffer, using the key
* stored in the asset with the given UUID.
*
- * \param[in] app_id Application ID
* \param[in] key_uuid UUID of asset containing key
* \param[in,out] buf Ciphertext buffer
* \param[in] buf_size Size of buf
*
* \return Returns error code as specified in \ref psa_sst_err_t
*/
-enum psa_sst_err_t sst_test_service_veneer_dummy_decrypt(uint32_t app_id,
- uint32_t key_uuid,
+enum psa_sst_err_t sst_test_service_veneer_dummy_decrypt(uint32_t key_uuid,
uint8_t *buf,
uint32_t buf_size);
/**