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_api.h b/interface/include/tfm_sst_api.h
index 8447bd4..58d9333 100644
--- a/interface/include/tfm_sst_api.h
+++ b/interface/include/tfm_sst_api.h
@@ -19,40 +19,78 @@
* without setting any data in the asset.
*
* \param[in] asset_uuid Asset UUID
+ * \param[in] token Must be set to NULL, reserved for future use.
+ * Pointer to the asset token to be used to generate
+ * the asset key to encrypt and decrypt the asset
+ * data. This is an optional parameter that has to
+ * be NULL in case the token is not provied.
+ * \param[in] token_size Must be set to 0, reserved for future use.
+ * Token size. In case the token is not provided
+ * the token size has to be 0.
*
* \return Returns an TFM_SST_ERR_SUCCESS if asset is created correctly.
* Otherwise, error code as specified in \ref tfm_sst_err_t
*/
-enum tfm_sst_err_t tfm_sst_create(uint32_t asset_uuid);
+enum tfm_sst_err_t tfm_sst_create(uint32_t asset_uuid,
+ const uint8_t* token,
+ uint32_t token_size);
/**
* \brief Gets asset's information referenced by asset UUID.
*
* \param[in] asset_uuid Asset UUID
+ * \param[in] token Must be set to NULL, reserved for future use.
+ * Pointer to the asset token to be used to generate
+ * the asset key to encrypt and decrypt the asset
+ * data. This is an optional parameter that has to
+ * be NULL in case the token is not provied.
+ * \param[in] token_size Must be set to 0, reserved for future use.
+ * Token size. In case the token is not provided
+ * the token size has to be 0.
* \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_get_info(uint32_t asset_uuid,
+ const uint8_t* token,
+ uint32_t token_size,
struct tfm_sst_asset_info_t *info);
/**
* \brief Gets asset's attributes referenced by asset UUID.
*
* \param[in] asset_uuid Asset UUID
+ * \param[in] token Must be set to NULL, reserved for future use.
+ * Pointer to the asset token to be used to generate
+ * the asset key to encrypt and decrypt the asset
+ * data. This is an optional parameter that has to
+ * be NULL in case the token is not provied.
+ * \param[in] token_size Must be set to 0, reserved for future use.
+ * Token size. In case the token is not provided
+ * the token size has to be 0.
* \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_get_attributes(uint32_t asset_uuid,
+ const uint8_t* token,
+ uint32_t token_size,
struct tfm_sst_asset_attrs_t *attrs);
/**
* \brief Sets asset's attributes referenced by asset UUID.
*
* \param[in] asset_uuid Asset UUID
+ * \param[in] token Must be set to NULL, reserved for future use.
+ * Pointer to the asset token to be used to generate
+ * the asset key to encrypt and decrypt the asset
+ * data. This is an optional parameter that has to
+ * be NULL in case the token is not provied.
+ * \param[in] token_size Must be set to 0, reserved for future use.
+ * Token size. In case the token is not provided
+ * the token size has to be 0.
* \param[in] attrs Pointer to new the asset's attributes
* \ref tfm_sst_asset_attrs_t
*
@@ -60,40 +98,72 @@
*/
enum tfm_sst_err_t tfm_sst_set_attributes(
uint32_t asset_uuid,
+ const uint8_t* token,
+ uint32_t token_size,
const struct tfm_sst_asset_attrs_t *attrs);
/**
* \brief Reads asset's data from asset referenced by asset UUID.
*
* \param[in] asset_uuid Asset UUID
+ * \param[in] token Must be set to NULL, reserved for future use.
+ * Pointer to the asset token to be used to generate
+ * the asset key to encrypt and decrypt the asset
+ * data. This is an optional parameter that has to
+ * be NULL in case the token is not provied.
+ * \param[in] token_size Must be set to 0, reserved for future use.
+ * Token size. In case the token is not provided
+ * the token size has to be 0.
* \param[out] data Pointer to data vector \ref tfm_sst_buf_t to store
* data, size and offset
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
enum tfm_sst_err_t tfm_sst_read(uint32_t asset_uuid,
+ const uint8_t* token,
+ uint32_t token_size,
struct tfm_sst_buf_t* data);
/**
* \brief Writes data into an asset referenced by asset UUID.
*
* \param[in] asset_uuid Asset UUID
+ * \param[in] token Must be set to NULL, reserved for future use.
+ * Pointer to the asset token to be used to generate
+ * the asset key to encrypt and decrypt the asset
+ * data. This is an optional parameter that has to
+ * be NULL in case the token is not provied.
+ * \param[in] token_size Must be set to 0, reserved for future use.
+ * Token size. In case the token is not provided
+ * the token size has to be 0.
* \param[in] data Pointer to data vector \ref tfm_sst_buf_t which
* contains the data to write
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
enum tfm_sst_err_t tfm_sst_write(uint32_t asset_uuid,
+ const uint8_t* token,
+ uint32_t token_size,
struct tfm_sst_buf_t* data);
/**
* \brief Deletes the asset referenced by the asset UUID.
*
* \param[in] asset_uuid Asset UUID
+ * \param[in] token Must be set to NULL, reserved for future use.
+ * Pointer to the asset token to be used to generate
+ * the asset key to encrypt and decrypt the asset
+ * data. This is an optional parameter that has to
+ * be NULL in case the token is not provied.
+ * \param[in] token_size Must be set to 0, reserved for future use.
+ * Token size. In case the token is not provided
+ * the token size has to be 0.
*
* \return Returns error code as specified in \ref tfm_sst_err_t
*/
-enum tfm_sst_err_t tfm_sst_delete(uint32_t asset_uuid);
+enum tfm_sst_err_t tfm_sst_delete(uint32_t asset_uuid,
+ const uint8_t* token,
+ uint32_t token_size);
#ifdef __cplusplus
}