diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-09 21:03:46 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-09 21:03:46 -0400 |
commit | b4e47f87c0d7240f072af26e8ccb40657110be5d (patch) | |
tree | c7a133d9ab44a9ec909e31bb2b354b1552998338 | |
parent | 801999fe6ba5391b098a20047d7f2644c57bcf4c (diff) | |
download | cryptography-b4e47f87c0d7240f072af26e8ccb40657110be5d.tar.gz cryptography-b4e47f87c0d7240f072af26e8ccb40657110be5d.tar.bz2 cryptography-b4e47f87c0d7240f072af26e8ccb40657110be5d.zip |
opaque X509_EXTENSION
-rw-r--r-- | src/_cffi_src/openssl/x509.py | 6 | ||||
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/decode_asn1.py | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/_cffi_src/openssl/x509.py b/src/_cffi_src/openssl/x509.py index c5eb600a..112f4ed2 100644 --- a/src/_cffi_src/openssl/x509.py +++ b/src/_cffi_src/openssl/x509.py @@ -36,11 +36,7 @@ typedef struct { ...; } X509_CINF; -typedef struct { - ASN1_OBJECT *object; - ASN1_BOOLEAN critical; - ASN1_OCTET_STRING *value; -} X509_EXTENSION; +typedef ... X509_EXTENSION; typedef ... X509_EXTENSIONS; typedef ... X509_REQ_INFO; diff --git a/src/cryptography/hazmat/backends/openssl/decode_asn1.py b/src/cryptography/hazmat/backends/openssl/decode_asn1.py index 5f828c6b..140d3de4 100644 --- a/src/cryptography/hazmat/backends/openssl/decode_asn1.py +++ b/src/cryptography/hazmat/backends/openssl/decode_asn1.py @@ -198,7 +198,9 @@ class _X509ExtensionParser(object): backend.openssl_assert(ext != backend._ffi.NULL) crit = backend._lib.X509_EXTENSION_get_critical(ext) critical = crit == 1 - oid = x509.ObjectIdentifier(_obj2txt(backend, ext.object)) + oid = x509.ObjectIdentifier( + _obj2txt(backend, backend._lib.X509_EXTENSION_get_object(ext)) + ) if oid in seen_oids: raise x509.DuplicateExtension( "Duplicate {0} extension found".format(oid), oid @@ -652,9 +654,10 @@ def _decode_cert_issuer(backend, ext): """ data_ptr_ptr = backend._ffi.new("const unsigned char **") - data_ptr_ptr[0] = ext.value.data + value = backend._lib.X509_EXTENSION_get_data(ext) + data_ptr_ptr[0] = value.data gns = backend._lib.d2i_GENERAL_NAMES( - backend._ffi.NULL, data_ptr_ptr, ext.value.length + backend._ffi.NULL, data_ptr_ptr, value.length ) # Check the result of d2i_GENERAL_NAMES() is valid. Usually this is covered |