Skip to content

Commit e1d5f17

Browse files
committed
one more test case
1 parent 130d6f6 commit e1d5f17

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/hazmat/primitives/test_pkcs7.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,18 @@ def test_pkcs7_verify_der_with_certificate(
11091109
# Verification
11101110
pkcs7.pkcs7_verify_der(signature, certificate=certificate)
11111111

1112+
def test_pkcs7_verify_der_empty_certificates(self, backend):
1113+
# Getting a signature without certificates: empty list, not None
1114+
signature_empty_certificates = load_vectors_from_file(
1115+
os.path.join("pkcs7", "signature-empty-certs.der"),
1116+
loader=lambda derfile: derfile.read(),
1117+
mode="rb",
1118+
)
1119+
1120+
# Verification
1121+
with pytest.raises(ValueError):
1122+
pkcs7.pkcs7_verify_der(signature_empty_certificates)
1123+
11121124
def test_pkcs7_verify_der_no_certificates(
11131125
self, backend, data, certificate, private_key
11141126
):
Binary file not shown.

0 commit comments

Comments
 (0)