File tree 3 files changed +32
-2
lines changed
3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,21 @@ Deprecations:
16
16
Changes:
17
17
^^^^^^^^
18
18
19
+ 23.1.1 (2023-03-28)
20
+ -------------------
21
+
22
+ Backward-incompatible changes:
23
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
+
25
+ Deprecations:
26
+ ^^^^^^^^^^^^^
27
+
28
+ Changes:
29
+ ^^^^^^^^
30
+
31
+ - Worked around an issue in OpenSSL 3.1.0 which caused `X509Extension.get_short_name ` to raise an exception when no short name was known to OpenSSL.
32
+ `#1204 <https://github.com/pyca/pyopenssl/pull/1204 >`_.
33
+
19
34
23.1.0 (2023-03-24)
20
35
-------------------
21
36
@@ -56,7 +71,7 @@ Backward-incompatible changes:
56
71
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57
72
58
73
- Remove support for SSLv2 and SSLv3.
59
- - The minimum ``cryptography `` version is now 38.0.x (and we now pin releases
74
+ - The minimum ``cryptography `` version is now 38.0.x (and we now pin releases
60
75
against ``cryptography `` major versions to prevent future breakage)
61
76
- The ``OpenSSL.crypto.X509StoreContextError `` exception has been refactored,
62
77
changing its internal attributes.
Original file line number Diff line number Diff line change @@ -904,7 +904,14 @@ def get_short_name(self) -> bytes:
904
904
"""
905
905
obj = _lib .X509_EXTENSION_get_object (self ._extension )
906
906
nid = _lib .OBJ_obj2nid (obj )
907
- return _ffi .string (_lib .OBJ_nid2sn (nid ))
907
+ # OpenSSL 3.1.0 has a bug where nid2sn returns NULL for NIDs that
908
+ # previously returned UNDEF. This is a workaround for that issue.
909
+ # https://github.com/openssl/openssl/commit/908ba3ed9adbb3df90f76
910
+ buf = _lib .OBJ_nid2sn (nid )
911
+ if buf != _ffi .NULL :
912
+ return _ffi .string (buf )
913
+ else :
914
+ return b"UNDEF"
908
915
909
916
def get_data (self ) -> bytes :
910
917
"""
Original file line number Diff line number Diff line change @@ -1681,6 +1681,14 @@ def test_get_extensions(self):
1681
1681
exts = request .get_extensions ()
1682
1682
assert len (exts ) == 2
1683
1683
1684
+ def test_undef_oid (self ):
1685
+ assert (
1686
+ X509Extension (
1687
+ b"1.2.3.4.5.6.7" , False , b"DER:05:00"
1688
+ ).get_short_name ()
1689
+ == b"UNDEF"
1690
+ )
1691
+
1684
1692
def test_add_extensions_wrong_args (self ):
1685
1693
"""
1686
1694
`X509Req.add_extensions` raises `TypeError` if called with a
You can’t perform that action at this time.
0 commit comments