SST: Add asset authentication token in the APIs
This patch adds asset authentication token in the APIs to be used in
the future for asset key derivation. It also updates all files which
depend on these APIs and their documentation
Change-Id: I53e193b3dd3151798588c5515cd5198270836acf
Signed-off-by: Marc Moreno <marc.morenoberengue@arm.com>
diff --git a/interface/include/tfm_sst_veneers.h b/interface/include/tfm_sst_veneers.h
index 033f1cb..95a6b17 100644
--- a/interface/include/tfm_sst_veneers.h
+++ b/interface/include/tfm_sst_veneers.h
@@ -19,7 +19,8 @@
* without setting any data in the asset.
*
* \param[in] app_id Application ID
- * \param[in] asset_uuid Asset UUID
+ * \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
*
* \return Returns TFM_SST_ERR_SUCCESS if the asset has been created correctly.
* If SST area is not prepared, it returns
@@ -27,47 +28,55 @@
* TFM_SST_ERR_STORAGE_SYSTEM_FULL. If application id doesn't have the
* write rights, it returns TFM_SST_ERR_PERMS_NOT_ALLOWED.
*/
-enum tfm_sst_err_t tfm_sst_veneer_create(uint32_t app_id, uint32_t asset_uuid);
+enum tfm_sst_err_t tfm_sst_veneer_create(uint32_t app_id, uint32_t asset_uuid,
+ const struct tfm_sst_token_t *s_token);
+
/**
* \brief Gets asset's information referenced by asset UUID.
*
* \param[in] app_id Application ID
* \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
* \ref tfm_sst_asset_info_t
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
enum tfm_sst_err_t tfm_sst_veneer_get_info(uint32_t app_id, uint32_t asset_uuid,
- struct tfm_sst_asset_info_t *info);
+ const struct tfm_sst_token_t *s_token,
+ struct tfm_sst_asset_info_t *info);
/**
* \brief Gets asset's attributes referenced by asset UUID.
*
* \param[in] app_id Application ID
* \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
* \ref tfm_sst_asset_attrs_t
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
enum tfm_sst_err_t tfm_sst_veneer_get_attributes(uint32_t app_id,
- uint32_t asset_uuid,
- struct tfm_sst_asset_attrs_t *attrs);
+ uint32_t asset_uuid,
+ const struct tfm_sst_token_t *s_token,
+ struct tfm_sst_asset_attrs_t *attrs);
/**
* \brief Sets asset's attributes referenced by asset UUID.
*
* \param[in] app_id Application ID
* \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
* \ref tfm_sst_asset_attrs_t
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
enum tfm_sst_err_t tfm_sst_veneer_set_attributes(uint32_t app_id,
- uint32_t asset_uuid,
+ uint32_t asset_uuid,
+ const struct tfm_sst_token_t *s_token,
const struct tfm_sst_asset_attrs_t *attrs);
/**
@@ -75,40 +84,46 @@
*
* \param[in] app_id Application ID
* \param[in] asset_uuid Asset UUID
+ * \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
* \param[in/out] data Pointer to data vector \ref tfm_sst_buf_t to
* store data, size and offset
*
* \return Returns the number of bytes written or a castable \ref tfm_sst_err_t
* value
*/
-enum tfm_sst_err_t tfm_sst_veneer_read(uint32_t app_id,
- uint32_t asset_uuid,
+enum tfm_sst_err_t tfm_sst_veneer_read(uint32_t app_id, uint32_t asset_uuid,
+ const struct tfm_sst_token_t *s_token,
struct tfm_sst_buf_t *data);
+
/**
* \brief Writes data into an asset referenced by asset UUID.
*
* \param[in] app_id Application ID
* \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
* contains the data to write
*
* \return Returns the number of bytes written or a castable \ref tfm_sst_err_t
* value
*/
-enum tfm_sst_err_t tfm_sst_veneer_write(uint32_t app_id,
- uint32_t asset_uuid,
+enum tfm_sst_err_t tfm_sst_veneer_write(uint32_t app_id, 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] app_id Application ID
* \param[in] asset_uuid Asset UUID
+ * \param[in] s_token Pointer to the asset's token \ref tfm_sst_token_t
*
* \return Returns TFM_SST_ERR_PERMS_NOT_ALLOWED if the asset can't be deleted
* to by this app ID. Returns TFM_SST_ERR_ASSET_REF_INVALID, if asset
* no longer exists. Otherwise, TFM_SST_ERR_SUCCESS.
*/
-enum tfm_sst_err_t tfm_sst_veneer_delete(uint32_t app_id, uint32_t asset_uuid);
+enum tfm_sst_err_t tfm_sst_veneer_delete(uint32_t app_id, uint32_t asset_uuid,
+ const struct tfm_sst_token_t *s_token);
#ifdef __cplusplus
}