tpm2-tss
4.2.0
TPM Software stack 2.0 TCG spec compliant implementation
ifapi_eventlog_system.h
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
/*******************************************************************************
3
* Copyright 2018-2019, Fraunhofer SIT sponsored by Infineon Technologies AG
4
* All rights reserved.
5
*******************************************************************************/
6
#ifndef IFAPI_EVENTLOG_SYSTEM_H
7
#define IFAPI_EVENTLOG_SYSTEM_H
8
9
#include <json.h>
// for json_object
10
#include <stdbool.h>
// for bool
11
#include <stddef.h>
// for size_t
12
13
#include "efi_event.h"
// for TCG_EVENT_HEADER2, TCG_DIGEST2, TCG_EVENT
14
#include "fapi_types.h"
// for UINT8_ARY
15
#include "tss2_common.h"
// for UINT32, BYTE, TSS2_RC
16
17
typedef
UINT32 TCG_EVENT_TYPE;
18
19
typedef
struct
{
20
TCG_EVENT_TYPE in;
21
char
*name;
22
}
TCG_EVENT_TYPE_ASSIGN
;
23
24
typedef
bool (*DIGEST2_CALLBACK)(TCG_DIGEST2
const
*digest,
size_t
size,
void
*data);
25
typedef
bool (*EVENT2_CALLBACK)(TCG_EVENT_HEADER2
const
*event_hdr,
size_t
size,
void
*data);
26
typedef
bool (*EVENT2DATA_CALLBACK)(TCG_EVENT2
const
*event, UINT32 type,
void
*data);
27
typedef
bool (*SPECID_CALLBACK)(TCG_EVENT
const
*event,
void
*data);
28
typedef
bool (*LOG_EVENT_CALLBACK)(TCG_EVENT
const
*event_hdr,
size_t
size,
void
*data);
29
30
typedef
struct
{
31
void
*data;
32
SPECID_CALLBACK specid_cb;
33
LOG_EVENT_CALLBACK log_eventhdr_cb;
34
EVENT2_CALLBACK event2hdr_cb;
35
DIGEST2_CALLBACK digest2_cb;
36
EVENT2DATA_CALLBACK event2_cb;
37
}
tpm2_eventlog_context
;
38
41
typedef
struct
{
42
UINT32 event_type;
43
UINT8_ARY
data;
44
}
IFAPI_FIRMWARE_EVENT
;
45
46
bool
digest2_accumulator_callback(TCG_DIGEST2
const
*digest,
size_t
size,
void
*data);
47
48
bool
parse_event2body(TCG_EVENT2
const
*event, UINT32 type);
49
bool
foreach_digest2(
tpm2_eventlog_context
*ctx,
50
UINT32 event_type,
51
TCG_DIGEST2
const
*event_hdr,
52
size_t
count,
53
size_t
size);
54
bool
parse_event2(TCG_EVENT_HEADER2
const
*eventhdr,
55
size_t
buf_size,
56
size_t
*event_size,
57
size_t
*digests_size);
58
bool
59
foreach_event2(
tpm2_eventlog_context
*ctx, TCG_EVENT_HEADER2
const
*eventhdr_start,
size_t
size);
60
bool
specid_event(TCG_EVENT
const
*event,
size_t
size, TCG_EVENT_HEADER2 **next);
61
bool
parse_eventlog(
tpm2_eventlog_context
*ctx, BYTE
const
*eventlog,
size_t
size);
62
63
TSS2_RC
64
ifapi_json_IFAPI_FIRMWARE_EVENT_deserialize(json_object *jso,
65
IFAPI_FIRMWARE_EVENT
*out,
66
bool
*verify);
67
68
#endif
/* IFAPI_EVENTLOG_SYSTEM_H */
IFAPI_FIRMWARE_EVENT
Definition
ifapi_eventlog_system.h:41
TCG_EVENT_TYPE_ASSIGN
Definition
ifapi_eventlog_system.h:19
UINT8_ARY
Definition
fapi_types.h:15
tpm2_eventlog_context
Definition
ifapi_eventlog_system.h:30
src
tss2-fapi
ifapi_eventlog_system.h
Generated by
1.15.0