summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-crypt/mhash')
-rw-r--r--app-crypt/mhash/Manifest1
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-autotools-namespace-stomping.patch96
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-fix-mem-leak.patch27
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch27
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-fix-whirlpool-segfault.patch27
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-mutils-align.patch118
-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/metadata.xml11
-rw-r--r--app-crypt/mhash/mhash-0.9.9.9-r1.ebuild52
12 files changed, 520 insertions, 0 deletions
diff --git a/app-crypt/mhash/Manifest b/app-crypt/mhash/Manifest
new file mode 100644
index 000000000000..cd4ce6bccdba
--- /dev/null
+++ b/app-crypt/mhash/Manifest
@@ -0,0 +1 @@
+DIST mhash-0.9.9.9.tar.gz 931437 SHA256 3dcad09a63b6f1f634e64168dd398e9feb9925560f9b671ce52283a79604d13e SHA512 82ad8b8e9b0463c5a14f5c0e572badc42c4697bac5505443b144287b3f8510b1410721b4277f092a0d6045c4342e997831011cdfcbfa8f1dae6edd5d9e3cefee WHIRLPOOL d1a77b1ccb172af9ee4c7769b6f1d1f53f3b7cb1d87f7aad0c5fb64ae40302f21134a1cd05447dd766bc4408ae2dbb014db77d68a052a57131c955d3ca6453c2
diff --git a/app-crypt/mhash/files/mhash-0.9.9-autotools-namespace-stomping.patch b/app-crypt/mhash/files/mhash-0.9.9-autotools-namespace-stomping.patch
new file mode 100644
index 000000000000..19981b6b9072
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9-autotools-namespace-stomping.patch
@@ -0,0 +1,96 @@
+Per debian 473204: http://bugs.debian.org/473204, mhash exports #defines that
+are customarily autotools-private. This results in warnings when other packages
+attempt to use mhash's headers.
+
+Gentoo-Bug: 221093
+Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=221093
+Patch-URL: http://bugs.gentoo.org/attachment.cgi?id=152625&action=view
+Signed-off-by: Peter Alfredson <loki_val@gentoo.org>
+
+diff -NrU5 mhash-0.9.9.orig/configure.in mhash-0.9.9/configure.in
+--- mhash-0.9.9.orig/configure.in 2008-05-09 16:17:52.000000000 +0200
++++ mhash-0.9.9/configure.in 2008-05-09 16:18:20.000000000 +0200
+@@ -4,10 +4,11 @@
+ AC_CANONICAL_TARGET
+ 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])
+
+
+ dnl Check system.
+
+diff -NrU5 mhash-0.9.9.orig/include/mutils/config.h.in mhash-0.9.9/include/mutils/config.h.in
+--- mhash-0.9.9.orig/include/mutils/config.h.in 1970-01-01 01:00:00.000000000 +0100
++++ mhash-0.9.9/include/mutils/config.h.in 2008-05-09 16:18:20.000000000 +0200
+@@ -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 -NrU5 mhash-0.9.9.orig/include/mutils/mhash_config.h.in mhash-0.9.9/include/mutils/mhash_config.h.in
+--- mhash-0.9.9.orig/include/mutils/mhash_config.h.in 2008-05-09 16:17:52.000000000 +0200
++++ mhash-0.9.9/include/mutils/mhash_config.h.in 2008-05-09 16:19:17.000000000 +0200
+@@ -179,28 +179,10 @@
+ #undef MHASH_VERSION
+
+ /* 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
+
+ /* The size of `unsigned char', as computed by sizeof. */
+ #undef SIZEOF_UNSIGNED_CHAR
+@@ -221,13 +203,10 @@
+ #undef STDC_HEADERS
+
+ /* dmalloc */
+ #undef USE_DMALLOC
+
+-/* Version number of package */
+-#undef VERSION
+-
+ /* Define if using the dmalloc debugging malloc package */
+ #undef WITH_DMALLOC
+
+ /* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
diff --git a/app-crypt/mhash/files/mhash-0.9.9-fix-mem-leak.patch b/app-crypt/mhash/files/mhash-0.9.9-fix-mem-leak.patch
new file mode 100644
index 000000000000..74552499501f
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9-fix-mem-leak.patch
@@ -0,0 +1,27 @@
+The package app-crypt/mhash-0.9.9 as well as app-crypt/mhash-0.9.9-r1 are
+affected by a bug which causes memory to be leaked during
+mhash_restore_state_mem.
+
+In this function/patch, ret->state is allocated towards the beginning and later
+on replaced with a new allocated area without freeing the old. The patch fixes
+it.
+
+Patch already submitted upstream, but depending on speed, this may be faster to
+patch in a new patchset.
+
+Gentoo-Bug: 255006
+Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=255006
+Patch-URL: http://bugs.gentoo.org/attachment.cgi?id=178560
+Signed-off-by: Thomas Harning <harningt@gmail.com>
+
+--- mhash-0.9.9/lib/mhash.c 2007-02-21 01:18:46.000000000 -0500
++++ mhash-0.9.9-new/lib/mhash.c 2009-01-15 01:57:53.000000000 -0500
+@@ -719,6 +719,8 @@
+ 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;
diff --git a/app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch b/app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch
new file mode 100644
index 000000000000..c308269c1b24
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch
@@ -0,0 +1,27 @@
+The package app-crypt/mhash-0.9.9 as well as app-crypt/mhash-0.9.9-r1 are
+affected by a bug which causes a NULL ptr dereference in whirlpool/snefru
+digest-completion functionality.
+
+In this patch, whirlpool and snefru's code is updated to bail if 'digest' is
+NULL. The code portion aborted is only responsible for writing data to the
+digest, so this appears to be correct behavior.
+
+Patch already submitted upstream, but depending on speed, this may be faster to
+patch in a new patchset.
+
+Gentoo-Bug: 255131
+Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=255131
+Patch-URL: http://bugs.gentoo.org/attachment.cgi?id=178666&action=view
+Signed-off-by: Thomas Harning <harningt@gmail.com>
+
+--- mhash-0.9.9/lib/snefru.c 2009-01-16 00:16:04.000000000 -0500
++++ mhash-0.9.9-new/lib/snefru.c 2009-01-16 00:16:21.000000000 -0500
+@@ -859,6 +859,8 @@
+ {
+ mutils_word32 i;
+
++ if(!digest) return;
++
+ for (i = 0; i < len; i++, digest += 4)
+ {
+ *(mutils_word32 *)digest = mutils_bend2sys32(ctx->hash[i]);
diff --git a/app-crypt/mhash/files/mhash-0.9.9-fix-whirlpool-segfault.patch b/app-crypt/mhash/files/mhash-0.9.9-fix-whirlpool-segfault.patch
new file mode 100644
index 000000000000..6c79139d5793
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9-fix-whirlpool-segfault.patch
@@ -0,0 +1,27 @@
+The package app-crypt/mhash-0.9.9 as well as app-crypt/mhash-0.9.9-r1 are
+affected by a bug which causes a NULL ptr dereference in whirlpool/snefru
+digest-completion functionality.
+
+In this patch, whirlpool and snefru's code is updated to bail if 'digest' is
+NULL. The code portion aborted is only responsible for writing data to the
+digest, so this appears to be correct behavior.
+
+Patch already submitted upstream, but depending on speed, this may be faster to
+patch in a new patchset.
+
+Gentoo-Bug: 255131
+Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=255131
+Patch-URL: http://bugs.gentoo.org/attachment.cgi?id=178667&action=view
+Signed-off-by: Thomas Harning <harningt@gmail.com>
+
+--- mhash-0.9.9/lib/whirlpool.c 2006-01-08 03:14:47.000000000 -0500
++++ mhash-0.9.9-new/lib/whirlpool.c 2009-01-16 00:17:34.000000000 -0500
+@@ -970,6 +970,8 @@
+ mutils_word8 * digest)
+ {
+ mutils_word32 i;
++
++ if(!digest) return;
+ /*
+ * return the completed message digest:
+ */
diff --git a/app-crypt/mhash/files/mhash-0.9.9-mutils-align.patch b/app-crypt/mhash/files/mhash-0.9.9-mutils-align.patch
new file mode 100644
index 000000000000..32d80805f5f7
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9-mutils-align.patch
@@ -0,0 +1,118 @@
+diff -ur mhash-0.9.9.orig/lib/stdfns.c mhash-0.9.9/lib/stdfns.c
+--- mhash-0.9.9.orig/lib/stdfns.c Wed Apr 4 21:18:42 2007
++++ mhash-0.9.9/lib/stdfns.c Mon May 28 16:08:38 2007
+@@ -152,12 +152,23 @@
+ }
+ }
+
++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)
+ {
+- mutils_word8 *stmp;
+- mutils_word32 *ltmp = (mutils_word32 *) s;
++ mutils_word32 *ltmp;
+ mutils_word32 lump;
+ mutils_word32 i;
+ mutils_word32 words;
+@@ -168,10 +179,22 @@
+ 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++)
+ {
+@@ -178,12 +201,8 @@
+ *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);
+ }
+
+ static void
+@@ -275,6 +294,9 @@
+ 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)
+@@ -295,10 +317,36 @@
+ * data on a little-endian machine.
+ */
+
+- for (loop = 0, ptrIn = x, ptrOut = buffer; loop < n; loop++, ptrOut++, ptrIn++)
++ if ((mutils_word32)x & 0x3)
+ {
+- *ptrOut = mutils_lend32(*ptrIn);
++ 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
++ {
++ 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-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/metadata.xml b/app-crypt/mhash/metadata.xml
new file mode 100644
index 000000000000..e9f4f0002de5
--- /dev/null
+++ b/app-crypt/mhash/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ <name>Robin H. Johnson</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">mhash</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-crypt/mhash/mhash-0.9.9.9-r1.ebuild b/app-crypt/mhash/mhash-0.9.9.9-r1.ebuild
new file mode 100644
index 000000000000..d5905960debf
--- /dev/null
+++ b/app-crypt/mhash/mhash-0.9.9.9-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+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 arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND=""
+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}"/${P}-remove_premature_free.patch \
+ "${FILESDIR}"/${P}-force64bit-tiger.patch \
+ "${FILESDIR}"/${P}-align.patch \
+ "${FILESDIR}"/${P}-alignment.patch
+ sed -i \
+ -e 's/--netscape//' \
+ "${S}"/doc/Makefile.in
+}
+
+src_configure() {
+ # https://sourceforge.net/p/mhash/patches/11/
+ export ac_cv_func_malloc_0_nonnull=yes
+
+ econf $(use_enable static-libs static)
+}
+
+src_compile() {
+ default
+ emake -C doc mhash.html
+}
+
+src_install() {
+ default
+
+ use static-libs || rm -f "${ED}"usr/lib*/libmhash.la
+ dodoc AUTHORS ChangeLog NEWS README THANKS TODO \
+ doc/{example.c,skid2-authentication}
+ dohtml doc/mhash.html
+}