Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
python/2.7: drop CRYPTO_THREADID stuff
To:
ports@openbsd.org
Cc:
kmos@openbsd.org
Date:
Mon, 23 Jun 2025 16:08:24 +0200

Download raw body.

Thread
I want to drop this API from libcrypto (it doesn't do anything anyway).
Here's a diff to remove it.

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/python/2.7/Makefile,v
diff -u -p -r1.82 Makefile
--- Makefile	21 Dec 2024 11:32:44 -0000	1.82
+++ Makefile	7 May 2025 07:25:09 -0000
@@ -8,7 +8,7 @@ SHARED_LIBS =		python2.7 0.0
 VERSION_SPEC =		>=2.7,<2.8
 PORTROACH =		limit:^2\.7
 
-REVISION-main =		12
+REVISION-main =		13
 REVISION-idle =		1
 REVISION-tests =	1
 REVISION-bsddb =	0
Index: files/CHANGES.OpenBSD
===================================================================
RCS file: /cvs/ports/lang/python/2.7/files/CHANGES.OpenBSD,v
diff -u -p -r1.8 CHANGES.OpenBSD
--- files/CHANGES.OpenBSD	24 Mar 2024 09:38:44 -0000	1.8
+++ files/CHANGES.OpenBSD	7 May 2025 07:25:00 -0000
@@ -10,5 +10,7 @@ of changes made to this version of Pytho
 4.  ERR_get_state is no longer called, it is not used in OpenSSL 3.0 or
     libressl as of 20240303
 
+5.  Removed calls to the CRYPTO_THREADID noops.
+
 These changes are available in the OpenBSD CVS repository
 <http://www.openbsd.org/anoncvs.html> in ports/lang/python/2.7.
Index: patches/patch-Modules__ssl_c
===================================================================
RCS file: /cvs/ports/lang/python/2.7/patches/patch-Modules__ssl_c,v
diff -u -p -r1.11 patch-Modules__ssl_c
--- patches/patch-Modules__ssl_c	3 Mar 2024 12:52:08 -0000	1.11
+++ patches/patch-Modules__ssl_c	7 May 2025 20:58:29 -0000
@@ -3,6 +3,8 @@ what python's lock protects
 
 #2: ERR_get_state is no longer used in OpenSSL 3.0 or libressl as of 20240303
 
+#3, #4: Drop noops
+
 Index: Modules/_ssl.c
 --- Modules/_ssl.c.orig
 +++ Modules/_ssl.c
@@ -24,3 +26,31 @@ Index: Modules/_ssl.c
      ERR_clear_error();
  
      PySSL_BEGIN_ALLOW_THREADS
+@@ -4078,15 +4080,7 @@ static PyMethodDef PySSL_methods[] = {
+ 
+ static PyThread_type_lock *_ssl_locks = NULL;
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10000000
+-/* use new CRYPTO_THREADID API. */
+-static void
+-_ssl_threadid_callback(CRYPTO_THREADID *id)
+-{
+-    CRYPTO_THREADID_set_numeric(id,
+-                                (unsigned long)PyThread_get_thread_ident());
+-}
+-#else
++#if OPENSSL_VERSION_NUMBER < 0x10000000
+ /* deprecated CRYPTO_set_id_callback() API. */
+ static unsigned long
+ _ssl_thread_id_function (void) {
+@@ -4146,9 +4140,7 @@ static int _setup_ssl_threads(void) {
+             }
+         }
+         CRYPTO_set_locking_callback(_ssl_thread_locking_function);
+-#if OPENSSL_VERSION_NUMBER >= 0x10000000
+-        CRYPTO_THREADID_set_callback(_ssl_threadid_callback);
+-#else
++#if OPENSSL_VERSION_NUMBER < 0x10000000
+         CRYPTO_set_id_callback(_ssl_thread_id_function);
+ #endif
+     }