Skip to content

Commit c5e4ae0

Browse files
committed
pythongh-148600: Add Modules/_ssl_data_40.h data (python#148601)
The Modules/_ssl_data_40.h file was created with the commands: python Tools/ssl/multissltests.py --steps=library --base-directory "$PWD/multissl" --openssl '4.0.0' --system Linux python Tools/ssl/make_ssl_data.py multissl/src/openssl-4.0.0 Modules/_ssl_data_40.h Update Modules/_ssl.c to include it on OpenSSL 4.0.0 and newer. Update test_ssl for the new error message. (cherry picked from commit 70eb56b)
1 parent cf23df4 commit c5e4ae0

3 files changed

Lines changed: 9364 additions & 3 deletions

File tree

Lib/test/test_ssl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4432,7 +4432,9 @@ def cb_raising(ssl_sock, server_name, initial_context):
44324432
sni_name='supermessage')
44334433

44344434
# Allow for flexible libssl error messages.
4435-
regex = "(SSLV3_ALERT_HANDSHAKE_FAILURE|NO_PRIVATE_VALUE)"
4435+
regex = ("(TLS_ALERT_HANDSHAKE_FAILURE"
4436+
"|SSLV3_ALERT_HANDSHAKE_FAILURE"
4437+
"|NO_PRIVATE_VALUE)")
44364438
self.assertRegex(cm.exception.reason, regex)
44374439
self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError)
44384440

Modules/_ssl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ static void _PySSLFixErrno(void) {
121121
#endif
122122

123123
/* Include generated data (error codes) */
124-
/* See make_ssl_data.h for notes on adding a new version. */
125-
#if (OPENSSL_VERSION_NUMBER >= 0x30401000L)
124+
/* See Tools/ssl/make_ssl_data.py for notes on adding a new version. */
125+
#if (OPENSSL_VERSION_NUMBER >= 0x40000000L)
126+
# include "_ssl_data_40.h"
127+
#elif (OPENSSL_VERSION_NUMBER >= 0x30401000L)
126128
#include "_ssl_data_35.h"
127129
#elif (OPENSSL_VERSION_NUMBER >= 0x30100000L)
128130
#include "_ssl_data_340.h"

0 commit comments

Comments
 (0)