diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-04-22 09:22:56 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-04-22 13:48:39 -0500 |
commit | 0a621bf5da576d7aab394e5bdc342e2e8b1cbaa2 (patch) | |
tree | 24b07b6643387f3a82ed5733ab8155e0612978ab | |
parent | bed07357a90237ee92cedba788066f87a63e34b6 (diff) | |
download | cryptography-0a621bf5da576d7aab394e5bdc342e2e8b1cbaa2.tar.gz cryptography-0a621bf5da576d7aab394e5bdc342e2e8b1cbaa2.tar.bz2 cryptography-0a621bf5da576d7aab394e5bdc342e2e8b1cbaa2.zip |
return only an int for unsupported general name type, update docs
-rw-r--r-- | docs/x509.rst | 6 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/x509.py | 2 | ||||
-rw-r--r-- | tests/test_x509_ext.py | 2 |
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 |