summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-crypt/mhash')
-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-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.pc4
-rw-r--r--app-crypt/mhash/metadata.xml4
-rw-r--r--app-crypt/mhash/mhash-0.9.9.9-r3.ebuild (renamed from app-crypt/mhash/mhash-0.9.9.9-r2.ebuild)24
6 files changed, 73 insertions, 11 deletions
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-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.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 dad2754fed37..11aead93f452 100644
--- a/app-crypt/mhash/metadata.xml
+++ b/app-crypt/mhash/metadata.xml
@@ -2,7 +2,7 @@
<!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-r3.ebuild
index 55e78bbb25fe..9a04113bf6bf 100644
--- a/app-crypt/mhash/mhash-0.9.9.9-r2.ebuild
+++ b/app-crypt/mhash/mhash-0.9.9.9-r3.ebuild
@@ -1,17 +1,17 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit autotools
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"
+HOMEPAGE="https://mhash.sourceforge.net/"
+SRC_URI="https://downloads.sourceforge.net/mhash/${P}.tar.gz"
-LICENSE="GPL-2"
+LICENSE="GPL-2+"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+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
@@ -25,6 +25,9 @@ PATCHES=(
"${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 )
@@ -38,6 +41,10 @@ src_prepare() {
-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
@@ -45,9 +52,6 @@ src_prepare() {
}
src_configure() {
- # https://sourceforge.net/p/mhash/patches/11/
- export ac_cv_func_malloc_0_nonnull=yes
-
econf $(use_enable static-libs static)
}
@@ -59,5 +63,7 @@ src_compile() {
src_install() {
default
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins ${PN}.pc
find "${ED}" -name '*.la' -delete || die
}