Skip to content

Commit

Permalink
[3.8] bpo-43788: Generate version specific _ssl_data.h (GH-25300) (GH…
Browse files Browse the repository at this point in the history
…-25311)

(cherry picked from commit 150af75)

Co-authored-by: Christian Heimes <[email protected]>
  • Loading branch information
tiran authored Apr 9, 2021
1 parent e18ebd9 commit 70f2ca7
Show file tree
Hide file tree
Showing 7 changed files with 15,092 additions and 83 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 @@ -137,7 +137,13 @@ static void _PySSLFixErrno(void) {
#endif

/* 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 70f2ca7

Please sign in to comment.