blob: ec981444c732b840bbd468831e163e823969fe3f [file] [log] [blame]
Antonio de Angelis2eeac642018-08-21 14:23:22 +01001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
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
12extern "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 */
21struct 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 */
39struct 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 */
55enum psa_audit_err audit_core_retrieve_record_wrapper(
56 const struct audit_core_retrieve_input *input_s,
57 struct audit_core_retrieve_output *output_s);
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif /* __AUDIT_WRAPPERS_H__ */