mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Raise error on empty 'signatures' list
Modify check_signable_object_format() to raise an error if signable has an empty 'signatures' list. Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
This commit is contained in:
parent
461663f363
commit
d3c612bb53
1 changed files with 7 additions and 0 deletions
|
|
@ -938,6 +938,9 @@ def check_signable_object_format(signable):
|
|||
securesystemslib.exceptions.FormatError, if 'signable' does not have the
|
||||
correct format.
|
||||
|
||||
tuf.exceptions.UnsignedMetadataError, if 'signable' does not have any
|
||||
signatures
|
||||
|
||||
<Side Effects>
|
||||
None.
|
||||
|
||||
|
|
@ -965,6 +968,10 @@ def check_signable_object_format(signable):
|
|||
six.raise_from(securesystemslib.exceptions.FormatError(
|
||||
'Unrecognized type ' + repr(role_type)), error)
|
||||
|
||||
if not signable['signatures']:
|
||||
raise tuf.exceptions.UnsignedMetadataError('Signable object of type ' +
|
||||
repr(role_type) + ' has no signatures ', signable)
|
||||
|
||||
# 'securesystemslib.exceptions.FormatError' raised if 'signable' does not
|
||||
# have a properly formatted role schema.
|
||||
schema.check_match(signable['signed'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue