We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d2cb342 + 566d0b5 commit 10f7efcCopy full SHA for 10f7efc
1 file changed
cwt/cose.py
@@ -728,7 +728,7 @@ def _encode_and_encrypt(
728
b_key = key.to_bytes() if isinstance(key, COSEKeyInterface) else b""
729
cek: Optional[COSEKeyInterface] = None
730
for rec in recipients:
731
- aad = self._dumps(["Enc_Recipient", self._dumps(rec.protected), external_aad])
+ aad = self._dumps(["Enc_Recipient", self._dumps(rec.protected) if len(rec.protected) > 0 else b"", external_aad])
732
encoded, derived_key = rec.encode(b_key, aad)
733
cek = derived_key if derived_key else key
734
recs.append(encoded)
0 commit comments