aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/backends/openssl/backend.py8
-rw-r--r--src/cryptography/x509.py4
2 files changed, 11 insertions, 1 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
index 7917402f..570782a2 100644
--- a/src/cryptography/hazmat/backends/openssl/backend.py
+++ b/src/cryptography/hazmat/backends/openssl/backend.py
@@ -210,7 +210,9 @@ def _encode_authority_information_access(backend, authority_info_access):
)
for access_description in authority_info_access:
ad = backend._lib.ACCESS_DESCRIPTION_new()
- method = _txt2obj(backend, access_description.access_method)
+ method = _txt2obj(
+ backend, access_description.access_method.dotted_string
+ )
gn = _encode_general_name(backend, access_description.access_location)
ad.method = method
ad.location = gn
@@ -1163,6 +1165,10 @@ class Backend(object):
pp, r = _encode_basic_constraints(self, extension.value)
elif isinstance(extension.value, x509.SubjectAlternativeName):
pp, r = _encode_subject_alt_name(self, extension.value)
+ elif isinstance(extension.value, x509.AuthorityInformationAccess):
+ pp, r = _encode_authority_information_access(
+ self, extension.value
+ )
else:
raise NotImplementedError('Extension not yet supported.')
diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py
index f35582b0..6e27cdb7 100644
--- a/src/cryptography/x509.py
+++ b/src/cryptography/x509.py
@@ -1724,6 +1724,10 @@ class CertificateBuilder(object):
extension = Extension(
OID_SUBJECT_ALTERNATIVE_NAME, critical, extension
)
+ elif isinstance(extension, AuthorityInformationAccess):
+ extension = Extension(
+ OID_AUTHORITY_INFORMATION_ACCESS, critical, extension
+ )
elif isinstance(extension, InhibitAnyPolicy):
extension = Extension(OID_INHIBIT_ANY_POLICY, critical, extension)
else: