summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2012-02-19 16:13:25 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2012-02-19 16:13:25 +0000
commitd69bdf9047361c74599cf764995fe3768e654682 (patch)
tree9e8a5b4194358f001be3c619e10fe5b558ca5dbe /app-crypt/mhash
parentalpha/ia64/s390/sh/sparc stable wrt #397189 (diff)
downloadgentoo-2-d69bdf9047361c74599cf764995fe3768e654682.tar.gz
gentoo-2-d69bdf9047361c74599cf764995fe3768e654682.tar.bz2
gentoo-2-d69bdf9047361c74599cf764995fe3768e654682.zip
Fix tests and add few more patches to play nicer wrt bug#294548. Stable 0.9.9.9-r1 on amd64 and x86 wrt bug#287397.
(Portage version: 2.2.0_alpha87/cvs/Linux x86_64, RepoMan options: --force)
Diffstat (limited to 'app-crypt/mhash')
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-align.patch119
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-alignment.patch16
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-force64bit-tiger.patch14
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-remove_premature_free.patch12
-rw-r--r--app-crypt/mhash/mhash-0.9.9.9-r1.ebuild (renamed from app-crypt/mhash/mhash-0.9.9.9.ebuild)13
-rw-r--r--app-crypt/mhash/mhash-0.9.9.ebuild34
6 files changed, 170 insertions, 38 deletions
diff --git a/app-crypt/mhash/files/mhash-0.9.9.9-align.patch b/app-crypt/mhash/files/mhash-0.9.9.9-align.patch
new file mode 100644
index 000000000000..04bb310aa772
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-align.patch
@@ -0,0 +1,119 @@
+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);
diff --git a/app-crypt/mhash/files/mhash-0.9.9.9-alignment.patch b/app-crypt/mhash/files/mhash-0.9.9.9-alignment.patch
new file mode 100644
index 000000000000..04df22167a3f
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-alignment.patch
@@ -0,0 +1,16 @@
+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);
+
diff --git a/app-crypt/mhash/files/mhash-0.9.9.9-force64bit-tiger.patch b/app-crypt/mhash/files/mhash-0.9.9.9-force64bit-tiger.patch
new file mode 100644
index 000000000000..2248bcc6a308
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-force64bit-tiger.patch
@@ -0,0 +1,14 @@
+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)
diff --git a/app-crypt/mhash/files/mhash-0.9.9.9-remove_premature_free.patch b/app-crypt/mhash/files/mhash-0.9.9.9-remove_premature_free.patch
new file mode 100644
index 000000000000..5ed4ecbe6292
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-remove_premature_free.patch
@@ -0,0 +1,12 @@
+diff -ru mhash-0.9.9.9.orig/src/keygen_test.c mhash-0.9.9.9/src/keygen_test.c
+--- mhash-0.9.9.9.orig/src/keygen_test.c 2007-02-21 07:39:08.000000000 +0100
++++ mhash-0.9.9.9/src/keygen_test.c 2009-12-04 01:29:16.000000000 +0100
+@@ -121,8 +121,6 @@
+
+ mhash_keygen_ext(KEYGEN_S2K_SALTED, data, key, keysize, password, passlen);
+
+- mutils_memset(tmp, 0, keysize * 2);
+-
+ tmp = mutils_asciify(key, keysize);
+
+ result = mutils_strcmp((mutils_word8 *) KEY2, tmp);
diff --git a/app-crypt/mhash/mhash-0.9.9.9.ebuild b/app-crypt/mhash/mhash-0.9.9.9-r1.ebuild
index f453c2196cf8..133286162364 100644
--- a/app-crypt/mhash/mhash-0.9.9.9.ebuild
+++ b/app-crypt/mhash/mhash-0.9.9.9-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/mhash/mhash-0.9.9.9.ebuild,v 1.3 2011/07/29 06:23:45 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/mhash/mhash-0.9.9.9-r1.ebuild,v 1.1 2012/02/19 16:13:25 scarabeus Exp $
EAPI=4
inherit eutils
@@ -11,7 +11,7 @@ SRC_URI="mirror://sourceforge/mhash/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE="static-libs"
RDEPEND=""
@@ -20,7 +20,11 @@ DEPEND="dev-lang/perl" # pod2html
src_prepare() {
epatch \
"${FILESDIR}"/${PN}-0.9.9-fix-{mem-leak,snefru-segfault,whirlpool-segfault}.patch \
- "${FILESDIR}"/${PN}-0.9.9-autotools-namespace-stomping.patch
+ "${FILESDIR}"/${PN}-0.9.9-autotools-namespace-stomping.patch \
+ "${FILESDIR}"/${P}-remove_premature_free.patch \
+ "${FILESDIR}"/${P}-force64bit-tiger.patch \
+ "${FILESDIR}"/${P}-align.patch \
+ "${FILESDIR}"/${P}-alignment.patch
}
src_configure() {
@@ -33,7 +37,8 @@ src_compile() {
}
src_install() {
- emake DESTDIR="${D}" install
+ default
+
use static-libs || rm -f "${ED}"usr/lib*/libmhash.la
dodoc AUTHORS ChangeLog NEWS README THANKS TODO \
doc/{example.c,skid2-authentication}
diff --git a/app-crypt/mhash/mhash-0.9.9.ebuild b/app-crypt/mhash/mhash-0.9.9.ebuild
deleted file mode 100644
index c0701d875301..000000000000
--- a/app-crypt/mhash/mhash-0.9.9.ebuild
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/mhash/mhash-0.9.9.ebuild,v 1.10 2011/02/06 05:28:23 leio Exp $
-
-inherit eutils
-
-DESCRIPTION="library providing a uniform interface to a large number of hash algorithms"
-HOMEPAGE="http://mhash.sourceforge.net/"
-SRC_URI="mirror://sourceforge/mhash/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh ~sparc x86 ~sparc-fbsd"
-IUSE=""
-
-DEPEND=""
-RDEPEND=""
-
-src_compile() {
- econf \
- --enable-static \
- --enable-shared || die
- emake || die "make failure"
- cd doc && emake mhash.html || die "failed to build html"
-}
-
-src_install() {
- dodir /usr/{bin,include,lib}
- make install DESTDIR="${D}" || die "install failure"
-
- dodoc AUTHORS INSTALL NEWS README TODO THANKS ChangeLog
- dodoc doc/*.txt doc/skid* doc/*.c
- dohtml doc/mhash.html || die "dohtml failed"
-}