(self, monkeypatch)
| 528 | |
| 529 | @pytest.mark.skipif(AESKey is None, reason="No AES backend") |
| 530 | def test_jwe_with_excessive_data(self, monkeypatch): |
| 531 | enc = ALGORITHMS.A256CBC_HS512 |
| 532 | alg = ALGORITHMS.RSA_OAEP_256 |
| 533 | monkeypatch.setattr("jose.constants.JWE_SIZE_LIMIT", 1024) |
| 534 | encrypted = jwe.encrypt(b"Text" * 64 * 1024, PUBLIC_KEY_PEM, enc, alg) |
| 535 | header = json.loads(base64url_decode(encrypted.split(b".")[0])) |
| 536 | with pytest.raises(JWEError) as excinfo: |
| 537 | actual = jwe.decrypt(encrypted, PRIVATE_KEY_PEM) |
| 538 | assert "JWE string" in str(excinfo.value) |
| 539 | assert "bytes exceeds" in str(excinfo.value) |
| 540 | |
| 541 | @pytest.mark.skipif(AESKey is None, reason="No AES backend") |
| 542 | def test_jwe_zip_with_excessive_data(self, monkeypatch): |
nothing calls this directly
no test coverage detected