rpms/mhash/F-10 mhash-0.9.9.9-align.patch, NONE, 1.1 mhash-0.9.9.9-alignment.patch, NONE, 1.1 mhash-0.9.9.9-autotools-namespace-stomping.patch, NONE, 1.1 mhash-0.9.9.9-fix-mem-leak.patch, NONE, 1.1 mhash-0.9.9.9-fix-snefru-segfault.patch, NONE, 1.1 mhash-0.9.9.9-fix-whirlpool-segfault.patch, NONE, 1.1 mhash-0.9.9.9-force64bit-tiger.patch, NONE, 1.1 mhash-0.9.9.9-keygen_test_fix.patch, NONE, 1.1 mhash-0.9.9.9-maxint.patch, NONE, 1.1 mhash.spec, 1.26, 1.27 sources, 1.7, 1.8

Tom Callaway spot at fedoraproject.org
Wed Jul 22 22:25:46 UTC 2009


Author: spot

Update of /cvs/pkgs/rpms/mhash/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28697/F-10

Modified Files:
	mhash.spec sources 
Added Files:
	mhash-0.9.9.9-align.patch mhash-0.9.9.9-alignment.patch 
	mhash-0.9.9.9-autotools-namespace-stomping.patch 
	mhash-0.9.9.9-fix-mem-leak.patch 
	mhash-0.9.9.9-fix-snefru-segfault.patch 
	mhash-0.9.9.9-fix-whirlpool-segfault.patch 
	mhash-0.9.9.9-force64bit-tiger.patch 
	mhash-0.9.9.9-keygen_test_fix.patch mhash-0.9.9.9-maxint.patch 
Log Message:
update to 0.9.9.9, fix lots of bugs

mhash-0.9.9.9-align.patch:
 stdfns.c |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 60 insertions(+), 12 deletions(-)

--- NEW FILE mhash-0.9.9.9-align.patch ---
diff -up mhash-0.9.9.9/lib/stdfns.c.BAD mhash-0.9.9.9/lib/stdfns.c
--- mhash-0.9.9.9/lib/stdfns.c.BAD	2009-07-02 16:38:43.217029623 -0400
+++ mhash-0.9.9.9/lib/stdfns.c	2009-07-02 16:41:58.647120391 -0400
@@ -152,6 +152,18 @@ mutils_bzero(void *s, __const mutils_wor
 	}
 }
 
+static void
+mutils_memset8(void *s, __const mutils_word8 c, __const mutils_word32 n)
+{
+	mutils_word8 *stmp = s;
+	mutils_word32 i;
+
+	for (i = 0; i < n; i++, stmp++)
+	{
+               *stmp = c;
+	}
+}
+
 WIN32DLL_DEFINE
 void
 mutils_memset(void *s, __const mutils_word8 c, __const mutils_word32 n)
@@ -160,8 +172,7 @@ mutils_memset(void *s, __const mutils_wo
 	/* Sparc needs 8-bit alignment - just use standard memset */
 	memset(s, (int) c, (size_t) n);
 #else
-	mutils_word8 *stmp;
-	mutils_word32 *ltmp = (mutils_word32 *) s;
+	mutils_word32 *ltmp;
 	mutils_word32 lump;
 	mutils_word32 i;
 	mutils_word32 words;
@@ -172,22 +183,30 @@ mutils_memset(void *s, __const mutils_wo
 		return;
 	}
 
+	if (n < 16)
+	{
+		return mutils_memset8(s, c, n);
+	}
+
+	/* unaligned portion at beginning */
+	remainder = (-(mutils_word32)s) & 0x3;
+	mutils_memset8(s, c, remainder);
+
+	/* aligned words in the middle */
+	ltmp = (mutils_word32 *) (s + remainder);
+
 	lump = (c << 24) + (c << 16) + (c << 8) + c;
 
-	words = n >> 2;
-	remainder = n - (words << 2);
+	words = (n - remainder) >> 2;
+	remainder = n - remainder - (words << 2);
 
 	for (i = 0; i < words; i++, ltmp++)
 	{
 		*ltmp = lump;
 	}
 
-	stmp = (mutils_word8 *) ltmp;
-
-	for (i = 0; i < remainder; i++, stmp++)
-	{
-		*stmp = c;
-	}
+	/* unaligned portion at end */
+	return mutils_memset8(ltmp, c, remainder);
 #endif
 }
 
@@ -281,6 +300,9 @@ mutils_word32nswap(mutils_word32 *x, mut
 	mutils_word32 *buffer;
 	mutils_word32 *ptrIn;
 	mutils_word32 *ptrOut;
+	mutils_word8 *ptr8In;
+	mutils_word8 *ptr8Out;
+	mutils_word8 tmp8;
 	mutils_word32 count = n * 4;
 
 	if (destructive == MUTILS_FALSE)
@@ -301,9 +323,35 @@ mutils_word32nswap(mutils_word32 *x, mut
  * data on a little-endian machine.
  */
 
-	for (loop = 0, ptrIn = x, ptrOut = buffer; loop < n; loop++, ptrOut++, ptrIn++)
+	if ((mutils_word32)x & 0x3)
+	{
+         ptr8In = (mutils_word8 *) x;
+         ptr8Out = (mutils_word8 *) buffer;
+         for (loop = 0; loop < n; loop++)
+           {
+#ifdef WORDS_BIGENDIAN
+             tmp8 = ptr8In[0];
+             ptr8Out[0] = ptr8In[3];
+             ptr8Out[3] = tmp8;
+             tmp8 = ptr8In[1];
+             ptr8Out[1] = ptr8In[2];
+             ptr8Out[2] = tmp8;
+#else
+             ptr8Out[0] = ptr8In[0];
+             ptr8Out[1] = ptr8In[1];
+             ptr8Out[2] = ptr8In[2];
+             ptr8Out[3] = ptr8In[3];
+#endif
+             ptr8Out += 4;
+             ptr8In += 4;
+           }
+	}
+	else
 	{
-		*ptrOut = mutils_lend32(*ptrIn);
+               for (loop = 0, ptrIn = x, ptrOut = buffer; loop < n; loop++, ptrOut++, ptrIn++)
+               {
+                       *ptrOut = mutils_lend32(*ptrIn);
+               }
 	}
 
 	return(buffer);

mhash-0.9.9.9-alignment.patch:
 stdfns.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- NEW FILE mhash-0.9.9.9-alignment.patch ---
diff -up mhash-0.9.9.9/lib/stdfns.c.BAD mhash-0.9.9.9/lib/stdfns.c
--- mhash-0.9.9.9/lib/stdfns.c.BAD	2009-07-21 12:05:40.139461097 -0400
+++ mhash-0.9.9.9/lib/stdfns.c	2009-07-21 12:06:52.151190927 -0400
@@ -378,6 +378,12 @@ mutils_memmove(void *dest, __const void 
 	bigptr1 = (mutils_word32 *) dest;
 	bigptr2 = (mutils_word32 *) src;
 
+	/* copy byte-by-byte for small and/or unaligned copies */
+	if ((n < 16) || ((mutils_word32)dest & 0x3) || ((mutils_word32)src & 0x3))
+	{
+		return mutils_memcpy8(dest, src, n);
+	}
+
 	words = n >> 2;
 	remainder = n - (words << 2);
 

mhash-0.9.9.9-autotools-namespace-stomping.patch:
 configure.in                     |    1 +
 include/mutils/config.h.in       |   22 ++++++++++++++++++++++
 include/mutils/mhash_config.h.in |   21 ---------------------
 3 files changed, 23 insertions(+), 21 deletions(-)

--- NEW FILE mhash-0.9.9.9-autotools-namespace-stomping.patch ---
diff -up mhash-0.9.9.9/configure.in.fix-autotool-stomping mhash-0.9.9.9/configure.in
--- mhash-0.9.9.9/configure.in.fix-autotool-stomping	2007-04-04 22:22:28.000000000 -0400
+++ mhash-0.9.9.9/configure.in	2009-07-02 17:02:39.099044520 -0400
@@ -6,6 +6,7 @@ AC_CONFIG_SRCDIR([lib/mhash.c])
 AM_INIT_AUTOMAKE
 
 AC_DEFINE([MHASH_VERSION], PROGRAM_VERSION, "MHash Version")
+AC_CONFIG_HEADER([include/mutils/config.h])
 AC_CONFIG_HEADER([include/mutils/mhash_config.h])
 
 
diff -up /dev/null mhash-0.9.9.9/include/mutils/config.h.in
--- /dev/null	2009-07-01 18:40:45.228272777 -0400
+++ mhash-0.9.9.9/include/mutils/config.h.in	2009-07-02 17:02:39.100044508 -0400
@@ -0,0 +1,22 @@
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Version number of package */
+#undef VERSION
+
+
diff -up mhash-0.9.9.9/include/mutils/mhash_config.h.in.fix-autotool-stomping mhash-0.9.9.9/include/mutils/mhash_config.h.in
--- mhash-0.9.9.9/include/mutils/mhash_config.h.in.fix-autotool-stomping	2008-12-07 18:33:50.000000000 -0500
+++ mhash-0.9.9.9/include/mutils/mhash_config.h.in	2009-07-02 17:04:30.453049610 -0400
@@ -181,24 +181,6 @@
 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
 #undef NO_MINUS_C_MINUS_O
 
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
 /* Define to 1 if the C compiler supports function prototypes. */
 #undef PROTOTYPES
 
@@ -208,9 +190,6 @@
 /* dmalloc */
 #undef USE_DMALLOC
 
-/* Version number of package */
-#undef VERSION
-
 /* Define if using the dmalloc debugging malloc package */
 #undef WITH_DMALLOC
 

mhash-0.9.9.9-fix-mem-leak.patch:
 mhash.c |    2 ++
 1 file changed, 2 insertions(+)

--- NEW FILE mhash-0.9.9.9-fix-mem-leak.patch ---
diff -up mhash-0.9.9.9/lib/mhash.c.BAD mhash-0.9.9.9/lib/mhash.c
--- mhash-0.9.9.9/lib/mhash.c.BAD	2009-07-02 16:57:43.872049877 -0400
+++ mhash-0.9.9.9/lib/mhash.c	2009-07-02 16:58:03.909029777 -0400
@@ -719,6 +719,8 @@ WIN32DLL_DEFINE MHASH mhash_restore_stat
 	mutils_memcpy( &ret->state_size, &mem[pos], sizeof(ret->state_size));
 	pos += sizeof( ret->state_size);
 
+	if (ret->state)
+		mutils_free(ret->state);
 	ret->state = mutils_malloc(ret->state_size);
 	if (ret->state==NULL)
 		goto freeall;

mhash-0.9.9.9-fix-snefru-segfault.patch:
 snefru.c |    2 ++
 1 file changed, 2 insertions(+)

--- NEW FILE mhash-0.9.9.9-fix-snefru-segfault.patch ---
diff -up mhash-0.9.9.9/lib/snefru.c.BAD mhash-0.9.9.9/lib/snefru.c
--- mhash-0.9.9.9/lib/snefru.c.BAD	2009-07-02 16:54:58.973279449 -0400
+++ mhash-0.9.9.9/lib/snefru.c	2009-07-02 16:55:04.609279072 -0400
@@ -859,6 +859,8 @@ static void snefru_digest(__const struct
 {
 	mutils_word32 i;
 
+	if(!digest) return;
+
 	for (i = 0; i < len; i++, digest += 4)
 	{
 		*(mutils_word32 *)digest = mutils_bend2sys32(ctx->hash[i]);

mhash-0.9.9.9-fix-whirlpool-segfault.patch:
 whirlpool.c |    2 ++
 1 file changed, 2 insertions(+)

--- NEW FILE mhash-0.9.9.9-fix-whirlpool-segfault.patch ---
diff -up mhash-0.9.9.9/lib/whirlpool.c.BAD mhash-0.9.9.9/lib/whirlpool.c
--- mhash-0.9.9.9/lib/whirlpool.c.BAD	2009-07-02 16:59:50.885279180 -0400
+++ mhash-0.9.9.9/lib/whirlpool.c	2009-07-02 17:00:12.189279257 -0400
@@ -970,6 +970,8 @@ void whirlpool_digest(__const struct whi
                     mutils_word8 * digest)
 {
    mutils_word32 i;
+
+   if(!digest) return;
     /*
      * return the completed message digest:
      */

mhash-0.9.9.9-force64bit-tiger.patch:
 tiger.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- NEW FILE mhash-0.9.9.9-force64bit-tiger.patch ---
diff -up mhash-0.9.9.9/lib/tiger.c.BAD mhash-0.9.9.9/lib/tiger.c
--- mhash-0.9.9.9/lib/tiger.c.BAD	2009-07-02 16:42:47.683029940 -0400
+++ mhash-0.9.9.9/lib/tiger.c	2009-07-02 16:43:46.085049317 -0400
@@ -252,7 +252,9 @@ void tiger_update(struct tiger_ctx *ctx,
 void tiger_final(struct tiger_ctx *ctx)
 {
 	register mutils_word64 i, j;
-	mutils_word8 temp[TIGER_DATASIZE];
+	/* Force 64-bit alignment */
+	mutils_word64 temp_64bit[TIGER_DATASIZE/8];
+	mutils_word8 *temp = temp_64bit;
 	i = ctx->index;
 	
 #if defined(WORDS_BIGENDIAN)

mhash-0.9.9.9-keygen_test_fix.patch:
 keygen_test.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE mhash-0.9.9.9-keygen_test_fix.patch ---
diff -up mhash-0.9.9.9/src/keygen_test.c.BAD mhash-0.9.9.9/src/keygen_test.c
--- mhash-0.9.9.9/src/keygen_test.c.BAD	2009-07-22 18:01:59.636042665 -0400
+++ mhash-0.9.9.9/src/keygen_test.c	2009-07-22 18:04:53.608292727 -0400
@@ -121,7 +121,7 @@ int main()
 	
 	mhash_keygen_ext(KEYGEN_S2K_SALTED, data, key, keysize, password, passlen);
 
-	mutils_memset(tmp, 0, keysize * 2);
+	// mutils_memset(tmp, 0, keysize * 2);
 
 	tmp = mutils_asciify(key, keysize);
 

mhash-0.9.9.9-maxint.patch:
 stdfns.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

--- NEW FILE mhash-0.9.9.9-maxint.patch ---
diff -up mhash-0.9.9.9/lib/stdfns.c.BAD mhash-0.9.9.9/lib/stdfns.c
--- mhash-0.9.9.9/lib/stdfns.c.BAD	2009-07-21 12:01:21.596191078 -0400
+++ mhash-0.9.9.9/lib/stdfns.c	2009-07-21 12:02:37.419191301 -0400
@@ -24,6 +24,7 @@
  */
 
 #include "libdefs.h"
+#include <limits.h>
 
 /**
  * Some of these are wrappers. The idea is to eventually produce an extremely
@@ -408,11 +409,11 @@ mutils_memcmp(__const void *s1, const vo
 		{
 			return(0);
 		}
-		return(-MAXINT);
+		return(-INT_MAX);
 	}
 	if (s2 == NULL)
 	{
-		return(MAXINT);
+		return(INT_MAX);
 	}
 
 	return(memcmp(s1, s2, n));
@@ -539,11 +540,11 @@ mutils_strcmp(__const mutils_word8 *src1
 		{
 			return(0);
 		}
-		return(-MAXINT);
+		return(-INT_MAX);
 	}
 	if (src2 == NULL)
 	{
-		return(MAXINT);
+		return(INT_MAX);
 	}
 	return(strcmp((char *) src1, (char *) src2));
 }
@@ -562,11 +563,11 @@ mutils_strncmp(__const mutils_word8 *src
 		{
 			return(0);
 		}
-		return(-MAXINT);
+		return(-INT_MAX);
 	}
 	if (src2 == NULL)
 	{
-		return(MAXINT);
+		return(INT_MAX);
 	}
 	return(strncmp((char *) src1, (char *) src2, n));
 }


Index: mhash.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mhash/F-10/mhash.spec,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- mhash.spec	16 Feb 2009 16:25:21 -0000	1.26
+++ mhash.spec	22 Jul 2009 22:25:15 -0000	1.27
@@ -3,14 +3,36 @@
 
 Summary: Thread-safe hash algorithms library
 Name: mhash
-Version: 0.9.9
-Release: 6
+Version: 0.9.9.9
+Release: 1%{?dist}
 URL: http://mhash.sourceforge.net/
 License: LGPLv2+
 Group: System Environment/Libraries
 Source: http://download.sourceforge.net/mhash/mhash-%{version}.tar.bz2
-Patch1: mhash-0.9.9-multiarch.patch
-Patch2: mutils-align.patch
+Patch2: mhash-0.9.9.9-align.patch
+Patch3: mhash-0.9.9.9-force64bit-tiger.patch
+# Taken from Gentoo: 
+# http://mirror.its.uidaho.edu/pub/gentoo-portage/app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch
+Patch4: mhash-0.9.9.9-fix-snefru-segfault.patch
+# Taken from Gentoo:
+# http://mirror.its.uidaho.edu/pub/gentoo-portage/app-crypt/mhash/files/mhash-0.9.9-fix-mem-leak.patch
+Patch5: mhash-0.9.9.9-fix-mem-leak.patch
+# Taken from Gentoo:
+# http://mirror.its.uidaho.edu/pub/gentoo-portage/app-crypt/mhash/files/mhash-0.9.9-fix-whirlpool-segfault.patch
+Patch6: mhash-0.9.9.9-fix-whirlpool-segfault.patch
+# Taken from Gentoo:
+# http://mirror.its.uidaho.edu/pub/gentoo-portage/app-crypt/mhash/files/mhash-0.9.9-autotools-namespace-stomping.patch
+Patch7: mhash-0.9.9.9-autotools-namespace-stomping.patch
+# Taken from openpkg:
+# http://www.mail-archive.com/openpkg-cvs@openpkg.org/msg26353.html
+Patch8: mhash-0.9.9.9-maxint.patch
+# Taken from Jitesh Shah
+# http://ftp.uk.linux.org/pub/armlinux/fedora/diffs-f11/mhash/0001-Alignment-fixes.patch
+Patch9: mhash-0.9.9.9-alignment.patch
+# Fix keygen_test
+Patch10: mhash-0.9.9.9-keygen_test_fix.patch
+
+BuildRequires: autoconf, automake
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot-%(%{__id_u} -n)
 Provides: libmhash = %{version}-%{release}
 
@@ -41,9 +63,16 @@ develop programs that use the mhash libr
 
 %prep
 %setup -q
-%patch1 -p1 -b .multiarch
 %patch2 -p1 -b .alignment
-
+%patch3 -p1 -b .force64bit-tiger
+%patch4 -p1 -b .fix-snefru-segfault
+%patch5 -p1 -b .fix-mem-leak
+%patch6 -p1 -b .fix-whirlpool-segfault
+%patch7 -p1 -b .fix-autotool-stomping
+%patch8 -p1 -b .maxint
+%patch9 -p1 -b .alignment2
+%patch10 -p1 -b .fix
+autoconf
 
 %build
 %configure --enable-shared %{?_with_static: --enable-static} %{!?_with_static: --disable-static}
@@ -95,6 +124,13 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Wed Jul 22 2009 Tom "spot" Callaway <tcallawa at redhat.com> - 0.9.9.9-1
+- update to 0.9.9.9
+- apply all the fixes that I could find
+
+* Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.9.9-7
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
 * Mon Feb 16 2009 Dennis Gilmore <dennis at ausil.us> - 0.9.9-6
 - fix memory alignment issues
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/mhash/F-10/sources,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- sources	6 Apr 2007 13:07:46 -0000	1.7
+++ sources	22 Jul 2009 22:25:15 -0000	1.8
@@ -1 +1 @@
-d113a853e0ac21c49c5a1acea0daaade  mhash-0.9.9.tar.bz2
+f91c74f9ccab2b574a98be5bc31eb280  mhash-0.9.9.9.tar.bz2




More information about the scm-commits mailing list