aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/x509.rst6
-rw-r--r--src/cryptography/hazmat/backends/openssl/x509.py2
-rw-r--r--tests/test_x509_ext.py2
3 files changed, 7 insertions, 3 deletions
diff --git a/docs/x509.rst b/docs/x509.rst
index 2e4a0efb..035fa87f 100644
--- a/docs/x509.rst
+++ b/docs/x509.rst
@@ -974,9 +974,13 @@ Exceptions
.. attribute:: type
- :type: :term:`text` or int
+ :type: int
+
+ The integer value of the unsupported type. The complete list of
+ types can be found in `RFC 5280 section 4.2.1.6`_.
.. _`public key infrastructure`: https://en.wikipedia.org/wiki/Public_key_infrastructure
.. _`TLS`: https://en.wikipedia.org/wiki/Transport_Layer_Security
.. _`RFC 5280 section 4.2.1.1`: https://tools.ietf.org/html/rfc5280#section-4.2.1.1
+.. _`RFC 5280 section 4.2.1.6`: https://tools.ietf.org/html/rfc5280#section-4.2.1.6
diff --git a/src/cryptography/hazmat/backends/openssl/x509.py b/src/cryptography/hazmat/backends/openssl/x509.py
index 07e79fed..cc4a92a6 100644
--- a/src/cryptography/hazmat/backends/openssl/x509.py
+++ b/src/cryptography/hazmat/backends/openssl/x509.py
@@ -69,7 +69,7 @@ def _build_general_name(backend, gn):
"{0} is not a supported type".format(
x509._GENERAL_NAMES.get(gn.type, gn.type)
),
- x509._GENERAL_NAMES.get(gn.type, gn.type)
+ gn.type
)
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py
index c17beba5..1283fca7 100644
--- a/tests/test_x509_ext.py
+++ b/tests/test_x509_ext.py
@@ -769,4 +769,4 @@ class TestRSASubjectAlternativeNameExtension(object):
with pytest.raises(x509.UnsupportedGeneralNameType) as exc:
cert.extensions
- assert exc.value.type == "otherName"
+ assert exc.value.type == 0