#include <stdint.h>
#include "psa/protected_storage.h"
Go to the source code of this file.
|
psa_status_t | tfm_ps_init (void) |
| Initializes the protected storage system. More...
|
|
psa_status_t | tfm_ps_set (int32_t client_id, psa_storage_uid_t uid, uint32_t data_length, psa_storage_create_flags_t create_flags) |
| Creates a new or modifies an existing asset. More...
|
|
psa_status_t | tfm_ps_get (int32_t client_id, psa_storage_uid_t uid, uint32_t data_offset, uint32_t data_size, size_t *p_data_length) |
| Gets the asset data for the provided uid. More...
|
|
psa_status_t | tfm_ps_get_info (int32_t client_id, psa_storage_uid_t uid, struct psa_storage_info_t *p_info) |
| Gets the metadata for the provided uid. More...
|
|
psa_status_t | tfm_ps_remove (int32_t client_id, psa_storage_uid_t uid) |
| Removes the provided uid and its associated data from storage. More...
|
|
uint32_t | tfm_ps_get_support (void) |
| Gets a bitmask with flags set for all of the optional features supported by the implementation. More...
|
|
Gets the asset data for the provided uid.
- Parameters
-
[in] | client_id | Identifier of the asset's owner (client) |
[in] | uid | Unique identifier for the data |
[in] | data_offset | The offset within the data associated with the uid to start retrieving data |
[in] | data_size | The amount of data to read (and the minimum allocated size of the p_data buffer) |
[out] | p_data_length | The pointer to the size of the data retrieved upon success. |
- Returns
- A status indicating the success/failure of the operation as specified in psa_status_t
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_INVALID_ARGUMENT | The operation failed because one or more of the given arguments were invalid (null pointer, etc.) |
PSA_ERROR_DOES_NOT_EXIST | The operation failed because the provided uid value was not found in the storage |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (fatal error) |
PSA_ERROR_GENERIC_ERROR | The operation failed because of an unspecified internal failure |
PSA_ERROR_DATA_CORRUPT | The operation failed because the data associated with the UID was corrupt |
PSA_ERROR_INVALID_SIGNATURE | The operation failed because the data associated with the UID failed authentication |
Definition at line 67 of file tfm_protected_storage.c.
Gets the metadata for the provided uid.
- Parameters
-
[in] | client_id | Identifier of the asset's owner (client) |
[in] | uid | Unique identifier for the data |
[out] | p_info | A pointer to the psa_storage_info_t struct that will be populated with the metadata |
- Returns
- A status indicating the success/failure of the operation as specified in psa_status_t
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_INVALID_ARGUMENT | The operation failed because one or more of the given arguments were invalid (null pointer, etc.) |
PSA_ERROR_DOES_NOT_EXIST | The operation failed because the provided uid value was not found in the storage |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (fatal error) |
PSA_ERROR_GENERIC_ERROR | The operation failed because of an unspecified internal failure |
PSA_ERROR_DATA_CORRUPT | The operation failed because the data associated with the UID was corrupt |
PSA_ERROR_INVALID_SIGNATURE | The operation failed because the data associated with the UID failed authentication |
Definition at line 83 of file tfm_protected_storage.c.
uint32_t tfm_ps_get_support |
( |
void |
| ) |
|
Gets a bitmask with flags set for all of the optional features supported by the implementation.
- Returns
- Bitmask value which contains all the bits set for all the optional features supported by the implementation
Definition at line 118 of file tfm_protected_storage.c.
Initializes the protected storage system.
- Returns
- A status indicating the success/failure of the operation as specified in psa_status_t
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the storage system initialization has failed (fatal error) |
PSA_ERROR_GENERIC_ERROR | The operation failed because of an unspecified internal failure |
Definition at line 12 of file tfm_protected_storage.c.
Removes the provided uid and its associated data from storage.
- Parameters
-
[in] | client_id | Identifier of the asset's owner (client) |
[in] | uid | Unique identifier for the data to be removed |
- Returns
- A status indicating the success/failure of the operation as specified in psa_status_t
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_INVALID_ARGUMENT | The operation failed because one or more of the given arguments were invalid (null pointer, etc.) |
PSA_ERROR_DOES_NOT_EXIST | The operation failed because the provided uid value was not found in the storage |
PSA_ERROR_NOT_PERMITTED | The operation failed because the provided uid value was created with PSA_STORAGE_FLAG_WRITE_ONCE |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (fatal error) |
PSA_ERROR_GENERIC_ERROR | The operation failed because of an unspecified internal failure |
Definition at line 95 of file tfm_protected_storage.c.
Creates a new or modifies an existing asset.
- Parameters
-
[in] | client_id | Identifier of the asset's owner (client) |
[in] | uid | Unique identifier for the data |
[in] | data_length | The size in bytes of the data in p_data |
[in] | create_flags | The flags indicating the properties of the data |
- Returns
- A status indicating the success/failure of the operation as specified in psa_status_t
- Return values
-
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_NOT_PERMITTED | The operation failed because the provided uid value was already created with PSA_STORAGE_FLAG_WRITE_ONCE |
PSA_ERROR_INVALID_ARGUMENT | The operation failed because one or more of the given arguments were invalid (null pointer, etc.) |
PSA_ERROR_NOT_SUPPORTED | The operation failed because one or more of the flags provided in create_flags is not supported or is not valid |
PSA_ERROR_INSUFFICIENT_STORAGE | The operation failed because there was insufficient space on the storage medium |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (fatal error) |
PSA_ERROR_GENERIC_ERROR | The operation failed because of an unspecified internal failure. |
Definition at line 46 of file tfm_protected_storage.c.