Skip to content

Commit

Permalink
Add TODO message for handling expections on verification
Browse files Browse the repository at this point in the history
Currently if incompatible Signature is used for verification with
a Key that supports different Signature, it will cause an error
and breaks the signature verification. This needs to be handled in
future, so that such case won't happen.

Signed-off-by: Pradyumna Krishna <[email protected]>
  • Loading branch information
PradyumnaKrishna committed Jul 22, 2022
1 parent 56d8102 commit 8fa108a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions securesystemslib/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def verify(self, keys: List[Key], threshold: int) -> Dict[str, Key]:
continue

# If a key verifies the signature, we exit and use the result.
# TODO: Handle exception when verifying incompatible Signature type
# with a Key (e.g. Signature and GPGKey).
if key.verify(signature, pae):
accepted_keys[key.keyid] = key
break
Expand Down

0 comments on commit 8fa108a

Please sign in to comment.