Skip to content

Commit f59fcc0

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

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

os/image/aws-pcr-replay.py

Lines changed: 6 additions & 4 deletions
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,16 @@
710
import re
811
from pathlib import Path
912

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

1515

1616
def extend(current: bytes, digest: bytes) -> bytes:
17+
"""Extend a SHA-384 PCR value with one measured digest."""
1718
return hashlib.sha384(current + digest).digest()
1819

1920

2021
def main() -> None:
22+
"""Generate and validate the NitroTPM PCR replay document."""
2123
parser = argparse.ArgumentParser()
2224
parser.add_argument("--trace", type=Path, required=True)
2325
parser.add_argument("--measurements", type=Path, required=True)

0 commit comments

Comments
 (0)