AuditLog: Align the implementation to the PSA header
This change modifies the AuditLog service implementation
to reflect the changes introduced by the PSA compliant API
interface. The symbol name patterns for functions, variables,
folders and source files are also changed to be audit_* /
tfm_audit*.
Change-Id: I674060979961f568912870f49a72ed571499f059
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
diff --git a/interface/include/audit_wrappers.h b/interface/include/audit_wrappers.h
new file mode 100644
index 0000000..ec98144
--- /dev/null
+++ b/interface/include/audit_wrappers.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __AUDIT_WRAPPERS_H__
+#define __AUDIT_WRAPPERS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*!
+ * \struct audit_core_retrieve_input
+ *
+ * \brief Input structure for the audit_core_retrieve_record_wrapper function
+ *
+ */
+struct audit_core_retrieve_input {
+ const uint32_t record_index; /*!< Index of the record to retrieve */
+ const uint32_t buffer_size; /*!< Size in bytes of the provided buffer */
+ const uint8_t *token; /*!< Must be set to NULL. Token used as a
+ * challenge for encryption, to protect
+ * against rollback attacks
+ */
+ const uint32_t token_size; /*!< Must be set to 0. Size in bytes of the
+ * token used as challenge
+ */
+};
+
+/*!
+ * \struct audit_core_retrieve_output
+ *
+ * \brief Output structure for the audit_core_retrieve_record_wrapper function
+ *
+ */
+struct audit_core_retrieve_output {
+ uint8_t *buffer; /*!< Buffer used to store the retrieved record */
+ uint32_t *record_size; /*!< Size in bytes of the retrieved record */
+};
+
+/*!
+ * \brief This function is a TF-M compatible wrapper for the
+ * \ref audit_core_retrieve_record implemented in the Audit log
+ * core functions
+ *
+ * \param[in] input_s Pointer to the structure containing input parameters
+ * associated with \ref psa_audit_retrieve_record
+ * \param[out] output_s Pointer to the structure containing output parameters
+ * associated with \ref psa_audit_retrieve_record
+ *
+ */
+enum psa_audit_err audit_core_retrieve_record_wrapper(
+ const struct audit_core_retrieve_input *input_s,
+ struct audit_core_retrieve_output *output_s);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __AUDIT_WRAPPERS_H__ */