Merge pull request #476 from alex/opaque-the-sigalg
X509 sigalg is now opaque
diff --git a/setup.py b/setup.py
index 4643f71..d4c27ad 100755
--- a/setup.py
+++ b/setup.py
@@ -95,7 +95,7 @@
package_dir={"": "src"},
install_requires=[
# Fix cryptographyMinimum in tox.ini when changing this!
- "cryptography>=1.3",
+ "cryptography>=1.3.4",
"six>=1.5.2"
],
)
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index 7e05ca6..21bdadd 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -1083,8 +1083,8 @@
.. versionadded:: 0.13
"""
- alg = self._x509.cert_info.signature.algorithm
- nid = _lib.OBJ_obj2nid(alg)
+ algor = _lib.X509_get0_tbs_sigalg(self._x509)
+ nid = _lib.OBJ_obj2nid(algor.algorithm)
if nid == _lib.NID_undef:
raise ValueError("Undefined signature algorithm")
return _ffi.string(_lib.OBJ_nid2ln(nid))
@@ -1787,7 +1787,7 @@
obj = _lib.X509_EXTENSION_get_object(ext)
if _lib.OBJ_obj2nid(obj) == _lib.NID_crl_reason:
_lib.X509_EXTENSION_free(ext)
- _lib.sk_X509_EXTENSION_delete(self._revoked.extensions, i)
+ _lib.X509_REVOKED_delete_ext(self._revoked, i)
break
def set_reason(self, reason):