Skip to content

Commit

Permalink
allow X509_ALGOR to be opaque (#1262)
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperhulk authored Oct 24, 2023
1 parent ac15b2f commit 046a71e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Backward-incompatible changes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Dropped support for Python 3.6.
- The minimum ``cryptography`` version is now 41.0.0.
- The minimum ``cryptography`` version is now 41.0.5.
- Removed ``OpenSSL.crypto.loads_pkcs7`` and ``OpenSSL.crypto.loads_pkcs12`` which had been deprecated for 3 years.
- Added ``OpenSSL.SSL.OP_LEGACY_SERVER_CONNECT`` to allow legacy insecure renegotiation between OpenSSL and unpatched servers.
`#1234 <https://github.com/pyca/pyopenssl/pull/1234>`_.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def find_meta(meta):
packages=find_packages(where="src"),
package_dir={"": "src"},
install_requires=[
"cryptography>=41.0.0,<42",
"cryptography>=41.0.5,<42",
],
extras_require={
"test": ["flaky", "pretend", "pytest>=3.0.1"],
Expand Down
6 changes: 4 additions & 2 deletions src/OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,8 +1322,10 @@ def get_signature_algorithm(self) -> bytes:
.. versionadded:: 0.13
"""
algor = _lib.X509_get0_tbs_sigalg(self._x509)
nid = _lib.OBJ_obj2nid(algor.algorithm)
sig_alg = _lib.X509_get0_tbs_sigalg(self._x509)
alg = _ffi.new("ASN1_OBJECT **")
_lib.X509_ALGOR_get0(alg, _ffi.NULL, _ffi.NULL, sig_alg)
nid = _lib.OBJ_obj2nid(alg[0])
if nid == _lib.NID_undef:
raise ValueError("Undefined signature algorithm")
return _ffi.string(_lib.OBJ_nid2ln(nid))
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extras =
test
deps =
coverage>=4.2
cryptographyMinimum: cryptography==41.0.0
cryptographyMinimum: cryptography==41.0.5
randomorder: pytest-randomly
setenv =
# Do not allow the executing environment to pollute the test environment
Expand Down

0 comments on commit 046a71e

Please sign in to comment.