Skip to content

Commit d8c8e56

Browse files
committed
Check the format of keyval in Root
Signed-off-by: Martin Vrachev <[email protected]>
1 parent 2319c83 commit d8c8e56

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tuf/api/metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ def __init__(
425425
keyval: Mapping[str, str],
426426
unrecognized_fields: Optional[Mapping[str, Any]] = None,
427427
) -> None:
428+
if not keyval.get("public"):
429+
raise ValueError(f"keyval doesn't follow the specification format!")
428430
self.keytype = keytype
429431
self.scheme = scheme
430432
self.keyval = keyval

0 commit comments

Comments
 (0)