tpm2-tss 4.1.3
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-c/json.h>
10#include "efi_event.h"
11#include "util/aux_util.h"
12
13typedef UINT32 TCG_EVENT_TYPE;
14
15typedef struct {
16 TCG_EVENT_TYPE in;
17 char *name;
19
20typedef bool (*DIGEST2_CALLBACK)(TCG_DIGEST2 const *digest, size_t size,
21 void *data);
22typedef bool (*EVENT2_CALLBACK)(TCG_EVENT_HEADER2 const *event_hdr, size_t size,
23 void *data);
24typedef bool (*EVENT2DATA_CALLBACK)(TCG_EVENT2 const *event, UINT32 type,
25 void *data);
26typedef bool (*SPECID_CALLBACK)(TCG_EVENT const *event, void *data);
27typedef bool (*LOG_EVENT_CALLBACK)(TCG_EVENT const *event_hdr, size_t size,
28 void *data);
29
30typedef 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;
38
41typedef struct {
42 UINT32 event_type;
43 UINT8_ARY data;
45
46
47bool digest2_accumulator_callback(TCG_DIGEST2 const *digest, size_t size,
48 void *data);
49
50bool parse_event2body(TCG_EVENT2 const *event, UINT32 type);
51bool foreach_digest2(tpm2_eventlog_context *ctx, UINT32 event_type,
52 TCG_DIGEST2 const *event_hdr, size_t count, size_t size);
53bool parse_event2(TCG_EVENT_HEADER2 const *eventhdr, size_t buf_size,
54 size_t *event_size, size_t *digests_size);
55bool foreach_event2(tpm2_eventlog_context *ctx, TCG_EVENT_HEADER2 const *eventhdr_start, size_t size);
56bool specid_event(TCG_EVENT const *event, size_t size, TCG_EVENT_HEADER2 **next);
57bool parse_eventlog(tpm2_eventlog_context *ctx, BYTE const *eventlog, size_t size);
58
59TSS2_RC
60ifapi_json_IFAPI_FIRMWARE_EVENT_deserialize(
61 json_object *jso,
63 bool *verify);
64
65#endif /* IFAPI_EVENTLOG_SYSTEM_H */
Definition ifapi_eventlog_system.h:41
Definition ifapi_eventlog_system.h:15
Definition fapi_types.h:15
Definition ifapi_eventlog_system.h:30