Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 1 | /* |
Hugues de Valon | adf9f08 | 2019-02-19 14:26:20 +0000 | [diff] [blame] | 2 | * Copyright (c) 2018-2019, Arm Limited. All rights reserved. |
Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __AUDIT_WRAPPERS_H__ |
| 9 | #define __AUDIT_WRAPPERS_H__ |
| 10 | |
| 11 | #ifdef __cplusplus |
| 12 | extern "C" { |
| 13 | #endif |
| 14 | |
| 15 | /*! |
| 16 | * \struct audit_core_retrieve_input |
| 17 | * |
| 18 | * \brief Input structure for the audit_core_retrieve_record_wrapper function |
| 19 | * |
| 20 | */ |
| 21 | struct audit_core_retrieve_input { |
| 22 | const uint32_t record_index; /*!< Index of the record to retrieve */ |
| 23 | const uint32_t buffer_size; /*!< Size in bytes of the provided buffer */ |
| 24 | const uint8_t *token; /*!< Must be set to NULL. Token used as a |
| 25 | * challenge for encryption, to protect |
| 26 | * against rollback attacks |
| 27 | */ |
| 28 | const uint32_t token_size; /*!< Must be set to 0. Size in bytes of the |
| 29 | * token used as challenge |
| 30 | */ |
| 31 | }; |
| 32 | |
| 33 | /*! |
| 34 | * \struct audit_core_retrieve_output |
| 35 | * |
| 36 | * \brief Output structure for the audit_core_retrieve_record_wrapper function |
| 37 | * |
| 38 | */ |
| 39 | struct audit_core_retrieve_output { |
| 40 | uint8_t *buffer; /*!< Buffer used to store the retrieved record */ |
| 41 | uint32_t *record_size; /*!< Size in bytes of the retrieved record */ |
| 42 | }; |
| 43 | |
| 44 | /*! |
| 45 | * \brief This function is a TF-M compatible wrapper for the |
| 46 | * \ref audit_core_retrieve_record implemented in the Audit log |
| 47 | * core functions |
| 48 | * |
| 49 | * \param[in] input_s Pointer to the structure containing input parameters |
| 50 | * associated with \ref psa_audit_retrieve_record |
| 51 | * \param[out] output_s Pointer to the structure containing output parameters |
| 52 | * associated with \ref psa_audit_retrieve_record |
| 53 | * |
| 54 | */ |
| 55 | enum psa_audit_err audit_core_retrieve_record_wrapper( |
Hugues de Valon | adf9f08 | 2019-02-19 14:26:20 +0000 | [diff] [blame] | 56 | const struct audit_core_retrieve_input *input_s, |
| 57 | const struct audit_core_retrieve_output *output_s); |
Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 58 | |
| 59 | #ifdef __cplusplus |
| 60 | } |
| 61 | #endif |
| 62 | |
| 63 | #endif /* __AUDIT_WRAPPERS_H__ */ |