Skip to content

Commit 01ab390

Browse files
committed
one more test case
1 parent db95cf5 commit 01ab390

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
@@ -951,6 +951,18 @@ def test_pkcs7_verify_der_with_certificate(
951951
# Verification
952952
pkcs7.pkcs7_verify_der(signature, certificate=certificate)
953953

954+
def test_pkcs7_verify_der_empty_certificates(self, backend):
955+
# Getting a signature without certificates: empty list, not None
956+
signature_empty_certificates = load_vectors_from_file(
957+
os.path.join("pkcs7", "signature-empty-certs.der"),
958+
loader=lambda derfile: derfile.read(),
959+
mode="rb",
960+
)
961+
962+
# Verification
963+
with pytest.raises(ValueError):
964+
pkcs7.pkcs7_verify_der(signature_empty_certificates)
965+
954966
def test_pkcs7_verify_der_no_certificates(
955967
self, backend, data, certificate, private_key
956968
):
Binary file not shown.

0 commit comments

Comments
 (0)