TF-M Reference Manual
1.2.0
TrustedFirmware-M
Main Page
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
audit_core.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018-2019, Arm Limited. All rights reserved.
3
* Copyright (c) 2020, Cypress Semiconductor Corporation. All rights reserved.
4
*
5
* SPDX-License-Identifier: BSD-3-Clause
6
*
7
*/
8
9
#ifndef __AUDIT_CORE_H__
10
#define __AUDIT_CORE_H__
11
12
#ifdef __cplusplus
13
extern
"C"
{
14
#endif
15
16
#include <stdint.h>
17
#include <stddef.h>
18
#include <limits.h>
19
20
#include "
psa_audit_defs.h
"
21
#include "
psa/error.h
"
22
23
#define UNIFORM_SIGNATURE_API(api_name) \
24
psa_status_t api_name(psa_invec[], size_t, psa_outvec[], size_t)
25
60
#define LOG_MIN_SIZE (4)
61
68
enum
audit_tlv_type
{
69
TLV_TYPE_ID
= 0,
70
TLV_TYPE_AUTH
= 1,
71
72
/* This is used to force the maximum size */
73
TLV_TYPE_MAX
= INT_MAX
74
};
75
81
struct
audit_tlv_entry
{
82
enum
audit_tlv_type
type
;
83
uint32_t
length
;
84
uint8_t
value
[];
85
};
86
92
#define LOG_MAC_SIZE (4)
93
99
struct
log_hdr
{
100
uint64_t
timestamp
;
101
uint32_t
iv_counter
;
102
int32_t
partition_id
;
103
uint32_t
size
;
104
uint32_t
id
;
105
};
106
112
struct
log_tlr
{
113
uint8_t
mac
[
LOG_MAC_SIZE
];
114
};
115
121
#define LOG_HDR_SIZE (sizeof(struct log_hdr))
122
128
#define LOG_TLR_SIZE (sizeof(struct log_tlr))
129
137
psa_status_t
audit_core_init
(
void
);
138
139
#define LIST_TFM_AUDIT_UNIFORM_SIGNATURE_API \
140
X(audit_core_delete_record) \
141
X(audit_core_get_info) \
142
X(audit_core_get_record_info) \
143
X(audit_core_add_record) \
144
X(audit_core_retrieve_record) \
145
146
#define X(api_name) UNIFORM_SIGNATURE_API(api_name);
147
LIST_TFM_AUDIT_UNIFORM_SIGNATURE_API
148
#undef X
149
150
#ifdef __cplusplus
151
}
152
#endif
153
154
#endif
/* __AUDIT_CORE_H__ */
audit_tlv_entry::length
uint32_t length
Definition:
audit_core.h:83
log_hdr::size
uint32_t size
Definition:
audit_core.h:103
LIST_TFM_AUDIT_UNIFORM_SIGNATURE_API
#define LIST_TFM_AUDIT_UNIFORM_SIGNATURE_API
Definition:
audit_core.h:139
log_hdr::iv_counter
uint32_t iv_counter
Definition:
audit_core.h:101
TLV_TYPE_ID
Definition:
audit_core.h:69
log_hdr
Fixed size header for a log record.
Definition:
audit_core.h:99
LOG_MAC_SIZE
#define LOG_MAC_SIZE
Size in bytes of the MAC for each entry.
Definition:
audit_core.h:92
error.h
Standard error codes for the SPM and RoT Services.
psa_audit_defs.h
log_tlr::mac
uint8_t mac[(4)]
Definition:
audit_core.h:113
audit_tlv_entry
TLV entry structure with a flexible array member.
Definition:
audit_core.h:81
log_hdr::id
uint32_t id
Definition:
audit_core.h:104
audit_tlv_entry::value
uint8_t value[]
Definition:
audit_core.h:84
audit_tlv_entry::type
enum audit_tlv_type type
Definition:
audit_core.h:82
audit_core_init
psa_status_t audit_core_init(void)
Initializes the Audit logging service during the TFM boot up process.
Definition:
audit_core.c:465
log_tlr
Fixed size logging entry trailer.
Definition:
audit_core.h:112
log_hdr::partition_id
int32_t partition_id
Definition:
audit_core.h:102
TLV_TYPE_MAX
Definition:
audit_core.h:73
TLV_TYPE_AUTH
Definition:
audit_core.h:70
psa_status_t
int32_t psa_status_t
Function return status.
Definition:
crypto_types.h:43
audit_tlv_type
audit_tlv_type
Possible types for a TLV entry in payload.
Definition:
audit_core.h:68
log_hdr::timestamp
uint64_t timestamp
Definition:
audit_core.h:100
secure_fw
partitions
audit_logging
audit_core.h
Generated on Thu Feb 18 2021 13:29:09 for TF-M Reference Manual by
1.8.6