mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-03 22:01:39 +00:00
Create py314-ossl4.diff
Temp patch to allow Python 3.14 to use OpenSSL 4
This commit is contained in:
67
src/tools/py314-ossl4.diff
Normal file
67
src/tools/py314-ossl4.diff
Normal file
@@ -0,0 +1,67 @@
|
||||
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
|
||||
index 1235eff72f7..f68e34b7560 100644
|
||||
--- a/Modules/_ssl.c
|
||||
+++ b/Modules/_ssl.c
|
||||
@@ -134,6 +134,17 @@ static void _PySSLFixErrno(void) {
|
||||
#error Unsupported OpenSSL version
|
||||
#endif
|
||||
|
||||
+#if (OPENSSL_VERSION_NUMBER >= 0x40000000L)
|
||||
+# define OPENSSL_NO_SSL3
|
||||
+# define OPENSSL_NO_TLS1
|
||||
+# define OPENSSL_NO_TLS1_1
|
||||
+# define OPENSSL_NO_TLS1_2
|
||||
+# define OPENSSL_NO_SSL3_METHOD
|
||||
+# define OPENSSL_NO_TLS1_METHOD
|
||||
+# define OPENSSL_NO_TLS1_1_METHOD
|
||||
+# define OPENSSL_NO_TLS1_2_METHOD
|
||||
+#endif
|
||||
+
|
||||
/* OpenSSL API 1.1.0+ does not include version methods */
|
||||
#ifndef OPENSSL_NO_SSL3_METHOD
|
||||
extern const SSL_METHOD *SSLv3_method(void);
|
||||
@@ -1133,7 +1144,7 @@ _asn1obj2py(_sslmodulestate *state, const ASN1_OBJECT *name, int no_name)
|
||||
|
||||
static PyObject *
|
||||
_create_tuple_for_attribute(_sslmodulestate *state,
|
||||
- ASN1_OBJECT *name, ASN1_STRING *value)
|
||||
+ const ASN1_OBJECT *name, const ASN1_STRING *value)
|
||||
{
|
||||
Py_ssize_t buflen;
|
||||
PyObject *pyattr;
|
||||
@@ -1162,16 +1173,16 @@ _create_tuple_for_attribute(_sslmodulestate *state,
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
-_create_tuple_for_X509_NAME (_sslmodulestate *state, X509_NAME *xname)
|
||||
+_create_tuple_for_X509_NAME (_sslmodulestate *state, const X509_NAME *xname)
|
||||
{
|
||||
PyObject *dn = NULL; /* tuple which represents the "distinguished name" */
|
||||
PyObject *rdn = NULL; /* tuple to hold a "relative distinguished name" */
|
||||
PyObject *rdnt;
|
||||
PyObject *attr = NULL; /* tuple to hold an attribute */
|
||||
int entry_count = X509_NAME_entry_count(xname);
|
||||
- X509_NAME_ENTRY *entry;
|
||||
- ASN1_OBJECT *name;
|
||||
- ASN1_STRING *value;
|
||||
+ const X509_NAME_ENTRY *entry;
|
||||
+ const ASN1_OBJECT *name;
|
||||
+ const ASN1_STRING *value;
|
||||
int index_counter;
|
||||
int rdn_level = -1;
|
||||
int retcode;
|
||||
@@ -6506,9 +6517,15 @@ sslmodule_init_constants(PyObject *m)
|
||||
ADD_INT_CONST("PROTOCOL_TLS", PY_SSL_VERSION_TLS);
|
||||
ADD_INT_CONST("PROTOCOL_TLS_CLIENT", PY_SSL_VERSION_TLS_CLIENT);
|
||||
ADD_INT_CONST("PROTOCOL_TLS_SERVER", PY_SSL_VERSION_TLS_SERVER);
|
||||
+#ifndef OPENSSL_NO_TLS1
|
||||
ADD_INT_CONST("PROTOCOL_TLSv1", PY_SSL_VERSION_TLS1);
|
||||
+#endif
|
||||
+#ifndef OPENSSL_NO_TLS1_1
|
||||
ADD_INT_CONST("PROTOCOL_TLSv1_1", PY_SSL_VERSION_TLS1_1);
|
||||
+#endif
|
||||
+#ifndef OPENSSL_NO_TLS1_2
|
||||
ADD_INT_CONST("PROTOCOL_TLSv1_2", PY_SSL_VERSION_TLS1_2);
|
||||
+#endif
|
||||
|
||||
#define ADD_OPTION(NAME, VALUE) if (sslmodule_add_option(m, NAME, (VALUE)) < 0) return -1
|
||||
Reference in New Issue
Block a user