Development documentation

This is the in-progress lota-next branch. For the released version, see the stable documentation.

Report format

One round carries three frames over the TLS connection (Verifier): the verifier's challenge, the agent's report and the verifier's result. The C side is include/attestation.h, serialized by src/agent/report.c; the Go side is src/verifier/types/report.go. The verifier reads and writes every integer little-endian, and the structs have no padding.

All three frames open with the same two words:

magic

0x41544F4C, LOTA in little-endian (LOTA_MAGIC).

version

The report version, major << 16 | minor << 8 | patch (LOTA_REPORT_VERSION in include/lota.h). It is 0x00010000, 1.0.0.

Challenge

48 bytes, sent by the verifier when the TLS handshake completes.

Offset

Size

Field

Content

0

4

magic

4

4

version

8

32

nonce

Fresh random nonce.

40

4

pcr_mask

The PCRs to quote, bit n for PCR n.

44

4

flags

Bit 0, LOTA_CHALLENGE_FLAG_BOOT_COMMITMENT_V1: the PCR 14 derivation the verifier checks. Always set.

The agent refuses a challenge with another magic and does not check the version.

Report

A fixed part of 5324 bytes, then three sections of which two vary in length:

Offset

Content

0

Header, 16 bytes.

16

TPM evidence, 4912 bytes.

4928

System measurement, 396 bytes.

5324

event_log_size, 4 bytes.

5328

The TPM event log, event_log_size bytes.

5328 + L

ESRT entry, 28 bytes.

5356 + L

mok_list_size, 4 bytes.

5360 + L

The MOK list, mok_list_size bytes.

L is event_log_size. Every section is present in every report, so the smallest report is 5360 bytes. A host with nothing to put in a section says so in it: an event log or a MOK list of size 0, an ESRT entry with present 0.

The event log holds at most 524288 bytes and the MOK list at most 32768, so the largest report is 562416 bytes. The agent sends a longer event log or MOK list as size 0.

TPM evidence

Offset

Size

Field

Content

16

768

pcr_values

24 SHA-256 PCR values, PCR 0 first.

784

4

pcr_mask

The quoted PCRs, bit n for PCR n.

788

512

quote_signature

The quote signature.

1300

2

quote_sig_size

Its length, at most 512.

1302

1024

attest_data

The TPMS_ATTEST the TPM signed.

2326

2

attest_size

Its length, at most 1024.

2328

512

aik_public

The AIK public key, DER SPKI.

2840

2

aik_public_size

Its length, at most 512.

2842

2048

aik_certificate

The AIK certificate, DER X.509.

4890

2

aik_cert_size

Its length, at most 2048.

4892

32

nonce

The challenge nonce.

4924

2

quote_sig_alg

TPM2_ALG_RSASSA or TPM2_ALG_RSAPSS.

4926

2

quote_sig_hash_alg

TPM2_ALG_SHA256, SHA384 or SHA512.

The extraData in attest_data holds a binding nonce, which ties the quote to the report fields it does not sign:

SHA-256(nonce || flags & ~TPM_QUOTE_OK || kernel_hash || agent_hash ||
        iommu.vendor || iommu.flags || iommu.unit_count ||
        iommu.cmdline_param)

TPM_QUOTE_OK is left out because the agent sets it after the quote (src/verifier/verify/attest.go).

System measurement

Offset

Size

Field

Content

4928

32

kernel_hash

The boot measurement digest, SHA-256.

4960

32

agent_hash

SHA-256 of the agent binary.

4992

256

kernel_path

The kernel image path, as text. The verifier does not read it.

5248

4

iommu.vendor

0 none, 1 Intel VT-d, 2 AMD-Vi.

5252

4

iommu.flags

IOMMU flags.

5256

4

iommu.unit_count

The number of IOMMU units.

5260

64

iommu.cmdline_param

The IOMMU boot parameter, as text.

IOMMU flags

Bit

Flag

Meaning

0

SYSFS_PRESENT

/sys/class/iommu has entries.

1

CMDLINE_SET

The boot parameter is set.

2

DMA_REMAP

A device group is in a translating domain.

3

IRQ_REMAP

An interrupt goes through interrupt remapping.

4

STRICT

Strict mode, no lazy unmap.

The C names carry the prefix IOMMU_FLAG_ (include/iommu_types.h). require_iommu reads bit 2 alone and refuses with iommu_fail when it is clear.

Event log

The TCG event log the firmware and boot chain wrote, read from /sys/kernel/security/tpm0/binary_bios_measurements. The verifier replays it against the quoted PCRs (Verifier); the agent's side is in Boot evidence.

ESRT entry

Offset

Size

Field

Content

0

4

present

1 when the ESRT holds a System Firmware entry, else 0.

4

4

fw_version

Its fw_version.

8

4

lowest_supported

Its lowest_supported_fw_version.

12

16

fw_class

Its fw_class GUID, raw.

Offsets are from the start of the entry. The agent reads it from /sys/firmware/efi/esrt/entries. The firmware version guards a self-service re-anchor against rollback. present 0 puts it on the low-firmware-assurance path when the pinned baseline had no ESRT either, and escalates it when the baseline had one ("Re-anchor" in Verifier).

MOK list

The data of the MokListRT EFI variable, a run of EFI_SIGNATURE_LIST structures, without the 4 attribute bytes efivarfs prefixes. The verifier compares it with the MokList events of PCR 14 when it re-pins on a Machine Owner Key change.

Result

24 bytes, sent by the verifier once the report is checked.

Offset

Size

Field

Content

0

4

magic

4

4

version

8

4

result

The verdict code ("Verdicts" in Verifier).

12

4

flags

16

8

valid_until

For ok, the Unix time in seconds the verdict holds until; else 0.

The agent reads exactly 24 bytes (struct verifier_result in src/agent/net.h), refuses another magic and does not check the version. It prints valid_until in verbose mode and sets the validity of its tokens from its own interval (Tokens).

Refused reports

Report

Verdict

Another magic

report_malformed, before the body is read.

report_size below 32 or above

report_malformed, before the

562416 bytes

body is read.

Shorter than 5360 bytes, in any version

report_malformed.

Another version

old_version.

A length field above its buffer, a

report_malformed.

section above its limit, or a section

cut off

Versions

The verifier accepts the one version it is built with. A layout change, a field added, removed or moved or a section added, changes LOTA_REPORT_VERSION and ReportVersion together, and agents and verifiers cross it together (Protocol versions). lota-verifier --print-versions prints the version a build speaks.

Layout checks

The serializer copies the packed C structs, and the parser walks offsets of its own, so no build links the two. Four checks hold them together:

make test runs the shell check and the pair; the Go test runs with go test ./... in src/verifier.