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 15ba26f + 10f7efc commit 74d2e76Copy full SHA for 74d2e76
1 file changed
cwt/cose.py
@@ -738,7 +738,7 @@ def _encode_and_encrypt(
738
b_key = key.to_bytes() if isinstance(key, COSEKeyInterface) else b""
739
cek: Optional[COSEKeyInterface] = None
740
for rec in recipients:
741
- 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])
742
encoded, derived_key = rec.encode(b_key, aad)
743
cek = derived_key if derived_key else key
744
recs.append(encoded)
0 commit comments