[packages/cryptlib] Rel 7

arekm arekm at pld-linux.org
Thu May 21 14:53:56 CEST 2026


commit 5b92642dd974397cc657788c46558f0138bcfbbd
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu May 21 14:53:37 2026 +0200

    Rel 7

 cryptlib-soname.patch               |  24 ++++-----
 cryptlib.spec                       |   6 ++-
 pthread_yield.patch                 |  23 +++++++++
 python-bindings-pointer-types.patch | 100 ++++++++++++++++++++++++++++++++++++
 4 files changed, 140 insertions(+), 13 deletions(-)
---
diff --git a/cryptlib.spec b/cryptlib.spec
index 6af17d0..6f4f371 100644
--- a/cryptlib.spec
+++ b/cryptlib.spec
@@ -6,7 +6,7 @@ Summary:	Peter Gutmann's general purpose encryption library
 Summary(pl.UTF-8):	Biblioteka kryptograficzna ogólnego przeznaczenia Petera Gutmanna
 Name:		cryptlib
 Version:	3.3.3
-Release:	6
+Release:	7
 License:	sleepycat
 Group:		Libraries
 Source0:	ftp://ftp.franken.de/pub/crypt/cryptlib/cl%{_ver}.zip
@@ -16,6 +16,8 @@ Patch1:		%{name}-soname.patch
 Patch2:		optflags.patch
 Patch3:		x32.patch
 Patch4:		format-security.patch
+Patch5:		python-bindings-pointer-types.patch
+Patch6:		pthread_yield.patch
 URL:		http://www.cs.auckland.ac.nz/~pgut001/cryptlib/
 BuildRequires:	rpmbuild(macros) >= 1.710
 BuildRequires:	python-devel >= 1:2.5
@@ -91,6 +93,8 @@ unzip -q -L -a %{SOURCE0}
 %patch -P2 -p1
 %patch -P3 -p1
 %patch -P4 -p1
+%patch -P5 -p1
+%patch -P6 -p1
 
 %build
 %{__make} \
diff --git a/cryptlib-soname.patch b/cryptlib-soname.patch
index 58064fd..94be6c8 100644
--- a/cryptlib-soname.patch
+++ b/cryptlib-soname.patch
@@ -1,5 +1,5 @@
---- cryptlib-3.3.1/tools/buildall.sh~	2008-06-30 19:31:02.000000000 +0200
-+++ cryptlib-3.3.1/tools/buildall.sh	2009-09-03 13:05:48.696867244 +0200
+--- cryptlib-3.3.3/tools/buildall.sh	2008-06-30 19:31:02.000000000 +0200
++++ cryptlib-3.3.3/tools/buildall.sh	2026-05-20 23:39:34.038614227 +0200
 @@ -31,7 +31,7 @@
  
  MAJ="3"
@@ -9,9 +9,9 @@
  PROJ="cl"
  SHARED_OBJ_PATH="./shared-obj/"
  if [ $OSNAME = "Darwin" ] ; then
---- cryptlib-3.3.1/tools/buildsharedlib.sh.orig	2006-11-14 04:48:16.000000000 +0100
-+++ cryptlib-3.3.1/tools/buildsharedlib.sh	2008-01-08 19:51:52.529507506 +0100
-@@ -63,6 +63,8 @@ fi
+--- cryptlib-3.3.3/tools/buildsharedlib.sh	2008-01-17 19:05:12.000000000 +0100
++++ cryptlib-3.3.3/tools/buildsharedlib.sh	2026-05-20 23:39:34.106430057 +0200
+@@ -63,6 +63,8 @@
  OSNAME=$1
  LIBNAME=$2
  LD=$3
@@ -20,7 +20,7 @@
  shift
  shift
  shift
-@@ -97,6 +99,9 @@ case $OSNAME in
+@@ -112,6 +114,9 @@
  		fi
  		strip $LIBNAME ;;
  
@@ -28,11 +28,11 @@
 +		$LD -shared -o $LIBNAME `cat $LINKFILE` `./tools/getlibs.sh autodetect` -Wl,-soname=${SONAME:-${LIBNAME}}
 +		;;
  	*)
- 		$LD -shared -o $LIBNAME `cat $LINKFILE` `./tools/getlibs.sh autodetect` ;
- 		strip $LIBNAME ;;
---- cryptlib-3.3.1/makefile.orig	2008-01-08 19:54:03.372389284 +0100
-+++ cryptlib-3.3.1/makefile	2008-01-08 19:53:33.007613619 +0100
-@@ -36,6 +36,7 @@
+ 		if [ `$LD -v 2>&1 | grep -c gcc` -gt 0 -a \
+ 			`gcc -Wl,-Bsymbolic 2>&1 | grep -c unrecognized` = 0 ] ; then
+--- cryptlib-3.3.3/makefile	2009-07-21 01:02:22.000000000 +0200
++++ cryptlib-3.3.3/makefile	2026-05-20 23:39:34.184706510 +0200
+@@ -39,6 +39,7 @@
  PROJ	= cl
  LIBNAME	= lib$(PROJ).a
  SLIBNAME = lib$(PROJ).so.$(MAJ).$(MIN).$(PLV)
@@ -40,7 +40,7 @@
  DYLIBNAME = lib$(PROJ).$(MAJ).$(MIN).dylib
  
  # Compiler options.  By default this builds the release version of the code,
-@@ -1200,7 +1201,7 @@
+@@ -1403,7 +1404,7 @@
  
  
  $(SLIBNAME):	$(OBJS) $(EXTRAOBJS) $(TESTOBJS)
diff --git a/pthread_yield.patch b/pthread_yield.patch
new file mode 100644
index 0000000..7f53174
--- /dev/null
+++ b/pthread_yield.patch
@@ -0,0 +1,23 @@
+pthread_yield() was removed from glibc in 2.34; use sched_yield() on Linux to
+match every other modern target in this file.
+--- cryptlib-3.3.3/kernel/thread.h.orig
++++ cryptlib-3.3.3/kernel/thread.h
+@@ -1733,7 +1733,7 @@
+ 	#define THREAD_YIELD()		sched_yield()
+   #endif /* Slowaris 5.7 / 7.x or newer */
+ #elif defined( _AIX ) || defined( __CYGWIN__ ) || \
+-	  ( defined( __hpux ) && ( OSVERSION >= 11 ) ) || \
++	  ( defined( __hpux ) && ( OSVERSION >= 11 ) ) || defined( __linux__ ) || \
+ 	  defined( __NetBSD__ ) || defined( __QNX__ ) || defined( __UCLIBC__ )
+   #define THREAD_YIELD()		sched_yield()
+ #elif defined( __XMK__ )
+@@ -1742,9 +1742,6 @@
+ 	 underlying process context should yield the associated thread */
+   #define THREAD_YIELD()		yield()
+ #else
+-  #if defined( __linux__ ) && !defined( __USE_GNU )
+-	void pthread_yield( void );
+-  #endif /* Present but not prototyped unless GNU extensions are enabled */
+   #define  THREAD_YIELD()		pthread_yield()
+ #endif /* Not-very-portable Posix portability */
+ #define THREAD_SLEEP( ms )		{ \
diff --git a/python-bindings-pointer-types.patch b/python-bindings-pointer-types.patch
new file mode 100644
index 0000000..64b4bfa
--- /dev/null
+++ b/python-bindings-pointer-types.patch
@@ -0,0 +1,100 @@
+Cast at the Python C-API boundary: PyObject_AsWriteBuffer/AsCharBuffer want
+void**/const char** for the buffer and Py_ssize_t* for the length, while the
+local helpers expose unsigned char**/int*. Modern gcc rejects the implicit
+conversions; bridge them with local Py_ssize_t variables and explicit casts.
+The string helpers also use unsigned char** so callers like name/keyID/password
+buffers compile without casts.
+--- cryptlib-3.3.3/bindings/python.c.orig
++++ cryptlib-3.3.3/bindings/python.c
+@@ -10,6 +10,7 @@ static PyObject *CryptException;
+
+ static int getPointerWrite(PyObject* objPtr, unsigned char** bytesPtrPtr, int* lengthPtr)
+ {
++    Py_ssize_t pyLength = 0;
+     if (objPtr == Py_None)
+     {
+         *bytesPtrPtr = NULL;
+@@ -18,13 +19,15 @@ static int getPointerWrite(PyObject* objPtr, unsigned char** bytesPtrPtr, int* l
+     }
+
+     /*See if it's an array object*/
+-    if (PyObject_AsWriteBuffer(objPtr, bytesPtrPtr, lengthPtr) == -1)
++    if (PyObject_AsWriteBuffer(objPtr, (void**)bytesPtrPtr, &pyLength) == -1)
+         return 0;
++    *lengthPtr = (int)pyLength;
+     return 1;
+ }
+
+ static int getPointerRead(PyObject* objPtr, unsigned char** bytesPtrPtr, int* lengthPtr)
+ {
++    Py_ssize_t pyLength = 0;
+     if (objPtr == Py_None)
+     {
+         *bytesPtrPtr = NULL;
+@@ -33,15 +36,16 @@ static int getPointerRead(PyObject* objPtr, unsigned char** bytesPtrPtr, int* le
+     }
+
+     /*See if it's an array object*/
+-    if (PyObject_AsWriteBuffer(objPtr, bytesPtrPtr, lengthPtr) == -1)
++    if (PyObject_AsWriteBuffer(objPtr, (void**)bytesPtrPtr, &pyLength) == -1)
+     {
+         PyErr_Clear();
+         /*See if it's a string object*/
+         /*This returns the length excluding the NULL if it's a string,
+           which is what we want*/
+-        if (PyObject_AsCharBuffer(objPtr, bytesPtrPtr, lengthPtr) == -1)
++        if (PyObject_AsCharBuffer(objPtr, (const char**)bytesPtrPtr, &pyLength) == -1)
+             return 0;
+     }
++    *lengthPtr = (int)pyLength;
+     return 1;
+ }
+
+@@ -67,9 +71,10 @@ static int getPointerWriteCheckIndices(PyObject* objPtr, unsigned char** bytesPt
+     return 1;
+ }
+
+-static int getPointerReadString(PyObject* objPtr, char** charPtrPtr)
++static int getPointerReadString(PyObject* objPtr, unsigned char** charPtrPtr)
+ {
+-    int length = 0;
++    Py_ssize_t length = 0;
++    unsigned char* tmpPtr = NULL;
+     char* newPtr = NULL;
+
+     if (objPtr == Py_None)
+@@ -79,11 +84,11 @@ static int getPointerReadString(PyObject* objPtr, char** charPtrPtr)
+     }
+
+     /*See if it's a string or a buffer object*/
+-    if (PyObject_AsCharBuffer(objPtr, charPtrPtr, &length) == -1)
++    if (PyObject_AsCharBuffer(objPtr, (const char**)&tmpPtr, &length) == -1)
+     {
+         /*See if it's an array*/
+         PyErr_Clear();
+-        if (PyObject_AsWriteBuffer(objPtr, charPtrPtr, &length) == -1)
++        if (PyObject_AsWriteBuffer(objPtr, (void**)&tmpPtr, &length) == -1)
+             return 0;
+     }
+     /*This code isn't necessary for a string, but it is for arrays and buffers,
+@@ -96,9 +101,9 @@ static int getPointerReadString(PyObject* objPtr, char** charPtrPtr)
+         PyErr_NoMemory();
+         return 0;
+     }
+-    memcpy(newPtr, *charPtrPtr, length);
++    memcpy(newPtr, tmpPtr, length);
+     newPtr[length] = 0;
+-    *charPtrPtr = newPtr;
++    *charPtrPtr = (unsigned char*)newPtr;
+     return 1;
+ }
+
+@@ -106,7 +111,7 @@ static void releasePointer(PyObject* objPtr, unsigned char* bytesPtr)
+ {
+ }
+
+-static void releasePointerString(PyObject* objPtr, char* charPtr)
++static void releasePointerString(PyObject* objPtr, unsigned char* charPtr)
+ {
+     free(charPtr);
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cryptlib.git/commitdiff/5b92642dd974397cc657788c46558f0138bcfbbd



More information about the pld-cvs-commit mailing list