Skip to content

Commit d796637

Browse files
committed
chore: disable false alert from SonarCloud
1 parent e10e173 commit d796637

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/joserfc/_rfc7518/jwe_encs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def encrypt(self, plaintext: bytes, cek: bytes, iv: bytes, aad: bytes) -> tuple[
5353
pad = PKCS7(AES.block_size).padder()
5454
padded_data = pad.update(plaintext) + pad.finalize()
5555

56+
# noqa: S5542 # Safe: JWE A128CBC-HS256 uses CBC + HMAC (Encrypt-then-MAC)
5657
cipher = Cipher(AES(ekey), CBC(iv))
5758
enc = cipher.encryptor()
5859
ciphertext = enc.update(padded_data) + enc.finalize()
@@ -68,6 +69,7 @@ def decrypt(self, ciphertext: bytes, tag: bytes, cek: bytes, iv: bytes, aad: byt
6869
if not hmac.compare_digest(ctag, tag):
6970
raise DecodeError("tag does not match")
7071

72+
# noqa: S5542 # Safe: JWE A128CBC-HS256 uses CBC + HMAC (Encrypt-then-MAC)
7173
cipher = Cipher(AES(dkey), CBC(iv))
7274
d = cipher.decryptor()
7375
data = d.update(ciphertext) + d.finalize()

0 commit comments

Comments
 (0)