@@ -30,7 +30,7 @@ def __init__(self, type: COSETypes, msg: List[Any]):
3030 self ._protected = msg [0 ]
3131 self ._unprotected = msg [1 ]
3232 self ._payload = msg [2 ]
33- self ._otther_fields : List [bytes ] = []
33+ self ._other_fields : List [bytes ] = []
3434 self ._recipients : List [List [Any ]] = []
3535 self ._signatures : List [List [Any ]] = []
3636
@@ -52,14 +52,14 @@ def __init__(self, type: COSETypes, msg: List[Any]):
5252 raise ValueError ("Invalid COSE_Mac0 message." )
5353 if not isinstance (self ._msg [3 ], bytes ):
5454 raise ValueError ("tag should be bytes." )
55- self ._otther_fields = [self ._msg [3 ]] # tag
55+ self ._other_fields = [self ._msg [3 ]] # tag
5656
5757 elif self ._type == COSETypes .MAC :
5858 if len (self ._msg ) != 5 :
5959 raise ValueError ("Invalid COSE_Mac message." )
6060 if not isinstance (self ._msg [3 ], bytes ):
6161 raise ValueError ("The tag value should be bytes." )
62- self ._otther_fields = [self ._msg [3 ]] # tag
62+ self ._other_fields = [self ._msg [3 ]] # tag
6363 if not isinstance (self ._msg [4 ], list ):
6464 raise ValueError ("The COSE recipients should be array." )
6565 for recipient in self ._msg [4 ]:
@@ -71,7 +71,7 @@ def __init__(self, type: COSETypes, msg: List[Any]):
7171 raise ValueError ("Invalid COSE_Sign1 message." )
7272 if not isinstance (self ._msg [3 ], bytes ):
7373 raise ValueError ("The COSE signature should be bytes." )
74- self ._otther_fields = [self ._msg [3 ]]
74+ self ._other_fields = [self ._msg [3 ]]
7575
7676 elif self ._type == COSETypes .SIGN :
7777 if len (self ._msg ) != 4 :
@@ -149,7 +149,7 @@ def other_fields(self) -> List[bytes]:
149149 """
150150 The list of other fields of the COSE message.
151151 """
152- return self ._otther_fields
152+ return self ._other_fields
153153
154154 @property
155155 def signatures (self ) -> List [List [Any ]]:
@@ -189,14 +189,14 @@ def countersign(self: Self, signer: Signer, aad: bytes = b"", abbreviated: bool
189189 """
190190 if abbreviated :
191191 to_be_signed = ["CounterSignature0V2" , self ._protected , aad , self ._payload ]
192- for other_field in self ._otther_fields :
192+ for other_field in self ._other_fields :
193193 to_be_signed .append (other_field )
194194 signer .sign (self ._dumps (to_be_signed ))
195195 self ._unprotected [12 ] = signer .signature
196196 return self
197197
198198 to_be_signed = ["CounterSignatureV2" , self ._protected , signer .protected , aad , self ._payload ]
199- for other_field in self ._otther_fields :
199+ for other_field in self ._other_fields :
200200 to_be_signed .append (other_field )
201201 signer .sign (self ._dumps (to_be_signed ))
202202 cs = self ._unprotected .get (11 , None )
@@ -226,7 +226,7 @@ def counterverify(self, key: COSEKeyInterface, aad: bytes = b"") -> Optional[Lis
226226 acs = self ._unprotected .get (12 , None )
227227 if acs :
228228 to_be_signed = ["CounterSignature0V2" , self ._protected , aad , self ._payload ]
229- for other_field in self ._otther_fields :
229+ for other_field in self ._other_fields :
230230 to_be_signed .append (other_field )
231231 try :
232232 key .verify (self ._dumps (to_be_signed ), acs )
@@ -238,7 +238,7 @@ def counterverify(self, key: COSEKeyInterface, aad: bytes = b"") -> Optional[Lis
238238 if not cs :
239239 raise err
240240 to_be_signed = ["CounterSignatureV2" , self ._protected , b"" , aad , self ._payload ]
241- for other_field in self ._otther_fields :
241+ for other_field in self ._other_fields :
242242 to_be_signed .append (other_field )
243243 if isinstance (cs [0 ], bytes ):
244244 kid = self ._get_kid (cs )
0 commit comments