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.
1 parent 97c0565 commit 566d0b5Copy full SHA for 566d0b5
1 file changed
cwt/cose.py
@@ -723,7 +723,7 @@ def _encode_and_encrypt(
723
b_key = key.to_bytes() if isinstance(key, COSEKeyInterface) else b""
724
cek: Optional[COSEKeyInterface] = None
725
for rec in recipients:
726
- 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])
727
encoded, derived_key = rec.encode(b_key, aad)
728
cek = derived_key if derived_key else key
729
recs.append(encoded)
0 commit comments