Skip to content

Commit 0411788

Browse files
committed
one more test case
1 parent 98f9128 commit 0411788

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
@@ -966,6 +966,18 @@ def test_pkcs7_verify_der_with_certificate(
966966
# Verification
967967
pkcs7.pkcs7_verify_der(signature, certificate=certificate)
968968

969+
def test_pkcs7_verify_der_empty_certificates(self, backend):
970+
# Getting a signature without certificates: empty list, not None
971+
signature_empty_certificates = load_vectors_from_file(
972+
os.path.join("pkcs7", "signature-empty-certs.der"),
973+
loader=lambda derfile: derfile.read(),
974+
mode="rb",
975+
)
976+
977+
# Verification
978+
with pytest.raises(ValueError):
979+
pkcs7.pkcs7_verify_der(signature_empty_certificates)
980+
969981
def test_pkcs7_verify_der_no_certificates(
970982
self, backend, data, certificate, private_key
971983
):
Binary file not shown.

0 commit comments

Comments
 (0)