Skip to content

Commit 6a9bfee

Browse files
authored
gh-131423: Update OpenSSL data to 3.4.1 on Linux (#131618)
OpenSSL 3.4.1 mnemonics are not compatible with OpenSSL 3.4.0 ones since they were renumbered [1, 2]. Consequently, `_ssl_data_34.h` is renamed to `_ssl_data_340.h` and `_ssl_data_34.h` now contains OpenSSL 3.4.1 mnemonics. We also refine the mnemonics that are selected, discarding those that are mnemonic-like but should not be used as such. More precisely, we remove the ERR_LIB_MASK and ERR_LIB_OFFSET entries from OpenSSL 1.1.1 data. [1]: openssl/openssl#26316 [2]: openssl/openssl#26388
1 parent 9cba148 commit 6a9bfee

File tree

9 files changed

+9432
-89
lines changed

9 files changed

+9432
-89
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ jobs:
264264
fail-fast: false
265265
matrix:
266266
os: [ubuntu-24.04]
267-
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2, 3.4.0]
267+
openssl_ver: [3.0.16, 3.1.8, 3.2.4, 3.3.3, 3.4.1]
268268
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
269269
env:
270270
OPENSSL_VER: ${{ matrix.openssl_ver }}
@@ -331,7 +331,7 @@ jobs:
331331
needs: build-context
332332
if: needs.build-context.outputs.run-tests == 'true'
333333
env:
334-
OPENSSL_VER: 3.0.15
334+
OPENSSL_VER: 3.0.16
335335
PYTHONSTRICTEXTENSIONBUILD: 1
336336
steps:
337337
- uses: actions/checkout@v4
@@ -450,7 +450,7 @@ jobs:
450450
matrix:
451451
os: [ubuntu-24.04]
452452
env:
453-
OPENSSL_VER: 3.0.15
453+
OPENSSL_VER: 3.0.16
454454
PYTHONSTRICTEXTENSIONBUILD: 1
455455
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
456456
steps:

Doc/using/configure.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Features and minimum versions required to build CPython:
2222

2323
* Support for threads.
2424

25-
* OpenSSL 1.1.1 is the minimum version and OpenSSL 3.0.9 is the recommended
25+
* OpenSSL 1.1.1 is the minimum version and OpenSSL 3.0.16 is the recommended
2626
minimum version for the :mod:`ssl` and :mod:`hashlib` extension modules.
2727

2828
* SQLite 3.15.2 for the :mod:`sqlite3` extension module.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:mod:`ssl` can show descriptions for errors added in OpenSSL 3.4.1.
2+
Patch by Bénédikt Tran.

Modules/_ssl.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ static void _PySSLFixErrno(void) {
121121

122122
/* Include generated data (error codes) */
123123
/* See make_ssl_data.h for notes on adding a new version. */
124-
#if (OPENSSL_VERSION_NUMBER >= 0x30100000L)
124+
#if (OPENSSL_VERSION_NUMBER >= 0x30401000L)
125125
#include "_ssl_data_34.h"
126+
#elif (OPENSSL_VERSION_NUMBER >= 0x30100000L)
127+
#include "_ssl_data_340.h"
126128
#elif (OPENSSL_VERSION_NUMBER >= 0x30000000L)
127129
#include "_ssl_data_300.h"
128130
#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L)

Modules/_ssl_data_111.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* File generated by Tools/ssl/make_ssl_data.py */
2-
/* Generated on 2024-11-27T12:48:46.194048+00:00 */
2+
/* Generated on 2025-03-26T13:48:34.811613+00:00 */
33
/* Generated from Git commit OpenSSL_1_1_1w-0-ge04bd3433f */
4+
5+
/* generated from args.lib2errnum */
46
static struct py_ssl_library_code library_codes[] = {
57
#ifdef ERR_LIB_ASN1
68
{"ASN1", ERR_LIB_ASN1},
@@ -137,10 +139,10 @@ static struct py_ssl_library_code library_codes[] = {
137139
#ifdef ERR_LIB_X509V3
138140
{"X509V3", ERR_LIB_X509V3},
139141
#endif
140-
{ NULL }
142+
{NULL, 0} /* sentinel */
141143
};
142144

143-
145+
/* generated from args.reasons */
144146
static struct py_ssl_error_code error_codes[] = {
145147
#ifdef ASN1_R_ADDING_OBJECT
146148
{"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT},
@@ -6537,6 +6539,5 @@ static struct py_ssl_error_code error_codes[] = {
65376539
#else
65386540
{"WRONG_TYPE", 11, 122},
65396541
#endif
6540-
{ NULL }
6542+
{NULL, 0, 0} /* sentinel */
65416543
};
6542-

Modules/_ssl_data_34.h

+18-28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* File generated by Tools/ssl/make_ssl_data.py */
2-
/* Generated on 2024-11-27T12:35:52.276767+00:00 */
3-
/* Generated from Git commit openssl-3.4.0-0-g98acb6b028 */
2+
/* Generated on 2025-03-26T13:47:34.223146+00:00 */
3+
/* Generated from Git commit openssl-3.4.1-0-ga26d85337d */
4+
5+
/* generated from args.lib2errnum */
46
static struct py_ssl_library_code library_codes[] = {
57
#ifdef ERR_LIB_ASN1
68
{"ASN1", ERR_LIB_ASN1},
@@ -80,9 +82,6 @@ static struct py_ssl_library_code library_codes[] = {
8082
#ifdef ERR_LIB_KDF
8183
{"KDF", ERR_LIB_KDF},
8284
#endif
83-
#ifdef ERR_LIB_MASK
84-
{"MASK", ERR_LIB_MASK},
85-
#endif
8685
#ifdef ERR_LIB_METH
8786
{"METH", ERR_LIB_METH},
8887
#endif
@@ -95,9 +94,6 @@ static struct py_ssl_library_code library_codes[] = {
9594
#ifdef ERR_LIB_OCSP
9695
{"OCSP", ERR_LIB_OCSP},
9796
#endif
98-
#ifdef ERR_LIB_OFFSET
99-
{"OFFSET", ERR_LIB_OFFSET},
100-
#endif
10197
#ifdef ERR_LIB_OSSL_DECODER
10298
{"OSSL_DECODER", ERR_LIB_OSSL_DECODER},
10399
#endif
@@ -167,10 +163,10 @@ static struct py_ssl_library_code library_codes[] = {
167163
#ifdef ERR_LIB_X509V3
168164
{"X509V3", ERR_LIB_X509V3},
169165
#endif
170-
{ NULL }
166+
{NULL, 0} /* sentinel */
171167
};
172168

173-
169+
/* generated from args.reasons */
174170
static struct py_ssl_error_code error_codes[] = {
175171
#ifdef ASN1_R_ADDING_OBJECT
176172
{"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT},
@@ -1762,6 +1758,11 @@ static struct py_ssl_error_code error_codes[] = {
17621758
#else
17631759
{"ERROR_SETTING_RECIPIENTINFO", 46, 116},
17641760
#endif
1761+
#ifdef CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT
1762+
{"ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT},
1763+
#else
1764+
{"ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT", 46, 196},
1765+
#endif
17651766
#ifdef CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR
17661767
{"ESS_SIGNING_CERTID_MISMATCH_ERROR", ERR_LIB_CMS, CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR},
17671768
#else
@@ -2122,25 +2123,15 @@ static struct py_ssl_error_code error_codes[] = {
21222123
#else
21232124
{"BROTLI_DECODE_ERROR", 41, 102},
21242125
#endif
2125-
#ifdef COMP_R_BROTLI_DEFLATE_ERROR
2126-
{"BROTLI_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_BROTLI_DEFLATE_ERROR},
2127-
#else
2128-
{"BROTLI_DEFLATE_ERROR", 41, 103},
2129-
#endif
21302126
#ifdef COMP_R_BROTLI_ENCODE_ERROR
21312127
{"BROTLI_ENCODE_ERROR", ERR_LIB_COMP, COMP_R_BROTLI_ENCODE_ERROR},
21322128
#else
2133-
{"BROTLI_ENCODE_ERROR", 41, 106},
2134-
#endif
2135-
#ifdef COMP_R_BROTLI_INFLATE_ERROR
2136-
{"BROTLI_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_BROTLI_INFLATE_ERROR},
2137-
#else
2138-
{"BROTLI_INFLATE_ERROR", 41, 104},
2129+
{"BROTLI_ENCODE_ERROR", 41, 103},
21392130
#endif
21402131
#ifdef COMP_R_BROTLI_NOT_SUPPORTED
21412132
{"BROTLI_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_BROTLI_NOT_SUPPORTED},
21422133
#else
2143-
{"BROTLI_NOT_SUPPORTED", 41, 105},
2134+
{"BROTLI_NOT_SUPPORTED", 41, 104},
21442135
#endif
21452136
#ifdef COMP_R_ZLIB_DEFLATE_ERROR
21462137
{"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR},
@@ -2160,22 +2151,22 @@ static struct py_ssl_error_code error_codes[] = {
21602151
#ifdef COMP_R_ZSTD_COMPRESS_ERROR
21612152
{"ZSTD_COMPRESS_ERROR", ERR_LIB_COMP, COMP_R_ZSTD_COMPRESS_ERROR},
21622153
#else
2163-
{"ZSTD_COMPRESS_ERROR", 41, 107},
2154+
{"ZSTD_COMPRESS_ERROR", 41, 105},
21642155
#endif
21652156
#ifdef COMP_R_ZSTD_DECODE_ERROR
21662157
{"ZSTD_DECODE_ERROR", ERR_LIB_COMP, COMP_R_ZSTD_DECODE_ERROR},
21672158
#else
2168-
{"ZSTD_DECODE_ERROR", 41, 108},
2159+
{"ZSTD_DECODE_ERROR", 41, 106},
21692160
#endif
21702161
#ifdef COMP_R_ZSTD_DECOMPRESS_ERROR
21712162
{"ZSTD_DECOMPRESS_ERROR", ERR_LIB_COMP, COMP_R_ZSTD_DECOMPRESS_ERROR},
21722163
#else
2173-
{"ZSTD_DECOMPRESS_ERROR", 41, 109},
2164+
{"ZSTD_DECOMPRESS_ERROR", 41, 107},
21742165
#endif
21752166
#ifdef COMP_R_ZSTD_NOT_SUPPORTED
21762167
{"ZSTD_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZSTD_NOT_SUPPORTED},
21772168
#else
2178-
{"ZSTD_NOT_SUPPORTED", 41, 110},
2169+
{"ZSTD_NOT_SUPPORTED", 41, 108},
21792170
#endif
21802171
#ifdef CONF_R_ERROR_LOADING_DSO
21812172
{"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO},
@@ -9272,6 +9263,5 @@ static struct py_ssl_error_code error_codes[] = {
92729263
#else
92739264
{"WRONG_TYPE", 11, 122},
92749265
#endif
9275-
{ NULL }
9266+
{NULL, 0, 0} /* sentinel */
92769267
};
9277-

0 commit comments

Comments
 (0)