Skip to content

Commit

Permalink
fix (build system): add handling of wrong cbor data passed to SuitTag
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Stypa <[email protected]>
  • Loading branch information
robertstypa committed Feb 27, 2024
1 parent 52970f9 commit f335cf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion suit_generator/suit/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ class SuitTag(SuitObject):
def from_cbor(cls, cbstr: bytes) -> SuitTag:
"""Restore SUIT representation from passed CBOR."""
cbor = cls.deserialize_cbor(cbstr)
if cls._metadata.tag.value != cbor.tag:
if not hasattr(cbor, 'tag') or cls._metadata.tag.value != cbor.tag:
raise ValueError(f"CBOR tag not found in: {cbor}")
return cls(cbor2.CBORTag(cbor.tag, cls._metadata.children[0].from_cbor(cls.serialize_cbor(cbor.value))))

Expand Down

0 comments on commit f335cf5

Please sign in to comment.