aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/backends/openssl/backend.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
index d6493778..194f295c 100644
--- a/src/cryptography/hazmat/backends/openssl/backend.py
+++ b/src/cryptography/hazmat/backends/openssl/backend.py
@@ -171,6 +171,15 @@ def _encode_subject_alt_name(backend, san):
)
assert obj != backend._ffi.NULL
gn.d.registeredID = obj
+ elif isinstance(alt_name, x509.DirectoryName):
+ gn = backend._lib.GENERAL_NAME_new()
+ assert gn != backend._ffi.NULL
+ name = _encode_name(backend, alt_name.value)
+ # _encode_name registers the X509_NAME for gc so we'll duplicate
+ # a new one that is not gc'd for the struct
+ name = backend._lib.X509_NAME_dup(name)
+ gn.type = backend._lib.GEN_DIRNAME
+ gn.d.directoryName = name
else:
raise NotImplementedError(
"Only DNSName and RegisteredID supported right now"