Skip to content

Commit 2f381ae

Browse files
author
Martin Vrachev
committed
verify_signature(): handle SerializationError
We should handle the possible SerializationError inside Key.verify_signature(), because the user of this API is not interested in SerializationError when he is trying to verify his signature. Note that the SerializationError can be thrown when calling signed_serializer.serialize() on the metadata signed part. Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
1 parent 0b2f985 commit 2f381ae

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
@@ -60,6 +60,7 @@
6060
from tuf.api.serialization import (
6161
MetadataDeserializer,
6262
MetadataSerializer,
63+
SerializationError,
6364
SignedSerializer,
6465
)
6566

@@ -670,6 +671,7 @@ def verify_signature(
670671
sslib_exceptions.CryptoError,
671672
sslib_exceptions.FormatError,
672673
sslib_exceptions.UnsupportedAlgorithmError,
674+
SerializationError,
673675
) as e:
674676
raise exceptions.UnsignedMetadataError(
675677
f"Failed to verify {self.keyid} signature"

0 commit comments

Comments
 (0)