Skip to content

Commit d29b4d0

Browse files
committed
revert: let _msg to hold the latest value and _payload to hold the original
1 parent 2892ef1 commit d29b4d0

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

cwt/cose_message.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,7 @@ def __init__(self, type: COSETypes, msg: List[Any]):
103103
def __eq__(self: COSEMessage, other: object) -> bool:
104104
if not isinstance(other, COSEMessage):
105105
return NotImplemented
106-
return (
107-
self._type == other._type
108-
and self._protected == other._protected
109-
and self._unprotected == other._unprotected
110-
and self._payload == other._payload
111-
and self._other_fields == other._other_fields
112-
)
106+
return self._type == other._type and self._msg == other._msg
113107

114108
def __ne__(self: COSEMessage, other: object) -> bool:
115109
return not self.__eq__(other)
@@ -186,11 +180,7 @@ def dumps(self) -> bytes:
186180
Serializes the COSE message structure to a byte string.
187181
"""
188182
tag = COSE_TYPE_TO_TAG.get(self._type, -1)
189-
return (
190-
self._dumps(CBORTag(tag, [self._protected, self._unprotected, self._payload, *self._msg[3:]]))
191-
if tag > 0
192-
else self._dumps([self._protected, self._unprotected, self._payload, *self._msg[3:]])
193-
)
183+
return self._dumps(CBORTag(tag, self._msg)) if tag > 0 else self._dumps(self._msg)
194184

195185
def countersign(self: Self, signer: Signer, aad: bytes = b"", abbreviated: bool = False, tagged: bool = False) -> Self:
196186
"""

0 commit comments

Comments
 (0)