mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Added additional PKCS#12 tests (#10625)
This commit is contained in:
parent
8bd15a1d28
commit
089039d0f6
1 changed files with 24 additions and 0 deletions
|
|
@ -529,6 +529,30 @@ class TestPKCS12Creation:
|
|||
assert parsed_key is None
|
||||
assert parsed_more_certs == [cert]
|
||||
|
||||
def test_generate_cert_only_none_cas(self, backend):
|
||||
# Same as test_generate_cert_only, but passing None instead of an
|
||||
# empty list for cas.
|
||||
cert, _ = _load_ca(backend)
|
||||
p12 = serialize_key_and_certificates(
|
||||
None, None, cert, None, serialization.NoEncryption()
|
||||
)
|
||||
parsed_key, parsed_cert, parsed_more_certs = load_key_and_certificates(
|
||||
p12, None
|
||||
)
|
||||
assert parsed_cert is None
|
||||
assert parsed_key is None
|
||||
assert parsed_more_certs == [cert]
|
||||
|
||||
def test_invalid_utf8_friendly_name(self, backend):
|
||||
if rust_openssl.CRYPTOGRAPHY_IS_LIBRESSL:
|
||||
pytest.skip("Temporarily doesn't work on LibreSSL")
|
||||
|
||||
cert, _ = _load_ca(backend)
|
||||
with pytest.raises(ValueError):
|
||||
serialize_key_and_certificates(
|
||||
b"\xc9", None, cert, None, serialization.NoEncryption()
|
||||
)
|
||||
|
||||
def test_must_supply_something(self):
|
||||
with pytest.raises(ValueError) as exc:
|
||||
serialize_key_and_certificates(
|
||||
|
|
|
|||
Loading…
Reference in a new issue