pyOpenSSL 26.0.0__tar.gz → 26.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/CHANGELOG.rst +15 -0
  2. {pyopenssl-26.0.0/src/pyOpenSSL.egg-info → pyopenssl-26.1.0}/PKG-INFO +17 -2
  3. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/backward-compatibility.rst +7 -0
  4. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/setup.py +1 -1
  5. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/OpenSSL/crypto.py +1 -1
  6. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/OpenSSL/version.py +1 -1
  7. {pyopenssl-26.0.0 → pyopenssl-26.1.0/src/pyOpenSSL.egg-info}/PKG-INFO +17 -2
  8. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/pyOpenSSL.egg-info/requires.txt +1 -1
  9. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/tests/test_crypto.py +18 -8
  10. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/tests/test_ssl.py +5 -1
  11. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/CODE_OF_CONDUCT.rst +0 -0
  12. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/CONTRIBUTING.rst +0 -0
  13. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/INSTALL.rst +0 -0
  14. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/LICENSE +0 -0
  15. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/MANIFEST.in +0 -0
  16. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/README.rst +0 -0
  17. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/ChangeLog_old.txt +0 -0
  18. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/Makefile +0 -0
  19. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/Quotes +0 -0
  20. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/README +0 -0
  21. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/api/crypto.rst +0 -0
  22. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/api/ssl.rst +0 -0
  23. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/api.rst +0 -0
  24. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/changelog.rst +0 -0
  25. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/conf.py +0 -0
  26. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/images/pyopenssl-brand.png +0 -0
  27. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/images/pyopenssl-icon.png +0 -0
  28. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/images/pyopenssl-logo.png +0 -0
  29. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/images/pyopenssl.svg +0 -0
  30. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/index.rst +0 -0
  31. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/install.rst +0 -0
  32. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/internals.rst +0 -0
  33. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/introduction.rst +0 -0
  34. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/doc/make.bat +0 -0
  35. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/noxfile.py +0 -0
  36. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/pyproject.toml +0 -0
  37. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/setup.cfg +0 -0
  38. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/OpenSSL/SSL.py +0 -0
  39. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/OpenSSL/__init__.py +0 -0
  40. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/OpenSSL/_util.py +0 -0
  41. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/OpenSSL/debug.py +0 -0
  42. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/OpenSSL/py.typed +0 -0
  43. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/OpenSSL/rand.py +0 -0
  44. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/pyOpenSSL.egg-info/SOURCES.txt +0 -0
  45. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/pyOpenSSL.egg-info/dependency_links.txt +0 -0
  46. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/src/pyOpenSSL.egg-info/top_level.txt +0 -0
  47. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/tests/__init__.py +0 -0
  48. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/tests/conftest.py +0 -0
  49. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/tests/test_debug.py +0 -0
  50. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/tests/test_rand.py +0 -0
  51. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/tests/test_util.py +0 -0
  52. {pyopenssl-26.0.0 → pyopenssl-26.1.0}/tests/util.py +0 -0
@@ -4,6 +4,21 @@ Changelog
4
4
  Versions are year-based with a strict backward-compatibility policy.
5
5
  The third digit is only for regressions.
6
6
 
7
+ 26.1.0 (2026-04-24)
8
+ -------------------
9
+
10
+ Backward-incompatible changes:
11
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
+
13
+ Deprecations:
14
+ ^^^^^^^^^^^^^
15
+
16
+ Changes:
17
+ ^^^^^^^^
18
+
19
+ - Maximum supported ``cryptography`` version is now 47.x.
20
+ - Fixed ``X509Name`` field setters to correctly pass the value length to OpenSSL. Previously, values containing NUL bytes would be silently truncated, causing a divergence between the stored ASN.1 value and the value visible from Python. Credit to **BudongJW** for reporting the issue. **CVE-2026-40475**
21
+
7
22
  26.0.0 (2026-03-15)
8
23
  -------------------
9
24
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyOpenSSL
3
- Version: 26.0.0
3
+ Version: 26.1.0
4
4
  Summary: Python wrapper module around the OpenSSL library
5
5
  Home-page: https://pyopenssl.org/
6
6
  Author: The pyOpenSSL developers
@@ -27,7 +27,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
27
  Classifier: Topic :: System :: Networking
28
28
  Requires-Python: >=3.8
29
29
  License-File: LICENSE
30
- Requires-Dist: cryptography<47,>=46.0.0
30
+ Requires-Dist: cryptography<48,>=46.0.0
31
31
  Requires-Dist: typing-extensions>=4.9; python_version < "3.13" and python_version >= "3.8"
32
32
  Provides-Extra: test
33
33
  Requires-Dist: pytest-rerunfailures; extra == "test"
@@ -96,6 +96,21 @@ You can also join ``#pyca`` on ``irc.libera.chat`` to ask questions or get invol
96
96
  Release Information
97
97
  ===================
98
98
 
99
+ 26.1.0 (2026-04-24)
100
+ -------------------
101
+
102
+ Backward-incompatible changes:
103
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
+
105
+ Deprecations:
106
+ ^^^^^^^^^^^^^
107
+
108
+ Changes:
109
+ ^^^^^^^^
110
+
111
+ - Maximum supported ``cryptography`` version is now 47.x.
112
+ - Fixed ``X509Name`` field setters to correctly pass the value length to OpenSSL. Previously, values containing NUL bytes would be silently truncated, causing a divergence between the stored ASN.1 value and the value visible from Python. Credit to **BudongJW** for reporting the issue. **CVE-2026-40475**
113
+
99
114
  26.0.0 (2026-03-15)
100
115
  -------------------
101
116
 
@@ -9,3 +9,10 @@ If breaking changes are needed do be done, they are:
9
9
  #. …announced in the :doc:`changelog`.
10
10
  #. …the old behavior raises a :exc:`DeprecationWarning` for a year.
11
11
  #. …are done with another announcement in the :doc:`changelog`.
12
+
13
+ Versioning Policy
14
+ =================
15
+
16
+ pyOpenSSL follows `CalVer <https://calver.org>`_ in `YY.MINOR.MICRO` format.
17
+ Unlike SemVer, major versions represent the year, and are not indicative of
18
+ breaking changes.
@@ -93,7 +93,7 @@ if __name__ == "__main__":
93
93
  packages=find_packages(where="src"),
94
94
  package_dir={"": "src"},
95
95
  install_requires=[
96
- "cryptography>=46.0.0,<47",
96
+ "cryptography>=46.0.0,<48",
97
97
  (
98
98
  "typing-extensions>=4.9; "
99
99
  "python_version < '3.13' and python_version >= '3.8'"
@@ -651,7 +651,7 @@ class X509Name:
651
651
  value = value.encode("utf-8")
652
652
 
653
653
  add_result = _lib.X509_NAME_add_entry_by_NID(
654
- self._name, nid, _lib.MBSTRING_UTF8, value, -1, -1, 0
654
+ self._name, nid, _lib.MBSTRING_UTF8, value, len(value), -1, 0
655
655
  )
656
656
  if not add_result:
657
657
  _raise_current_error()
@@ -17,7 +17,7 @@ __all__ = [
17
17
  "__version__",
18
18
  ]
19
19
 
20
- __version__ = "26.0.0"
20
+ __version__ = "26.1.0"
21
21
 
22
22
  __title__ = "pyOpenSSL"
23
23
  __uri__ = "https://pyopenssl.org/"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyOpenSSL
3
- Version: 26.0.0
3
+ Version: 26.1.0
4
4
  Summary: Python wrapper module around the OpenSSL library
5
5
  Home-page: https://pyopenssl.org/
6
6
  Author: The pyOpenSSL developers
@@ -27,7 +27,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
27
  Classifier: Topic :: System :: Networking
28
28
  Requires-Python: >=3.8
29
29
  License-File: LICENSE
30
- Requires-Dist: cryptography<47,>=46.0.0
30
+ Requires-Dist: cryptography<48,>=46.0.0
31
31
  Requires-Dist: typing-extensions>=4.9; python_version < "3.13" and python_version >= "3.8"
32
32
  Provides-Extra: test
33
33
  Requires-Dist: pytest-rerunfailures; extra == "test"
@@ -96,6 +96,21 @@ You can also join ``#pyca`` on ``irc.libera.chat`` to ask questions or get invol
96
96
  Release Information
97
97
  ===================
98
98
 
99
+ 26.1.0 (2026-04-24)
100
+ -------------------
101
+
102
+ Backward-incompatible changes:
103
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104
+
105
+ Deprecations:
106
+ ^^^^^^^^^^^^^
107
+
108
+ Changes:
109
+ ^^^^^^^^
110
+
111
+ - Maximum supported ``cryptography`` version is now 47.x.
112
+ - Fixed ``X509Name`` field setters to correctly pass the value length to OpenSSL. Previously, values containing NUL bytes would be silently truncated, causing a divergence between the stored ASN.1 value and the value visible from Python. Credit to **BudongJW** for reporting the issue. **CVE-2026-40475**
113
+
99
114
  26.0.0 (2026-03-15)
100
115
  -------------------
101
116
 
@@ -1,4 +1,4 @@
1
- cryptography<47,>=46.0.0
1
+ cryptography<48,>=46.0.0
2
2
 
3
3
  [:python_version < "3.13" and python_version >= "3.8"]
4
4
  typing-extensions>=4.9
@@ -1403,6 +1403,14 @@ class TestX509Name:
1403
1403
  name.emailAddress = "quux@example.com"
1404
1404
  assert copy.emailAddress == "bar@example.com"
1405
1405
 
1406
+ def test_null_bytes_preserved(self) -> None:
1407
+ """
1408
+ Null bytes in X509Name field values are round-tripped correctly.
1409
+ """
1410
+ name = x509_name()
1411
+ name.CN = "a\x00b"
1412
+ assert name.CN == "a\x00b"
1413
+
1406
1414
  def test_repr(self) -> None:
1407
1415
  """
1408
1416
  `repr` passed an `X509Name` instance should return a string containing
@@ -1995,16 +2003,17 @@ class TestX509:
1995
2003
  current time plus the number of seconds passed in.
1996
2004
  """
1997
2005
  cert = load_certificate(FILETYPE_PEM, self.pemData)
1998
- not_before_min = utcnow().replace(microsecond=0) + timedelta(
1999
- seconds=100
2000
- )
2006
+ utc_now = utcnow().replace(microsecond=0)
2007
+ # -1 second tolerance for clock adjustments
2008
+ not_before_min = utc_now + timedelta(seconds=99)
2001
2009
  cert.gmtime_adj_notBefore(100)
2002
2010
  not_before_str = cert.get_notBefore()
2003
2011
  assert not_before_str is not None
2004
2012
  not_before = datetime.strptime(
2005
2013
  not_before_str.decode(), "%Y%m%d%H%M%SZ"
2006
2014
  )
2007
- not_before_max = utcnow() + timedelta(seconds=100)
2015
+ # +1 second tolerance for clock adjustments
2016
+ not_before_max = utc_now + timedelta(seconds=101)
2008
2017
  assert not_before_min <= not_before <= not_before_max
2009
2018
 
2010
2019
  def test_gmtime_adj_notAfter_wrong_args(self) -> None:
@@ -2023,14 +2032,15 @@ class TestX509:
2023
2032
  to be the current time plus the number of seconds passed in.
2024
2033
  """
2025
2034
  cert = load_certificate(FILETYPE_PEM, self.pemData)
2026
- not_after_min = utcnow().replace(microsecond=0) + timedelta(
2027
- seconds=100
2028
- )
2035
+ utc_now = utcnow().replace(microsecond=0)
2036
+ # -1 second tolerance for clock adjustments
2037
+ not_after_min = utc_now + timedelta(seconds=99)
2029
2038
  cert.gmtime_adj_notAfter(100)
2030
2039
  not_after_str = cert.get_notAfter()
2031
2040
  assert not_after_str is not None
2032
2041
  not_after = datetime.strptime(not_after_str.decode(), "%Y%m%d%H%M%SZ")
2033
- not_after_max = utcnow() + timedelta(seconds=100)
2042
+ # +1 second tolerance for clock adjustments
2043
+ not_after_max = utc_now + timedelta(seconds=101)
2034
2044
  assert not_after_min <= not_after <= not_after_max
2035
2045
 
2036
2046
  def test_has_expired(self) -> None:
@@ -4686,7 +4686,11 @@ class TestOCSP:
4686
4686
  Tests for PyOpenSSL's OCSP stapling support.
4687
4687
  """
4688
4688
 
4689
- sample_ocsp_data = b"this is totally ocsp data"
4689
+ # Minimal valid DER-encoded OCSPResponse with status "unauthorized"
4690
+ # (SEQUENCE { ENUMERATED 6 }). Required by OpenSSL 4.0+, which parses
4691
+ # the bytes via d2i_OCSP_RESPONSE before stapling and silently drops
4692
+ # unparseable input.
4693
+ sample_ocsp_data = b"\x30\x03\x0a\x01\x06"
4690
4694
 
4691
4695
  def _client_connection(
4692
4696
  self,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes