aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509_ext.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-02-27 09:53:46 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2016-02-27 09:53:46 -0500
commita9885600b5ccb1054aa1ebdad216cb29e0f32b16 (patch)
tree5b330e88ab6dab9e0d67e68d5356bcebf1676a91 /tests/test_x509_ext.py
parentaf95980e394a27355531c9aad474d39253755f81 (diff)
downloadcryptography-a9885600b5ccb1054aa1ebdad216cb29e0f32b16.tar.gz
cryptography-a9885600b5ccb1054aa1ebdad216cb29e0f32b16.tar.bz2
cryptography-a9885600b5ccb1054aa1ebdad216cb29e0f32b16.zip
Fixed #2732 -- added support for x.509 policy constraints extension
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r--tests/test_x509_ext.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index ceb11dfe..1a633b47 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -2280,6 +2280,28 @@ class TestPolicyConstraints(object):
assert pc != object()
+
+@pytest.mark.requires_backend_interface(interface=RSABackend)
+@pytest.mark.requires_backend_interface(interface=X509Backend)
+class TestPolicyConstraintsExtension(object):
+ def test_SOMETHING(self, backend):
+ cert = _load_cert(
+ os.path.join(
+ "x509", "department-of-state-root.pem"
+ ),
+ x509.load_pem_x509_certificate,
+ backend
+ )
+ ext = cert.extensions.get_extension_for_oid(
+ ExtensionOID.POLICY_CONSTRAINTS,
+ )
+ assert ext.critical is True
+
+ assert ext.value == x509.PolicyConstraints(
+ require_explicit_policy=None, inhibit_policy_mapping=0,
+ )
+
+
class TestAuthorityInformationAccess(object):
def test_invalid_descriptions(self):
with pytest.raises(TypeError):