diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /app-crypt/mhash |
reinit the tree, so we can have metadata
Diffstat (limited to 'app-crypt/mhash')
-rw-r--r-- | app-crypt/mhash/Manifest | 13 | ||||
-rw-r--r-- | app-crypt/mhash/files/mhash-0.9.9-autotools-namespace-stomping.patch | 96 | ||||
-rw-r--r-- | app-crypt/mhash/files/mhash-0.9.9-fix-mem-leak.patch | 27 | ||||
-rw-r--r-- | app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch | 27 | ||||
-rw-r--r-- | app-crypt/mhash/files/mhash-0.9.9-fix-whirlpool-segfault.patch | 27 | ||||
-rw-r--r-- | app-crypt/mhash/files/mhash-0.9.9.9-align.patch | 119 | ||||
-rw-r--r-- | app-crypt/mhash/files/mhash-0.9.9.9-alignment.patch | 16 | ||||
-rw-r--r-- | app-crypt/mhash/files/mhash-0.9.9.9-force64bit-tiger.patch | 14 | ||||
-rw-r--r-- | app-crypt/mhash/files/mhash-0.9.9.9-remove_premature_free.patch | 12 | ||||
-rw-r--r-- | app-crypt/mhash/metadata.xml | 11 | ||||
-rw-r--r-- | app-crypt/mhash/mhash-0.9.9.9-r2.ebuild | 60 |
11 files changed, 422 insertions, 0 deletions
diff --git a/app-crypt/mhash/Manifest b/app-crypt/mhash/Manifest new file mode 100644 index 000000000000..b4d9fd094135 --- /dev/null +++ b/app-crypt/mhash/Manifest @@ -0,0 +1,13 @@ +AUX mhash-0.9.9-autotools-namespace-stomping.patch 3087 SHA256 42dba3baa4c1fe43104b026c3ad4903e6ba2ee043268336a3e84a7b66cb8fa0e SHA512 f32bcbf244aa38755b99c0bb1b328974a9dc6b927bf56073061821827f7b2017c98eb042d11f52d0befb654c58db6540fe1bec0ce7d5f980bfd26914ac49b596 WHIRLPOOL ba70f44cc758c9bf963fd8b874d6d6a1a753fc721588bc76c904eb6899adc7512827b35f3b1ed551bb142f9b3b1ebac718b5c906cde7c2aba53fb98f84c7d7d6 +AUX mhash-0.9.9-fix-mem-leak.patch 1016 SHA256 87cd9ce4cda5f1fd18f629595f8d468b3600586207bf2b4c37c7091382cfb3c0 SHA512 2255a24f1053ef657750196fbf3e07cb68fc630db5d07356e048a4470a99b2eeeb932a7ecc344211b08bb705a176083f7f36bf0cf245ae684d8cc76b37dcbac0 WHIRLPOOL 3b01647ee05265a6785886dcbddfd6adfd86919a7636509feacddae28475db356701dd199a6fa6392a09a65c9d36ef133092b3f73418c83ed8022b686f4ffb41 +AUX mhash-0.9.9-fix-snefru-segfault.patch 1005 SHA256 f35b6aed2c48fcf7cc43c40475786d0d583b0fd38cf3fa470f6c7d139d51864f SHA512 20f23f4d3ba20b61942e09915fa3e355f679f3e9747fec888d1c576c0e7144611b432cf005184938b86d080d8e626bc31af6ea2877762ec3e3205563b5cbfb09 WHIRLPOOL 0d70787f7e7950c82837d875f547d0bc7bbd4a4321da18649f7e9f506be25dd58c92267d5ee5694435154f35fa3bad20cc21aaaaaf0113e8621e33df1fcecbeb +AUX mhash-0.9.9-fix-whirlpool-segfault.patch 1011 SHA256 cbf742203022b6a0ab64dd927c084ccfdc07da31ee5a180371b102dccf177795 SHA512 4132174e3b1bf08a296fb36a1bc516eedc79d59c5bd5f17e32ddcf70ad243e24bc733fecafe9bbc3a776c573022496ab2593a0201d3576ebf94402588a4f4889 WHIRLPOOL cdf6596a2c5a641ac948a57e31fc1bba9ef9165465c5d8991ace196a8253c6e928f48c6e82956565b1fdd2d4efda1d5f13269acefc89138225e67385fd5f4916 +AUX mhash-0.9.9.9-align.patch 3037 SHA256 cef76a48a440d428d529746afec665ae9cb78f27d8303886f8b0ea3b12077125 SHA512 ce52d1caf3f9dc5bcc388aefacebb93fd422f905ab82f4d7aa6b66ac4ecfcbd32d576778cf3c0ad34f48461a016a08f2cc9ea7063fcb1f29b5188dea04f1ae03 WHIRLPOOL fdd3ed7caeb213b0eff3c82e2aab1a2ad943f3884f16bda7915c7696398acfe2ef1996d23bee721aba291a6d0c00274d6bbd5027a4e65831a0e31949d8cd453d +AUX mhash-0.9.9.9-alignment.patch 579 SHA256 f64d52ebe5018a9d850ef33afe94c4488f695bb1948dfe6e57697f1ff4d75d06 SHA512 6272d5e346067861235b8c5cbb5f4ec1bbb1cd80910ea913860e09ed34661df02ed3d4ed9fa55e870d7e22827fad84cc56bb701195908acca435643018fe81d3 WHIRLPOOL 3b123c494991cfa8374550afb2a8a07a303622e715dc13c8d2c1360fdeb4b7443f9bf7b1a5235f8dfd3ffe5e40a8aaf6985c2ac9e931a939c2a733fdaf2cea07 +AUX mhash-0.9.9.9-force64bit-tiger.patch 537 SHA256 708b048c79270330eb072118b5fdb3338900da9ddc0b6bf4ac3260c7d02593e0 SHA512 7ca2118569ad28107672f081fa4d06758bc78da48612ba31d6655e91ebf4928055b1643a012d60538b915b05d906adf23a8aeb3d7b9f5d8c12eaf1058b9f5454 WHIRLPOOL a2c40f9c6f455027ed336200d00afde7b559ed22bf9bed2824eff131c023fc701c1dae23ecc3be723cec435e5316a469db3e23c83cb1f14c276643d705639f7f +AUX mhash-0.9.9.9-remove_premature_free.patch 464 SHA256 b750eef6fb406eb73e2ea46ac6d173587e8a75bdeba75bdb57f572e596844e53 SHA512 f8f9814c39890f14e760c6600998b628db27ca52efd864be123b646425be1edd106179840d8720c36948cfe509d2b320fd98c2aee0b3fcc7ae1fac8ccdba792e WHIRLPOOL 62ac0710bb716d0217f77726e8e5a47cd667d57ecc6112dbf17a5e3f89deca509d1db956ad79c7c207b9ebd2c9d2b5096e8ec1638584123efc41c4fbbaf9428e +DIST mhash-0.9.9.9.tar.gz 931437 SHA256 3dcad09a63b6f1f634e64168dd398e9feb9925560f9b671ce52283a79604d13e SHA512 82ad8b8e9b0463c5a14f5c0e572badc42c4697bac5505443b144287b3f8510b1410721b4277f092a0d6045c4342e997831011cdfcbfa8f1dae6edd5d9e3cefee WHIRLPOOL d1a77b1ccb172af9ee4c7769b6f1d1f53f3b7cb1d87f7aad0c5fb64ae40302f21134a1cd05447dd766bc4408ae2dbb014db77d68a052a57131c955d3ca6453c2 +EBUILD mhash-0.9.9.9-r2.ebuild 1453 SHA256 ebb2af9fae385e3a8b3497c40319e0b77e11e099086b738f37733e701b819c79 SHA512 dd8fc19c9504c1e61b25593c9c428a4562bfca7b4a129bdfe0ec541b9f1a5967a354db34336ad5a93587a0bf1e9cc6d1e6237dc093e967403c2e2fa8c3d5a6cd WHIRLPOOL 94209e46c2010eb4ce35fa08aa736b69ce136294adf57b3942e7863577c67ffb39e4b75e5b61d6c12fd5cd04cdd38fa0f23069238807ade68bb81ffe9d70d273 +MISC ChangeLog 2592 SHA256 fe59285f96aa727c42eb4a146c58d5e764c8fac0060f441c2b90ed58670418f6 SHA512 2bdf2713cbadc6ce26ac691cc87b49bf210e75cc9db0d6bba4b2f711a37a3dd45ebd1c8b52b6da61943e098c56dac57b803d18be895543c85df58d40775041ea WHIRLPOOL 946603b5173bf5f764864600ce309520cd8ee74bae55576b34dbc86f5cb4ea88ae014e7243c5910c6360dbb912f4788755758ebf93407b474576952187c42acc +MISC ChangeLog-2015 8953 SHA256 4fa39e356da5c9318e0a0946e8e0dcb36c11f19011e8bfdebc0011fbd07aa3ef SHA512 4cc3126f2e9d49aa3578620b8ee84c7bc028765ccc6cc8672f9f6dcc44942097296910925e54d64f0753714c6adf16c98d96654d3c5d14f7bc6928957fbe4e80 WHIRLPOOL 4225dd9731f15b121ea64cb960a0c548640959c369ad57473d199126599e9d53919797dc0c4184d61d22933ce786e39306e0682e3bdeae4b99a5293a7aec71fa +MISC metadata.xml 325 SHA256 5a9d0d4cbaeac26bb9dd267d8739e6412899f8a5a169dd6ecbb546755faeb03a SHA512 32c365b53e7c9d2a3c6dcef43cc33163a690a0e2f3401e275d3511faa388149ade4b9f5c583307f5b94e6df005796b4ec935ecf35c6cda8d236e46ed0ab7336c WHIRLPOOL a3b828e57608ee232a3b8a2b04230f3ff1a564a90b0e5c4d44eb463c2ce62a1927f4df7e0fc82382c034c4c93df60d114d25f11256db6216af78c7af42fa57ad 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.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..4d45a5368800 --- /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 type="project"> + <email>crypto@gentoo.org</email> + <name>Crypto</name> + </maintainer> + <upstream> + <remote-id type="sourceforge">mhash</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-crypt/mhash/mhash-0.9.9.9-r2.ebuild b/app-crypt/mhash/mhash-0.9.9.9-r2.ebuild new file mode 100644 index 000000000000..e719837a52ad --- /dev/null +++ b/app-crypt/mhash/mhash-0.9.9.9-r2.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit ltprune + +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 ~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 + +PATCHES=( + "${FILESDIR}/${PN}-0.9.9-fix-mem-leak.patch" + "${FILESDIR}/${PN}-0.9.9-fix-snefru-segfault.patch" + "${FILESDIR}/${PN}-0.9.9-fix-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" +) + +DOCS=( + doc/example.c + doc/skid2-authentication +) +HTML_DOCS=( + doc/mhash.html +) + +src_prepare() { + default + 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 + prune_libtool_files +} |