TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
psa_audit_api.h File Reference
#include "psa_audit_defs.h"
#include "psa/error.h"
Include dependency graph for psa_audit_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PSA_AUDIT_API_VERSION_MAJOR   (0)
 PSA AUDIT API version. More...
 
#define PSA_AUDIT_API_VERSION_MINOR   (1)
 

Functions

psa_status_t psa_audit_retrieve_record (const uint32_t record_index, const uint32_t buffer_size, const uint8_t *token, const uint32_t token_size, uint8_t *buffer, uint32_t *record_size)
 Retrieves a record at the specified index. More...
 
psa_status_t psa_audit_get_info (uint32_t *num_records, uint32_t *size)
 Returns the total number and size of the records stored. More...
 
psa_status_t psa_audit_get_record_info (const uint32_t record_index, uint32_t *size)
 Returns the size of the record at the specified index. More...
 
psa_status_t psa_audit_delete_record (const uint32_t record_index, const uint8_t *token, const uint32_t token_size)
 Deletes a record at the specified index. More...
 
psa_status_t psa_audit_add_record (const struct psa_audit_record *record)
 Adds a record. More...
 

Macro Definition Documentation

#define PSA_AUDIT_API_VERSION_MAJOR   (0)

PSA AUDIT API version.

Definition at line 14 of file psa_audit_api.h.

#define PSA_AUDIT_API_VERSION_MINOR   (1)

Definition at line 15 of file psa_audit_api.h.

Function Documentation

psa_status_t psa_audit_add_record ( const struct psa_audit_record record)

Adds a record.

This function adds a record. This is a Secure only callable function

Note
This is a Secure only callable API, Non-Secure calls will always return error
Parameters
[in]recordPointer to the memory buffer containing the record to be added
Returns
Returns values as specified by the psa_status_t

Definition at line 96 of file tfm_audit_func_api.c.

Here is the call graph for this function:

psa_status_t psa_audit_delete_record ( const uint32_t  record_index,
const uint8_t *  token,
const uint32_t  token_size 
)

Deletes a record at the specified index.

The function removes a record at the specified index. It passes an authorisation token for removal which is a MAC of the plain text

Note
Currently the cryptography support is not yet enabled, so the token value is not used and must be passed as NULL, with 0 size
This is an experimental API function
Parameters
[in]record_indexIndex of the record to be removed. Currently, only the removal of the oldest entry, i.e. record_index 0 is supported
[in]tokenMust be set to NULL. Token used as authorisation for removal of the specified record_index
[in]token_sizeMust be set to 0. Size in bytes of the token used as authorisation for removal
Returns
Returns values as specified by the psa_status_t

Definition at line 81 of file tfm_audit_func_api.c.

Here is the call graph for this function:

psa_status_t psa_audit_get_info ( uint32_t *  num_records,
uint32_t *  size 
)

Returns the total number and size of the records stored.

The function returns the total size in bytes and the total number of records stored

Parameters
[out]num_recordsTotal number of records stored
[out]sizeTotal size of the records stored, in bytes
Returns
Returns values as specified by the psa_status_t

Definition at line 52 of file tfm_audit_func_api.c.

Here is the call graph for this function:

psa_status_t psa_audit_get_record_info ( const uint32_t  record_index,
uint32_t *  size 
)

Returns the size of the record at the specified index.

The function returns the size of the record at the given index provided as input

Parameters
[in]record_indexIndex of the record to return the size
[out]sizeSize of the specified record, in bytes
Returns
Returns values as specified by the psa_status_t

Definition at line 65 of file tfm_audit_func_api.c.

Here is the call graph for this function:

psa_status_t psa_audit_retrieve_record ( const uint32_t  record_index,
const uint32_t  buffer_size,
const uint8_t *  token,
const uint32_t  token_size,
uint8_t *  buffer,
uint32_t *  record_size 
)

Retrieves a record at the specified index.

The function retrieves an item specified by index and returns it on the buffer provided. The token is passed as a challenge value for the encryption scheme

Note
Currently the cryptography support is not yet enabled, so the token value is not used and must be passed as NULL, with 0 size
Parameters
[in]record_indexIndex of the record to retrieve
[in]buffer_sizeSize in bytes of the provided buffer
[in]tokenMust be set to NULL. Token used as a challenge for encryption, to protect against rollback attacks
[in]token_sizeMust be set to 0. Size in bytes of the token used as challenge
[out]bufferBuffer used to store the retrieved record
[out]record_sizeSize in bytes of the retrieved record
Returns
Returns values as specified by the psa_status_t

Definition at line 29 of file tfm_audit_func_api.c.

Here is the call graph for this function: