Skip to content

Commit

Permalink
bpo-43788: Generate version specific _ssl_data.h (pythonGH-25300) (py…
Browse files Browse the repository at this point in the history
…thonGH-25311)

(cherry picked from commit 150af75)

Co-authored-by: Christian Heimes <[email protected]>
  • Loading branch information
tiran authored and mcepl committed Apr 2, 2024
1 parent bb5b131 commit 170af1d
Show file tree
Hide file tree
Showing 7 changed files with 15,093 additions and 95 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The header files for :mod:`ssl` error codes are now OpenSSL
version-specific. Exceptions will now show correct reason and library
codes. The ``make_ssl_data.py`` script has been rewritten to use OpenSSL's
text file with error codes.
6 changes: 6 additions & 0 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ struct py_ssl_library_code {
};

/* Include generated data (error codes) */
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
#include "_ssl_data_300.h"
#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER)
#include "_ssl_data_111.h"
#else
#include "_ssl_data.h"
#endif

#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER)
# define OPENSSL_VERSION_1_1 1
Expand Down
Loading

0 comments on commit 170af1d

Please sign in to comment.