[packages/libmcrypt] Rel 4; libltdl dir is not used

arekm arekm at pld-linux.org
Mon Mar 9 17:18:27 CET 2026


commit 1ce41e95c1f40a78d381c49600ca14dd7096b832
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Mar 9 17:18:00 2026 +0100

    Rel 4; libltdl dir is not used

 libmcrypt-2.5.8-prototypes.patch    | 35 ++++++++++++++++++++++++
 libmcrypt-2.5.8-rotate-mask.patch   | 18 +++++++++++++
 libmcrypt-2.5.8-uninitialized.patch | 12 +++++++++
 libmcrypt-c99.patch                 | 54 +++++++++++++++++++++++++++++++++++++
 libmcrypt-configure-c99-2.patch     | 40 +++++++++++++++++++++++++++
 libmcrypt.spec                      | 25 +++++++++++------
 6 files changed, 176 insertions(+), 8 deletions(-)
---
diff --git a/libmcrypt.spec b/libmcrypt.spec
index 08e1eea..eeaffb8 100644
--- a/libmcrypt.spec
+++ b/libmcrypt.spec
@@ -8,12 +8,22 @@ Summary:	Encryption/decryption library
 Summary(pl.UTF-8):	Biblioteka z funkcjami szyfrującymi oraz deszyfrującymi
 Name:		libmcrypt
 Version:	2.5.8
-Release:	3
+Release:	4
 License:	LGPL v2+
 Group:		Libraries
 Source0:	http://downloads.sourceforge.net/mcrypt/%{name}-%{version}.tar.bz2
 # Source0-md5:	c4f491dd411a09e9de3b8702ea6f73eb
 URL:		http://mcrypt.sourceforge.net/
+# from Fedora, K&R to ANSI C prototypes in des.c/tripledes.c
+Patch0:		%{name}-2.5.8-prototypes.patch
+# from Fedora, fix implicit function declarations in mcrypt_symb.c and type error in tripledes.c
+Patch1:		%{name}-c99.patch
+# from Fedora, fix malformed AC_CHECK_FUNCS for readdir and bcopy
+Patch2:		%{name}-configure-c99-2.patch
+# from Fedora, initialize t0/t1 in twofish.c
+Patch3:		%{name}-2.5.8-uninitialized.patch
+# from Gentoo, fix undefined behavior in rotation macros on 64-bit
+Patch4:		%{name}-2.5.8-rotate-mask.patch
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
 %{?with_modules:BuildRequires:	libltdl-devel}
@@ -64,6 +74,11 @@ Statyczna biblioteka z funkcjami szyfrującymi oraz deszyfrującymi.
 
 %prep
 %setup -q
+%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
 
 # only invalid libtool.m4 inclusion
 rm -f acinclude.m4
@@ -73,12 +88,6 @@ rm -f acinclude.m4
 %{__aclocal}
 %{__autoconf}
 %{__automake}
-cd libltdl
-%{__aclocal}
-%{__autoconf}
-# don't use -f here
-automake -a -c --foreign
-cd ..
 %configure \
 	--enable-static \
 	--disable-libltdl \
@@ -100,7 +109,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS KNOWN-BUGS NEWS README THANKS TODO
+%doc AUTHORS NEWS README THANKS TODO
 %attr(755,root,root) %{_libdir}/libmcrypt.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libmcrypt.so.4
 %if %{with modules}
diff --git a/libmcrypt-2.5.8-prototypes.patch b/libmcrypt-2.5.8-prototypes.patch
new file mode 100644
index 0000000..eca6e77
--- /dev/null
+++ b/libmcrypt-2.5.8-prototypes.patch
@@ -0,0 +1,35 @@
+diff -up libmcrypt-2.5.8/modules/algorithms/des.c.BAD libmcrypt-2.5.8/modules/algorithms/des.c
+--- libmcrypt-2.5.8/modules/algorithms/des.c.BAD	2008-08-25 17:40:29.000000000 -0400
++++ libmcrypt-2.5.8/modules/algorithms/des.c	2008-08-25 17:40:51.000000000 -0400
+@@ -35,9 +35,12 @@
+ 
+ /* #define	NULL	0 */
+ 
+-static void permute_ip(), permute_fp(), perminit_ip(), spinit(),
+-perminit_fp();
+-static word32 f();
++static void permute_ip(char *, DES_KEY *, char *);
++static void permute_fp(char *, DES_KEY *, char *);
++static void perminit_ip(DES_KEY *);
++static void spinit(DES_KEY *);
++static void perminit_fp(DES_KEY *);
++static word32 f(DES_KEY *, register word32, register char *);
+ 
+ 
+ /* Tables defined in the Data Encryption Standard documents */
+diff -up libmcrypt-2.5.8/modules/algorithms/tripledes.c.BAD libmcrypt-2.5.8/modules/algorithms/tripledes.c
+--- libmcrypt-2.5.8/modules/algorithms/tripledes.c.BAD	2008-08-25 17:40:56.000000000 -0400
++++ libmcrypt-2.5.8/modules/algorithms/tripledes.c	2008-08-25 17:41:13.000000000 -0400
+@@ -36,8 +36,10 @@
+ 
+ /* #define	NULL	0 */
+ 
+-static void permute(), perminit(), spinit();
+-static word32 f();
++static void permute(char *, char[16][16][8], char *);
++static void perminit(char[16][16][8], char[64]);
++static void spinit(TRIPLEDES_KEY *, int);
++static word32 f(TRIPLEDES_KEY *, int, register word32, register char *);
+ 
+ 
+ /* Tables defined in the Data Encryption Standard documents */
diff --git a/libmcrypt-2.5.8-rotate-mask.patch b/libmcrypt-2.5.8-rotate-mask.patch
new file mode 100644
index 0000000..568caa4
--- /dev/null
+++ b/libmcrypt-2.5.8-rotate-mask.patch
@@ -0,0 +1,18 @@
+--- a/KNOWN-BUGS	2008-12-13 15:31:49.000000000 -0500
++++ /dev/null	2008-12-13 02:05:21.751517562 -0500
+@@ -1 +0,0 @@
+-- cast-256 and rc6 do not work properly on Alpha (64 bit) machines
+--- a/lib/mcrypt_modules.h.orig	2008-12-13 15:33:06.000000000 -0500
++++ b/lib/mcrypt_modules.h	2008-12-13 15:25:01.000000000 -0500
+@@ -1,7 +1,7 @@
+-#define rotl32(x,n)   (((x) << ((word32)(n))) | ((x) >> (32 - (word32)(n))))
+-#define rotr32(x,n)   (((x) >> ((word32)(n))) | ((x) << (32 - (word32)(n))))
+-#define rotl16(x,n)   (((x) << ((word16)(n))) | ((x) >> (16 - (word16)(n))))
+-#define rotr16(x,n)   (((x) >> ((word16)(n))) | ((x) << (16 - (word16)(n))))
++#define rotl32(x,n)   (((x) << ((word32)(n & 31))) | ((x) >> (32 - (word32)(n & 31))))
++#define rotr32(x,n)   (((x) >> ((word32)(n & 31))) | ((x) << (32 - (word32)(n & 31))))
++#define rotl16(x,n)   (((x) << ((word16)(n & 15))) | ((x) >> (16 - (word16)(n & 15))))
++#define rotr16(x,n)   (((x) >> ((word16)(n & 15))) | ((x) << (16 - (word16)(n & 15))))
+ 
+ /* Use hardware rotations.. when available */
+ #ifdef swap32
diff --git a/libmcrypt-2.5.8-uninitialized.patch b/libmcrypt-2.5.8-uninitialized.patch
new file mode 100644
index 0000000..f52dc93
--- /dev/null
+++ b/libmcrypt-2.5.8-uninitialized.patch
@@ -0,0 +1,12 @@
+diff -up libmcrypt-2.5.8/modules/algorithms/twofish.c.BAD libmcrypt-2.5.8/modules/algorithms/twofish.c
+--- libmcrypt-2.5.8/modules/algorithms/twofish.c.BAD	2008-08-25 17:38:21.000000000 -0400
++++ libmcrypt-2.5.8/modules/algorithms/twofish.c	2008-08-25 17:38:30.000000000 -0400
+@@ -499,7 +499,7 @@ static void f_rnd(int i, word32* blk, TW
+ /* encrypt a block of text  */
+ WIN32DLL_DEFINE void _mcrypt_encrypt(TWI * pkey, word32 * in_blk)
+ {
+-	word32 t0, t1, blk[4];
++	word32 t0 = 0, t1 = 0, blk[4];
+ #ifdef WORDS_BIGENDIAN
+ 	blk[0] = byteswap32(in_blk[0]) ^ pkey->l_key[0];
+ 	blk[1] = byteswap32(in_blk[1]) ^ pkey->l_key[1];
diff --git a/libmcrypt-c99.patch b/libmcrypt-c99.patch
new file mode 100644
index 0000000..c051b08
--- /dev/null
+++ b/libmcrypt-c99.patch
@@ -0,0 +1,54 @@
+Add return and argument types to fake prototypes in mcrypt_symb.c.
+This avoids build failures with future compilers that do not support
+implicit function declarations.
+
+Also fix a minor type error in the perminit calls in the Triple DES
+implementation.
+
+Submitted upstream: <https://sourceforge.net/p/mcrypt/patches/15/>
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index a1a09578858aaf3c..a92f150627a1f610 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -23,8 +23,8 @@ mcrypt_symb.c: mcrypt_internal.h
+ 	@echo "/* This is automatically created. Don't touch... */" >> mcrypt_symb.c
+ 	@echo "" >> mcrypt_symb.c
+ 	- at for i in $(EXTRA_ALGOS); do \
+-		if test -f ../modules/algorithms/$$i.c; then cat ../modules/algorithms/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern "$$3"();";}' >> mcrypt_symb.c 2>/dev/null; fi; \
+-		if test -f ../modules/modes/$$i.c; then cat ../modules/modes/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern "$$3"();";}' >> mcrypt_symb.c 2>/dev/null; fi; \
++		if test -f ../modules/algorithms/$$i.c; then cat ../modules/algorithms/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern void "$$3"(void);";}' >> mcrypt_symb.c 2>/dev/null; fi; \
++		if test -f ../modules/modes/$$i.c; then cat ../modules/modes/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern void "$$3"(void);";}' >> mcrypt_symb.c 2>/dev/null; fi; \
+ 	done
+ 	@echo "" >> mcrypt_symb.c
+ 	@echo "const mcrypt_preloaded mps[] = {" >> mcrypt_symb.c
+diff --git a/lib/Makefile.in b/lib/Makefile.in
+index 1baaa1e94be1abce..e0e690d1c831370f 100644
+--- a/lib/Makefile.in
++++ b/lib/Makefile.in
+@@ -561,8 +561,8 @@ mcrypt_symb.c: mcrypt_internal.h
+ 	@echo "/* This is automatically created. Don't touch... */" >> mcrypt_symb.c
+ 	@echo "" >> mcrypt_symb.c
+ 	- at for i in $(EXTRA_ALGOS); do \
+-		if test -f ../modules/algorithms/$$i.c; then cat ../modules/algorithms/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern "$$3"();";}' >> mcrypt_symb.c 2>/dev/null; fi; \
+-		if test -f ../modules/modes/$$i.c; then cat ../modules/modes/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern "$$3"();";}' >> mcrypt_symb.c 2>/dev/null; fi; \
++		if test -f ../modules/algorithms/$$i.c; then cat ../modules/algorithms/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern void "$$3"(void);";}' >> mcrypt_symb.c 2>/dev/null; fi; \
++		if test -f ../modules/modes/$$i.c; then cat ../modules/modes/$$i.c 2>/dev/null|grep define|grep LTX|awk '{print "extern void "$$3"(void);";}' >> mcrypt_symb.c 2>/dev/null; fi; \
+ 	done
+ 	@echo "" >> mcrypt_symb.c
+ 	@echo "const mcrypt_preloaded mps[] = {" >> mcrypt_symb.c
+diff --git a/modules/algorithms/tripledes.c b/modules/algorithms/tripledes.c
+index 98e9bd45b4f336b1..2737d2fd8fd02a3f 100644
+--- a/modules/algorithms/tripledes.c
++++ b/modules/algorithms/tripledes.c
+@@ -201,8 +201,8 @@ static int _mcrypt_desinit(TRIPLEDES_KEY * key)
+ 	spinit(key, 0);
+ 	spinit(key, 1);
+ 	spinit(key, 2);
+-	perminit(&key->iperm, ip);
+-	perminit(&key->fperm, fp);
++	perminit(key->iperm, ip);
++	perminit(key->fperm, fp);
+ 
+ 
+ 	return 0;
diff --git a/libmcrypt-configure-c99-2.patch b/libmcrypt-configure-c99-2.patch
new file mode 100644
index 0000000..2f79dfe
--- /dev/null
+++ b/libmcrypt-configure-c99-2.patch
@@ -0,0 +1,40 @@
+Fix glitches in the readdir and bcopy probes.  They were
+just invalid.
+
+diff --git a/configure b/configure
+index d0fb8783e147654b..4fe7660a16359171 100755
+--- a/configure
++++ b/configure
+@@ -6639,7 +6639,7 @@ fi
+ done
+ 
+ 
+-for ac_func in readdir,,
++for ac_func in readdir
+ do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for $ac_func" >&5
+@@ -6741,7 +6741,7 @@ fi
+ done
+ 
+ 
+-for ac_func in bcopy,,
++for ac_func in bcopy
+ do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for $ac_func" >&5
+diff --git a/configure.in b/configure.in
+index a815778931728ec2..f0c9a0e8f73e1153 100644
+--- a/configure.in
++++ b/configure.in
+@@ -204,8 +204,8 @@ AC_FUNC_MEMCMP
+ AC_FUNC_REALLOC
+ 
+ AC_CHECK_FUNCS([bzero memmove memset mlock readdir_r strchr strdup strrchr])
+-AC_CHECK_FUNCS([readdir,,])
+-AC_CHECK_FUNCS([bcopy,,])
++AC_CHECK_FUNCS([readdir])
++AC_CHECK_FUNCS([bcopy])
+ 
+ dnl Checks for libraries.
+ AC_C_BIGENDIAN
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libmcrypt.git/commitdiff/1ce41e95c1f40a78d381c49600ca14dd7096b832



More information about the pld-cvs-commit mailing list