Skip to content

Commit b8bccd9

Browse files
committed
chore(image): satisfy replay helper linters
1 parent a6ee463 commit b8bccd9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

os/image/aws-pcr-replay.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
# SPDX-FileCopyrightText: Copyright (c) 2026 Phala Network
3+
# SPDX-License-Identifier: Apache-2.0
4+
25
"""Build a NitroTPM PCR replay document from the pinned AWS tool trace."""
36

47
import argparse
@@ -7,17 +10,18 @@
710
import re
811
from pathlib import Path
912

10-
1113
EVENT_RE = re.compile(
1214
r"\[PCR(4|7|12)\]\s+([A-Z0-9_]+):\s+SHA384:([0-9a-fA-F]{96})"
1315
)
1416

1517

1618
def extend(current: bytes, digest: bytes) -> bytes:
19+
"""Extend a SHA-384 PCR value with one measured digest."""
1720
return hashlib.sha384(current + digest).digest()
1821

1922

2023
def main() -> None:
24+
"""Generate and validate the NitroTPM PCR replay document."""
2125
parser = argparse.ArgumentParser()
2226
parser.add_argument("--trace", type=Path, required=True)
2327
parser.add_argument("--measurements", type=Path, required=True)

0 commit comments

Comments
 (0)