diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2017-06-29 22:51:33 -0700 |
---|---|---|
committer | Cory Benfield <lukasaoz@gmail.com> | 2017-06-30 06:51:33 +0100 |
commit | d61c46a339354f533eb14331ca0c40b8d4dd72a2 (patch) | |
tree | 087bb22a1894652ea8c6d0d10cdd906fd53e3914 /src/OpenSSL/crypto.py | |
parent | e1d8db536024311eeef4b3557bcf54747711d9cb (diff) | |
download | pyopenssl-d61c46a339354f533eb14331ca0c40b8d4dd72a2.tar.gz |
Kill some commented out code and other cleanups (#649)
Diffstat (limited to 'src/OpenSSL/crypto.py')
-rw-r--r-- | src/OpenSSL/crypto.py | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py index 5803ae9..e58a455 100644 --- a/src/OpenSSL/crypto.py +++ b/src/OpenSSL/crypto.py @@ -739,23 +739,9 @@ class X509Extension(object): } def _subjectAltNameString(self): - method = _lib.X509V3_EXT_get(self._extension) - _openssl_assert(method != _ffi.NULL) - ext_data = _lib.X509_EXTENSION_get_data(self._extension) - payload = ext_data.data - length = ext_data.length - - payloadptr = _ffi.new("unsigned char**") - payloadptr[0] = payload - - if method.it != _ffi.NULL: - ptr = _lib.ASN1_ITEM_ptr(method.it) - data = _lib.ASN1_item_d2i(_ffi.NULL, payloadptr, length, ptr) - names = _ffi.cast("GENERAL_NAMES*", data) - else: - names = _ffi.cast( - "GENERAL_NAMES*", - method.d2i(_ffi.NULL, payloadptr, length)) + names = _ffi.cast( + "GENERAL_NAMES*", _lib.X509V3_EXT_d2i(self._extension) + ) names = _ffi.gc(names, _lib.GENERAL_NAMES_free) parts = [] |