Skip to content

Commit

Permalink
verify_signature(): handle SerializationError
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
MVrachev committed Feb 8, 2022
1 parent 0b2f985 commit 2f381ae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tuf/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
from tuf.api.serialization import (
MetadataDeserializer,
MetadataSerializer,
SerializationError,
SignedSerializer,
)

Expand Down Expand Up @@ -670,6 +671,7 @@ def verify_signature(
sslib_exceptions.CryptoError,
sslib_exceptions.FormatError,
sslib_exceptions.UnsupportedAlgorithmError,
SerializationError,
) as e:
raise exceptions.UnsignedMetadataError(
f"Failed to verify {self.keyid} signature"
Expand Down

0 comments on commit 2f381ae

Please sign in to comment.