Skip to content

Commit fc1558b

Browse files
author
Jussi Kukkonen
committed
Metadata API: Log details of verify error
We don't want to error out from the whole verify_delegate() process if e.g. a single key fails to load but we do want to provide details for debugging in the unexpected failure cases. This means "example_client -vv download file1.txt" fails like this: Found trusted root in /home/jku/.local/share/python-tuf-client-example INFO:tuf.api.metadata:Key 4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb failed to verify sig: Failed to load PEM key bogus-key-content-here INFO:tuf.api.metadata:Key 4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb failed to verify root Failed to download target x: root was signed by 0/1 keys Fixes #1875 Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
1 parent d4814e8 commit fc1558b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tuf/api/metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ def verify_signature(
704704
sslib_exceptions.UnsupportedAlgorithmError,
705705
SerializationError,
706706
) as e:
707+
# Log unexpected failure, but continue as if there was no signature
708+
logger.info("Key %s failed to verify sig: %s", self.keyid, str(e))
707709
raise exceptions.UnsignedMetadataError(
708710
f"Failed to verify {self.keyid} signature"
709711
) from e

0 commit comments

Comments
 (0)