summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-crypt/mhash')
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-autotools-namespace-stomping.patch15
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-fix-mem-leak.patch4
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-fix-snefru-segfault.patch4
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9-fix-whirlpool-segfault.patch4
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-align.patch5
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-alignment.patch5
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-cast-temp-64bit.patch13
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-force64bit-tiger.patch5
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-hmac-uaf-test.patch19
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-no-malloc-check.patch20
-rw-r--r--app-crypt/mhash/files/mhash-0.9.9.9-remove_premature_free.patch5
-rw-r--r--app-crypt/mhash/files/mhash.pc4
-rw-r--r--app-crypt/mhash/metadata.xml6
-rw-r--r--app-crypt/mhash/mhash-0.9.9.9-r2.ebuild58
-rw-r--r--app-crypt/mhash/mhash-0.9.9.9-r3.ebuild69
15 files changed, 148 insertions, 88 deletions
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
index 19981b6b9072..4bccf6765ae0 100644
--- 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
@@ -7,9 +7,8 @@ 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
+--- a/configure.in
++++ b/configure.in
@@ -4,10 +4,11 @@
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR([lib/mhash.c])
@@ -22,9 +21,8 @@ diff -NrU5 mhash-0.9.9.orig/configure.in mhash-0.9.9/configure.in
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
+--- a/include/mutils/config.h.in
++++ b/include/mutils/config.h.in
@@ -0,0 +1,22 @@
+/* Name of package */
+#undef PACKAGE
@@ -48,9 +46,8 @@ diff -NrU5 mhash-0.9.9.orig/include/mutils/config.h.in mhash-0.9.9/include/mutil
+#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
+--- a/include/mutils/mhash_config.h.in
++++ b/include/mutils/mhash_config.h.in
@@ -179,28 +179,10 @@
#undef MHASH_VERSION
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
index 74552499501f..f6083eb180f5 100644
--- 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
@@ -14,8 +14,8 @@ 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
+--- a/lib/mhash.c
++++ b/lib/mhash.c
@@ -719,6 +719,8 @@
mutils_memcpy( &ret->state_size, &mem[pos], sizeof(ret->state_size));
pos += sizeof( ret->state_size);
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
index c308269c1b24..6e9e0275b025 100644
--- 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
@@ -14,8 +14,8 @@ 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
+--- a/lib/snefru.c
++++ b/lib/snefru.c
@@ -859,6 +859,8 @@
{
mutils_word32 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
index 6c79139d5793..8437e624b2ee 100644
--- 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
@@ -14,8 +14,8 @@ 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
+--- a/lib/whirlpool.c
++++ b/lib/whirlpool.c
@@ -970,6 +970,8 @@
mutils_word8 * 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
index 04bb310aa772..81486034cb6a 100644
--- a/app-crypt/mhash/files/mhash-0.9.9.9-align.patch
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-align.patch
@@ -1,6 +1,5 @@
-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
+--- a/lib/stdfns.c
++++ b/lib/stdfns.c
@@ -152,6 +152,18 @@ mutils_bzero(void *s, __const mutils_wor
}
}
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
index 04df22167a3f..0df89bc84865 100644
--- a/app-crypt/mhash/files/mhash-0.9.9.9-alignment.patch
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-alignment.patch
@@ -1,6 +1,5 @@
-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
+--- a/lib/stdfns.c
++++ b/lib/stdfns.c
@@ -378,6 +378,12 @@ mutils_memmove(void *dest, __const void
bigptr1 = (mutils_word32 *) dest;
bigptr2 = (mutils_word32 *) src;
diff --git a/app-crypt/mhash/files/mhash-0.9.9.9-cast-temp-64bit.patch b/app-crypt/mhash/files/mhash-0.9.9.9-cast-temp-64bit.patch
new file mode 100644
index 000000000000..3b173f8072cb
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-cast-temp-64bit.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/tiger.c b/lib/tiger.c
+index 8f15df4..8d28f27 100644
+--- a/lib/tiger.c
++++ b/lib/tiger.c
+@@ -254,7 +254,7 @@ void tiger_final(struct tiger_ctx *ctx)
+ register mutils_word64 i, j;
+ /* Force 64-bit alignment */
+ mutils_word64 temp_64bit[TIGER_DATASIZE/8];
+- mutils_word8 *temp = temp_64bit;
++ mutils_word8 *temp = (mutils_word8 *) temp_64bit;
+ i = ctx->index;
+
+ #if defined(WORDS_BIGENDIAN)
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
index 2248bcc6a308..08f18d458285 100644
--- 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
@@ -1,6 +1,5 @@
-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
+--- a/lib/tiger.c
++++ b/lib/tiger.c
@@ -252,7 +252,9 @@ void tiger_update(struct tiger_ctx *ctx,
void tiger_final(struct tiger_ctx *ctx)
{
diff --git a/app-crypt/mhash/files/mhash-0.9.9.9-hmac-uaf-test.patch b/app-crypt/mhash/files/mhash-0.9.9.9-hmac-uaf-test.patch
new file mode 100644
index 000000000000..cd9b3c041891
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-hmac-uaf-test.patch
@@ -0,0 +1,19 @@
+https://bugs.gentoo.org/914173
+https://sourceforge.net/p/mhash/patches/12/
+https://sourceforge.net/p/mhash/bugs/43/
+
+Fixes a segfault due to use-after-free on x86 & ARM in the test suite.
+
+Index: mhash-0.9.9.9/src/hmac_test.c
+===================================================================
+--- mhash-0.9.9.9/src/hmac_test.c
++++ mhash-0.9.9.9/src/hmac_test.c 2020-04-01 00:04:44.039815882 +0200
+@@ -76,8 +76,6 @@
+
+ /* Test No 2 */
+
+- mutils_memset(tmp, 0, sizeof(tmp));
+-
+ passlen=sizeof(KEY2) - 1;
+ password = (mutils_word8 *) mutils_malloc(passlen+1);
+ mutils_memcpy(password, KEY2, passlen);
diff --git a/app-crypt/mhash/files/mhash-0.9.9.9-no-malloc-check.patch b/app-crypt/mhash/files/mhash-0.9.9.9-no-malloc-check.patch
new file mode 100644
index 000000000000..6da1f98ac785
--- /dev/null
+++ b/app-crypt/mhash/files/mhash-0.9.9.9-no-malloc-check.patch
@@ -0,0 +1,20 @@
+https://sourceforge.net/p/mhash/patches/11/
+
+Compiling mhash-0.9.9.9 on platforms (like AIX) without GNU libc compatible malloc leads to undefined symbol rpl_malloc
+when linking the in-mhash executables drver, frag_test, rest_test, hmac_test, keygen_test.
+
+Reason is that configure.in still contains AC_FUNC_MALLOC, detecting need
+to "#define malloc rpl_malloc", while mhash does not provide a rpl_malloc implementation.
+
+As the only use of malloc() in lib/stdfns.c does not rely on GNU libc
+compatible malloc actually, there is no need to check for one.
+--- a/configure.in
++++ b/configure.in
+@@ -64,7 +64,6 @@ AC_CHECK_HEADERS(signal.h stdint.h stdio.h stdlib.h string.h strings.h)
+
+ dnl Checks for functions
+
+-AC_FUNC_MALLOC
+ AC_FUNC_MEMCMP
+
+ AC_CHECK_FUNCS(bcopy bzero)
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
index 5ed4ecbe6292..f81ec66b6f9c 100644
--- 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
@@ -1,6 +1,5 @@
-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
+--- a/src/keygen_test.c
++++ b/src/keygen_test.c
@@ -121,8 +121,6 @@
mhash_keygen_ext(KEYGEN_S2K_SALTED, data, key, keysize, password, passlen);
diff --git a/app-crypt/mhash/files/mhash.pc b/app-crypt/mhash/files/mhash.pc
new file mode 100644
index 000000000000..6186f85c7839
--- /dev/null
+++ b/app-crypt/mhash/files/mhash.pc
@@ -0,0 +1,4 @@
+Libs:-lmhash
+Name: mhash
+Version: @VERSION@
+Description: provides a uniform interface to several hash algorithms
diff --git a/app-crypt/mhash/metadata.xml b/app-crypt/mhash/metadata.xml
index 101ee8a0b3fe..11aead93f452 100644
--- a/app-crypt/mhash/metadata.xml
+++ b/app-crypt/mhash/metadata.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
-<upstream>
- <remote-id type="sourceforge">mhash</remote-id>
+ <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
deleted file mode 100644
index f65cb7282db5..000000000000
--- a/app-crypt/mhash/mhash-0.9.9.9-r2.ebuild
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-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 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="static-libs"
-
-BDEPEND="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 || die
-}
-
-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
- find "${D}" -name '*.la' -delete || die
-}
diff --git a/app-crypt/mhash/mhash-0.9.9.9-r3.ebuild b/app-crypt/mhash/mhash-0.9.9.9-r3.ebuild
new file mode 100644
index 000000000000..9a04113bf6bf
--- /dev/null
+++ b/app-crypt/mhash/mhash-0.9.9.9-r3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Library providing a uniform interface to a large number of hash algorithms"
+HOMEPAGE="https://mhash.sourceforge.net/"
+SRC_URI="https://downloads.sourceforge.net/mhash/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="static-libs"
+
+BDEPEND="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
+ "${FILESDIR}"/${P}-no-malloc-check.patch
+ "${FILESDIR}"/${P}-hmac-uaf-test.patch
+ "${FILESDIR}"/${P}-cast-temp-64bit.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 || die
+
+ sed \
+ -e "s:@VERSION@:${PV}:" \
+ "${FILESDIR}"/${PN}.pc > ${PN}.pc || die
+
+ # Refresh bundled libtool (ltmain.sh)
+ # (elibtoolize is not sufficient)
+ # bug #668666
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_compile() {
+ default
+
+ emake -C doc mhash.html
+}
+
+src_install() {
+ default
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins ${PN}.pc
+ find "${ED}" -name '*.la' -delete || die
+}