[packages/cryptlib] Up to 3.4.9.6

arekm arekm at pld-linux.org
Sat Nov 28 18:23:23 CET 2026


commit 88d81e14c4cfe0a778052b47444dd39e31bb8277
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Nov 27 17:30:51 2026 +0100

    Up to 3.4.9.6

 cryptlib-rdtsc.patch                |  11 ----
 cryptlib-soname.patch               |  51 ------------------
 cryptlib.spec                       |  53 ++++++++-----------
 format-security.patch               |  11 ----
 getcompiler.patch                   |  16 ++++++
 optflags.patch                      |  15 ------
 pthread_yield.patch                 |  23 ---------
 python-bindings-pointer-types.patch | 100 ------------------------------------
 x32.patch                           |  20 --------
 9 files changed, 38 insertions(+), 262 deletions(-)
---
diff --git a/cryptlib.spec b/cryptlib.spec
index 6f4f371..f69e693 100644
--- a/cryptlib.spec
+++ b/cryptlib.spec
@@ -1,31 +1,27 @@
 #
-%define		libver	3.3.3
+%define		libver	3.4.9
+%define		sover	3.4
 #
-%define		_ver	%(echo %{version} | tr -d .)
 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:	7
+Version:	3.4.9.6
+Release:	1
 License:	sleepycat
 Group:		Libraries
-Source0:	ftp://ftp.franken.de/pub/crypt/cryptlib/cl%{_ver}.zip
-# Source0-md5:	afdb94894f7f798702703f4a95a2e7ac
-Patch0:		%{name}-rdtsc.patch
-Patch1:		%{name}-soname.patch
-Patch2:		optflags.patch
-Patch3:		x32.patch
-Patch4:		format-security.patch
-Patch5:		python-bindings-pointer-types.patch
-Patch6:		pthread_yield.patch
+Source0:	https://github.com/cryptlib/cryptlib/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	0abf315ead4178aa91085ba5e1de4947
+Patch0:		getcompiler.patch
 URL:		http://www.cs.auckland.ac.nz/~pgut001/cryptlib/
-BuildRequires:	rpmbuild(macros) >= 1.710
+BuildRequires:	openldap-devel
 BuildRequires:	python-devel >= 1:2.5
 BuildRequires:	python-setuptools
 BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.710
 BuildRequires:	sed >= 4.0
-BuildRequires:	unzip
+BuildRequires:	unixODBC-devel
 BuildRequires:	which
+BuildRequires:	zlib-devel
 %pyrequires_eq  python-modules
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -86,37 +82,32 @@ Python bindings for cryptlib library.
 Wiązania języka Python do biblioteki cryptlib.
 
 %prep
-%setup -q -T -c
-unzip -q -L -a %{SOURCE0}
+%setup -q
 %patch -P0 -p1
-%patch -P1 -p1
-%patch -P2 -p1
-%patch -P3 -p1
-%patch -P4 -p1
-%patch -P5 -p1
-%patch -P6 -p1
 
 %build
+# ODBC and LDAP are dlopen()ed; TPM RNG would link libtspi, so autodetection is off
+export DISABLE_AUTODETECT=1
 %{__make} \
 %ifarch x32
-	OPTFLAGS="%{rpmcflags} -DOPENSSL_NO_ASM" \
+	XCFLAGS="%{rpmcflags} -DHAS_ODBC -DHAS_LDAP -DOPENSSL_NO_ASM" \
 %else
 %ifarch %{ix86}
-	OPTFLAGS="%{rpmcflags} -DUSE_ASM" \
+	XCFLAGS="%{rpmcflags} -DHAS_ODBC -DHAS_LDAP -DUSE_ASM" \
 %else
-	OPTFLAGS="%{rpmcflags}" \
+	XCFLAGS="%{rpmcflags} -DHAS_ODBC -DHAS_LDAP" \
 %endif
 %endif
 	CC="%{__cc}"
 
 %{__make} shared \
 %ifarch x32
-	OPTFLAGS="%{rpmcflags} -DOPENSSL_NO_ASM" \
+	XCFLAGS="%{rpmcflags} -DHAS_ODBC -DHAS_LDAP -DOPENSSL_NO_ASM" \
 %else
 %ifarch %{ix86}
-	OPTFLAGS="%{rpmcflags} -DUSE_ASM" \
+	XCFLAGS="%{rpmcflags} -DHAS_ODBC -DHAS_LDAP -DUSE_ASM" \
 %else
-	OPTFLAGS="%{rpmcflags}" \
+	XCFLAGS="%{rpmcflags} -DHAS_ODBC -DHAS_LDAP" \
 %endif
 %endif
 	CC="%{__cc}"
@@ -133,7 +124,7 @@ install -d $RPM_BUILD_ROOT{%{_libdir},%{_includedir},%{py_sitedir}}
 install cryptlib.h $RPM_BUILD_ROOT%{_includedir}
 install libcl.a $RPM_BUILD_ROOT%{_libdir}
 install libcl.so.%{libver} $RPM_BUILD_ROOT%{_libdir}
-ln -s libcl.so.%{libver} $RPM_BUILD_ROOT%{_libdir}/libcl.so.3
+ln -s libcl.so.%{libver} $RPM_BUILD_ROOT%{_libdir}/libcl.so.%{sover}
 ln -s libcl.so.%{libver} $RPM_BUILD_ROOT%{_libdir}/libcl.so
 
 cd bindings
@@ -148,7 +139,7 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libcl.so.%{libver}
-%attr(755,root,root) %ghost %{_libdir}/libcl.so.3
+%attr(755,root,root) %ghost %{_libdir}/libcl.so.%{sover}
 
 %files devel
 %defattr(644,root,root,755)
diff --git a/cryptlib-rdtsc.patch b/cryptlib-rdtsc.patch
deleted file mode 100644
index d6ebc2f..0000000
--- a/cryptlib-rdtsc.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- cryptlib-3.3.2/random/unix.c.orig	2009-05-12 09:26:50.541650042 +0200
-+++ cryptlib-3.3.2/random/unix.c	2009-05-12 09:36:43.777835448 +0200
-@@ -106,7 +106,7 @@
- #if !( defined( __QNX__ ) || defined( __CYGWIN__ ) )
-   #include <sys/shm.h>
- #endif /* QNX || Cygwin */
--#if defined( __linux__ ) && ( defined(__i386__) || defined(__x86_64__) )
-+#if defined( __linux__ ) && ( defined(__i586__) || defined(__i686__) || defined(__pentium4__) || defined(__athlon__) || defined(__x86_64__) )
-   #include <sys/timex.h>	/* For rdtsc() */
- #endif /* Linux on x86 */
- #include <signal.h>
diff --git a/cryptlib-soname.patch b/cryptlib-soname.patch
deleted file mode 100644
index 94be6c8..0000000
--- a/cryptlib-soname.patch
+++ /dev/null
@@ -1,51 +0,0 @@
---- 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"
- MIN="3"
--PLV="2"
-+PLV="3"
- PROJ="cl"
- SHARED_OBJ_PATH="./shared-obj/"
- if [ $OSNAME = "Darwin" ] ; then
---- 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
-+SONAME=$4
-+shift
- shift
- shift
- shift
-@@ -112,6 +114,9 @@
- 		fi
- 		strip $LIBNAME ;;
- 
-+	'Linux')
-+		$LD -shared -o $LIBNAME `cat $LINKFILE` `./tools/getlibs.sh autodetect` -Wl,-soname=${SONAME:-${LIBNAME}}
-+		;;
- 	*)
- 		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)
-+SONAME = lib$(PROJ).so.$(MAJ)
- DYLIBNAME = lib$(PROJ).$(MAJ).$(MIN).dylib
- 
- # Compiler options.  By default this builds the release version of the code,
-@@ -1403,7 +1404,7 @@
- 
- 
- $(SLIBNAME):	$(OBJS) $(EXTRAOBJS) $(TESTOBJS)
--				@./tools/buildsharedlib.sh $(OSNAME) $(SLIBNAME) $(LD) $(OBJS) \
-+				@./tools/buildsharedlib.sh $(OSNAME) $(SLIBNAME) $(LD) $(SONAME) $(OBJS) \
- 					$(EXTRAOBJS)
- 
- $(DYLIBNAME):	$(OBJS) $(EXTRAOBJS) $(TESTOBJS)
diff --git a/format-security.patch b/format-security.patch
deleted file mode 100644
index 711ccd1..0000000
--- a/format-security.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- cryptlib-3.3.3/session/cmp_rdmsg.c~	2009-07-10 23:39:22.000000000 +0200
-+++ cryptlib-3.3.3/session/cmp_rdmsg.c	2015-12-22 23:43:53.932096178 +0100
-@@ -276,7 +276,7 @@
- 				  "locus %d", errorType, errorLocus ) );
- 		}
- 	retExt( errorStatus,
--			( errorStatus, SESSION_ERRINFO, 
-+			( errorStatus, SESSION_ERRINFO, "%s",
- 			  extErrorInfoPtr->errorString ) );
- 	}
- #else
diff --git a/getcompiler.patch b/getcompiler.patch
new file mode 100644
index 0000000..2844d94
--- /dev/null
+++ b/getcompiler.patch
@@ -0,0 +1,16 @@
+--- cryptlib-3.4.9.6/tools/getcompiler.sh.orig
++++ cryptlib-3.4.9.6/tools/getcompiler.sh
+@@ -39,6 +39,13 @@
+ # good idea.  For these reasons we use the system compiler rather than gcc
+ # if it's available.
+ 
++if [ "$OSNAME" = "Linux" ] ; then
++	# Honour the compiler selected by the caller instead of preferring clang
++	echo "$CC" ;
++	exit 0 ;
++fi
++
++
+ if [ "$OSNAME" = "HP-UX" ] ; then
+ 	if [ -x "$(command -v clang)" ] ; then
+ 		echo "clang" ;
diff --git a/optflags.patch b/optflags.patch
deleted file mode 100644
index 03f1933..0000000
--- a/optflags.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- cryptlib-3.3.3/makefile.orig	2009-07-21 01:02:22.000000000 +0200
-+++ cryptlib-3.3.3/makefile	2015-12-22 09:14:14.998537699 +0100
-@@ -1754,10 +1755,10 @@
- Linux:
- 	@if uname -m | grep "i[3,4,5,6]86" > /dev/null; then \
- 		./tools/buildasm.sh $(AS) $(OBJPATH) ; \
--		make $(DEFINES) EXTRAOBJS="$(ASMOBJS)" CFLAGS="$(CFLAGS) -DUSE_ASM \
-+		make $(DEFINES) EXTRAOBJS="$(ASMOBJS)" CFLAGS="$(CFLAGS) $(OPTFLAGS) \
- 			-fomit-frame-pointer -D_REENTRANT" ; \
- 	else \
--		make $(DEFINES) CFLAGS="$(CFLAGS) -fomit-frame-pointer -D_REENTRANT" ; \
-+		make $(DEFINES) CFLAGS="$(CFLAGS) $(OPTFLAGS) -fomit-frame-pointer -D_REENTRANT" ; \
- 	fi
- 
- # Mac OS X: BSD variant.  Optimisation level is set via the ccopts.sh script.
diff --git a/pthread_yield.patch b/pthread_yield.patch
deleted file mode 100644
index 7f53174..0000000
--- a/pthread_yield.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-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
deleted file mode 100644
index 64b4bfa..0000000
--- a/python-bindings-pointer-types.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-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);
- }
diff --git a/x32.patch b/x32.patch
deleted file mode 100644
index d680e9e..0000000
--- a/x32.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- cryptlib-3.3.3/crypt/osconfig.h~	2009-05-07 02:07:36.000000000 +0200
-+++ cryptlib-3.3.3/crypt/osconfig.h	2015-12-22 09:12:29.940840903 +0100
-@@ -101,7 +101,7 @@
- #if defined( __FreeBSD__ ) || defined( __bsdi__ ) || \
- 	defined( __OpenBSD__ ) || defined( __NetBSD__ ) || \
- 	defined( __linux__ )
--  #if defined( __x86_64__ ) || defined( __amd64__ )
-+  #if (defined( __x86_64__ ) || defined( __amd64__ )) && !defined(__ILP32__)
- 	/* 64-bit x86 has both 'long' and 'long long' as 64 bits.  In addition
- 	   we use DES_INT since int's are 64-bit.  We have to check for the
- 	   64-bit x86 variants before the generic ones because they're a
-@@ -115,7 +115,7 @@
- 	#define DES_RISC1
- 	#define DES_UNROLL
- 	#define RC4_INDEX
--  #elif defined( __i386__ )
-+  #elif defined( __i386__ ) || ((defined( __x86_64__ ) || defined( __amd64__ )) && defined(__ILP32__))
- 	#define L_ENDIAN
- 	#define BN_LLONG
- 	#define DES_PTR
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cryptlib.git/commitdiff/88d81e14c4cfe0a778052b47444dd39e31bb8277



More information about the pld-cvs-commit mailing list