mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-14 16:37:01 +02:00
app-crypt/{m,s}hash: Drop unused packages
This commit is contained in:
parent
b28e80ccc7
commit
3fbf8ced1c
@ -123,12 +123,10 @@ app-crypt/gnupg
|
|||||||
app-crypt/gpgme
|
app-crypt/gpgme
|
||||||
app-crypt/libb2
|
app-crypt/libb2
|
||||||
app-crypt/libmd
|
app-crypt/libmd
|
||||||
app-crypt/mhash
|
|
||||||
app-crypt/mit-krb5
|
app-crypt/mit-krb5
|
||||||
app-crypt/p11-kit
|
app-crypt/p11-kit
|
||||||
app-crypt/pinentry
|
app-crypt/pinentry
|
||||||
app-crypt/rhash
|
app-crypt/rhash
|
||||||
app-crypt/shash
|
|
||||||
app-crypt/tpm2-tools
|
app-crypt/tpm2-tools
|
||||||
app-crypt/tpm2-tss
|
app-crypt/tpm2-tss
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
DIST mhash-0.9.9.9.tar.gz 931437 BLAKE2B 2daed92b731148c388d4340e67d99959f71783e68617614c9be797dae655ba1aeb087d4f604015edb752dedc2d69add305510996a06633ef26fd997ab7601bed SHA512 82ad8b8e9b0463c5a14f5c0e572badc42c4697bac5505443b144287b3f8510b1410721b4277f092a0d6045c4342e997831011cdfcbfa8f1dae6edd5d9e3cefee
|
|
@ -1,93 +0,0 @@
|
|||||||
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>
|
|
||||||
|
|
||||||
--- a/configure.in
|
|
||||||
+++ b/configure.in
|
|
||||||
@@ -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.
|
|
||||||
|
|
||||||
--- a/include/mutils/config.h.in
|
|
||||||
+++ b/include/mutils/config.h.in
|
|
||||||
@@ -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
|
|
||||||
+
|
|
||||||
+
|
|
||||||
--- a/include/mutils/mhash_config.h.in
|
|
||||||
+++ b/include/mutils/mhash_config.h.in
|
|
||||||
@@ -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). */
|
|
@ -1,27 +0,0 @@
|
|||||||
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>
|
|
||||||
|
|
||||||
--- 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);
|
|
||||||
|
|
||||||
+ if (ret->state)
|
|
||||||
+ mutils_free(ret->state);
|
|
||||||
ret->state = mutils_malloc(ret->state_size);
|
|
||||||
if (ret->state==NULL)
|
|
||||||
goto freeall;
|
|
@ -1,27 +0,0 @@
|
|||||||
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>
|
|
||||||
|
|
||||||
--- a/lib/snefru.c
|
|
||||||
+++ b/lib/snefru.c
|
|
||||||
@@ -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]);
|
|
@ -1,27 +0,0 @@
|
|||||||
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>
|
|
||||||
|
|
||||||
--- a/lib/whirlpool.c
|
|
||||||
+++ b/lib/whirlpool.c
|
|
||||||
@@ -970,6 +970,8 @@
|
|
||||||
mutils_word8 * digest)
|
|
||||||
{
|
|
||||||
mutils_word32 i;
|
|
||||||
+
|
|
||||||
+ if(!digest) return;
|
|
||||||
/*
|
|
||||||
* return the completed message digest:
|
|
||||||
*/
|
|
@ -1,118 +0,0 @@
|
|||||||
--- a/lib/stdfns.c
|
|
||||||
+++ b/lib/stdfns.c
|
|
||||||
@@ -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);
|
|
@ -1,15 +0,0 @@
|
|||||||
--- 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;
|
|
||||||
|
|
||||||
+ /* 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);
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
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)
|
|
@ -1,13 +0,0 @@
|
|||||||
--- 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)
|
|
||||||
{
|
|
||||||
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)
|
|
@ -1,19 +0,0 @@
|
|||||||
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);
|
|
@ -1,20 +0,0 @@
|
|||||||
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)
|
|
@ -1,11 +0,0 @@
|
|||||||
--- 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);
|
|
||||||
|
|
||||||
- mutils_memset(tmp, 0, keysize * 2);
|
|
||||||
-
|
|
||||||
tmp = mutils_asciify(key, keysize);
|
|
||||||
|
|
||||||
result = mutils_strcmp((mutils_word8 *) KEY2, tmp);
|
|
@ -1,4 +0,0 @@
|
|||||||
Libs:-lmhash
|
|
||||||
Name: mhash
|
|
||||||
Version: @VERSION@
|
|
||||||
Description: provides a uniform interface to several hash algorithms
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<!-- maintainer-needed -->
|
|
||||||
<upstream>
|
|
||||||
<remote-id type="sourceforge">mhash</remote-id>
|
|
||||||
</upstream>
|
|
||||||
</pkgmetadata>
|
|
@ -1,72 +0,0 @@
|
|||||||
# Copyright 1999-2024 Gentoo Authors
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI=8
|
|
||||||
|
|
||||||
inherit autotools flag-o-matic
|
|
||||||
|
|
||||||
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 ~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() {
|
|
||||||
# bug #943960
|
|
||||||
append-cflags -std=gnu17
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
DIST shash-0.2.6.tar.gz 105641 BLAKE2B f7421aa9ed7b242e14a585461e96f44e35f1acf38cba358807ec06e6678c82f7f3b070a218de71cccde9f18a1e7e13f8dd4cf66b48e9d6626f16b2e1fc33757d SHA512 340a59bd16b3e5069a076b56f8fe24d2306a6ddd5e6ad564c5e17a992d8e279a7109ba39bd5caa8438a0e85b4f94cb0878228f7aefe38221ff6efa80df64086b
|
|
@ -1,29 +0,0 @@
|
|||||||
--- a/doc/shash.1
|
|
||||||
+++ b/doc/shash.1
|
|
||||||
@@ -31,7 +31,7 @@ Because of this shash also supports HMAC
|
|
||||||
a mechanism for message authentication using cryptographic hash functions.
|
|
||||||
So shash can use a key with a hash algorithm to produce hashes that can only
|
|
||||||
be verified with the key. This way you can securely check (i.e. you are sure
|
|
||||||
-that nobody can modify the mac, without beeing detected)
|
|
||||||
+that nobody can modify the mac, without being detected)
|
|
||||||
if files in a filesystem were altered.
|
|
||||||
|
|
||||||
If the list of files and digests, that shash produces, is stored as
|
|
||||||
@@ -72,7 +72,7 @@ Suppress some not critical warnings.
|
|
||||||
.TP
|
|
||||||
.B \-b
|
|
||||||
Use binary mode. In unix environment, only difference between this and
|
|
||||||
-the normal mode is an asterix preceding the filename in the output.
|
|
||||||
+the normal mode is an asterisk preceding the filename in the output.
|
|
||||||
.TP
|
|
||||||
.B \-c
|
|
||||||
Check the checksum of all files listed in
|
|
||||||
@@ -94,7 +94,7 @@ Enter the keyword via the command line.
|
|
||||||
keyword instead of prompting for it. Keep in mind that someone
|
|
||||||
may see the command you are executing and so your key.
|
|
||||||
.TP
|
|
||||||
-.B \-c --config FILE
|
|
||||||
+.B \-i --config FILE
|
|
||||||
Use the specified configuration file. The default is .shashrc
|
|
||||||
in your home directory. The format of the configuration
|
|
||||||
file is the same as the parameters. An example file is:
|
|
@ -1,195 +0,0 @@
|
|||||||
--- a/src/environ.c
|
|
||||||
+++ b/src/environ.c
|
|
||||||
@@ -4,7 +4,7 @@
|
|
||||||
#endif
|
|
||||||
#include "environ.h"
|
|
||||||
|
|
||||||
-int check_env()
|
|
||||||
+int check_env(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (getenv(SHASH_KEY) != NULL
|
|
||||||
@@ -15,7 +15,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
|
||||||
- get_env_key()
|
|
||||||
+ get_env_key(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (getenv(SHASH_KEY) != NULL) {
|
|
||||||
@@ -26,7 +26,7 @@
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
-char *get_env_bit_mode()
|
|
||||||
+char *get_env_bit_mode(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
return getenv(SHASH_KEYMODE);
|
|
||||||
--- a/src/environ.h
|
|
||||||
+++ b/src/environ.h
|
|
||||||
@@ -3,7 +3,7 @@
|
|
||||||
#define SHASH_KEY "SHASH_KEY"
|
|
||||||
#define SHASH_KEYMODE "SHASH_KEYMODE"
|
|
||||||
|
|
||||||
-int check_env();
|
|
||||||
-char * get_env_key();
|
|
||||||
-char * get_env_bit_mode();
|
|
||||||
+int check_env(void);
|
|
||||||
+char * get_env_key(void);
|
|
||||||
+char * get_env_bit_mode(void);
|
|
||||||
|
|
||||||
--- a/src/errors.c
|
|
||||||
+++ b/src/errors.c
|
|
||||||
@@ -1,5 +1,7 @@
|
|
||||||
#include <defines.h>
|
|
||||||
|
|
||||||
+#include <stdio.h>
|
|
||||||
+
|
|
||||||
extern int quiet;
|
|
||||||
|
|
||||||
void err_quit(char *errmsg)
|
|
||||||
--- a/src/extra.c
|
|
||||||
+++ b/src/extra.c
|
|
||||||
@@ -1,5 +1,10 @@
|
|
||||||
#include <defines.h>
|
|
||||||
|
|
||||||
+#include <pwd.h>
|
|
||||||
+#include <stdlib.h>
|
|
||||||
+#include <string.h>
|
|
||||||
+#include <sys/stat.h>
|
|
||||||
+
|
|
||||||
#ifdef HAVE_STAT
|
|
||||||
|
|
||||||
int check_file(char *filename)
|
|
||||||
--- a/src/gaaout.c
|
|
||||||
+++ b/src/gaaout.c
|
|
||||||
@@ -11,6 +11,11 @@
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+void hash_license(void);
|
|
||||||
+void hash_version(void);
|
|
||||||
+void list_keygen_algorithms(void);
|
|
||||||
+int hash_list(void);
|
|
||||||
+
|
|
||||||
void* gaa_malloc( size_t size) {
|
|
||||||
void* ret;
|
|
||||||
ret = malloc(size);
|
|
||||||
--- a/src/random.c
|
|
||||||
+++ b/src/random.c
|
|
||||||
@@ -24,7 +24,7 @@
|
|
||||||
static FILE *ffd;
|
|
||||||
|
|
||||||
word32
|
|
||||||
-get_rand32()
|
|
||||||
+get_rand32(void)
|
|
||||||
{
|
|
||||||
int fd, x;
|
|
||||||
word32 rand_data;
|
|
||||||
@@ -46,7 +46,7 @@
|
|
||||||
|
|
||||||
|
|
||||||
word8
|
|
||||||
-get_rand8()
|
|
||||||
+get_rand8(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
int fd, x;
|
|
||||||
@@ -69,7 +69,7 @@
|
|
||||||
|
|
||||||
|
|
||||||
word32
|
|
||||||
-get_safe_rand32()
|
|
||||||
+get_safe_rand32(void)
|
|
||||||
{
|
|
||||||
int fd, x;
|
|
||||||
word32 rand_data;
|
|
||||||
@@ -91,7 +91,7 @@
|
|
||||||
|
|
||||||
|
|
||||||
word8
|
|
||||||
-get_safe_rand8()
|
|
||||||
+get_safe_rand8(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
int fd, x;
|
|
||||||
@@ -131,13 +131,13 @@
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-void close_rand()
|
|
||||||
+void close_rand(void)
|
|
||||||
{
|
|
||||||
fclose(ffd);
|
|
||||||
}
|
|
||||||
|
|
||||||
word32
|
|
||||||
-get_o_rand32()
|
|
||||||
+get_o_rand32(void)
|
|
||||||
{
|
|
||||||
int x;
|
|
||||||
word32 rand_data;
|
|
||||||
@@ -152,7 +152,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
word8
|
|
||||||
-get_o_rand8()
|
|
||||||
+get_o_rand8(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
int x;
|
|
||||||
--- a/src/random.h
|
|
||||||
+++ b/src/random.h
|
|
||||||
@@ -1,14 +1,14 @@
|
|
||||||
|
|
||||||
#ifdef HAVE_DEV_RANDOM
|
|
||||||
|
|
||||||
-word32 get_rand32();
|
|
||||||
-word8 get_rand8();
|
|
||||||
-word32 get_safe_rand32();
|
|
||||||
-word8 get_safe_rand8();
|
|
||||||
+word32 get_rand32(void);
|
|
||||||
+word8 get_rand8(void);
|
|
||||||
+word32 get_safe_rand32(void);
|
|
||||||
+word8 get_safe_rand8(void);
|
|
||||||
|
|
||||||
int open_rand(int);
|
|
||||||
-void close_rand();
|
|
||||||
-word32 get_o_rand32();
|
|
||||||
-word8 get_o_rand8();
|
|
||||||
+void close_rand(void);
|
|
||||||
+word32 get_o_rand32(void);
|
|
||||||
+word8 get_o_rand8(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
--- a/src/shash.c
|
|
||||||
+++ b/src/shash.c
|
|
||||||
@@ -485,7 +485,7 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-int hash_list()
|
|
||||||
+int hash_list(void)
|
|
||||||
{
|
|
||||||
hashid i;
|
|
||||||
char *y;
|
|
||||||
@@ -715,7 +715,7 @@
|
|
||||||
return counter;
|
|
||||||
}
|
|
||||||
|
|
||||||
-void hash_license()
|
|
||||||
+void hash_license(void)
|
|
||||||
{
|
|
||||||
fprintf(stdout, ("\nCopyright (C) 1999,2001,2002 Nikos Mavroyanopoulos\n"
|
|
||||||
"This program is free software; you can redistribute it and/or modify \n"
|
|
||||||
@@ -733,7 +733,7 @@
|
|
||||||
"Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
-void hash_version()
|
|
||||||
+void hash_version(void)
|
|
||||||
{
|
|
||||||
fprintf(stderr, ("shash v.%s (%s-%s-%s)\n"), VERSION, T_CPU,
|
|
||||||
T_VENDOR, T_OS);
|
|
@ -1,34 +0,0 @@
|
|||||||
--- a/src/shash.c
|
|
||||||
+++ b/src/shash.c
|
|
||||||
@@ -631,11 +631,11 @@
|
|
||||||
|
|
||||||
if (nosalt == FALSE && hmac == 1) {
|
|
||||||
if (sscanf
|
|
||||||
- (linebuf, "%s %s %s\n", hexbuffer, buffer,
|
|
||||||
- buffer2) < 2) {
|
|
||||||
+ (linebuf, "%s %s *%s\n", hexbuffer, buffer,
|
|
||||||
+ buffer2) != 3) {
|
|
||||||
if (sscanf
|
|
||||||
- (linebuf, "%s %s *%s\n", hexbuffer,
|
|
||||||
- buffer, buffer2) < 2)
|
|
||||||
+ (linebuf, "%s %s %s\n", hexbuffer,
|
|
||||||
+ buffer, buffer2) != 3)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -648,11 +648,11 @@
|
|
||||||
key = pass2key(algorithm, keymode_buffer, &keylen, password, plen);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
- if (sscanf(linebuf, "%s %s\n", buffer, buffer2) ==
|
|
||||||
- 0) {
|
|
||||||
+ if (sscanf(linebuf, "%s *%s\n", buffer, buffer2) !=
|
|
||||||
+ 2) {
|
|
||||||
if (sscanf
|
|
||||||
- (linebuf, "%s *%s\n", buffer,
|
|
||||||
- buffer2) == 0)
|
|
||||||
+ (linebuf, "%s %s\n", buffer,
|
|
||||||
+ buffer2) != 2)
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
--- a/src/errors.c
|
|
||||||
+++ b/src/errors.c
|
|
||||||
@@ -4,7 +4,7 @@
|
|
||||||
|
|
||||||
void err_quit(char *errmsg)
|
|
||||||
{
|
|
||||||
- fprintf(stderr, errmsg);
|
|
||||||
+ fputs(errmsg, stderr);
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@
|
|
||||||
{
|
|
||||||
|
|
||||||
if (quiet < 1) {
|
|
||||||
- fprintf(stderr, errmsg);
|
|
||||||
+ fputs(errmsg, stderr);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -20,6 +20,6 @@
|
|
||||||
void err_crit(char *errmsg)
|
|
||||||
{
|
|
||||||
if (quiet <= 2) {
|
|
||||||
- fprintf(stderr, errmsg);
|
|
||||||
+ fputs(errmsg, stderr);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
# Copyright 1999-2014 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
#
|
|
||||||
# shash(1) completion.
|
|
||||||
|
|
||||||
_shash() {
|
|
||||||
local cur prev
|
|
||||||
|
|
||||||
COMPREPLY=()
|
|
||||||
cur=${COMP_WORDS[COMP_CWORD]}
|
|
||||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
|
||||||
|
|
||||||
case "${prev}" in
|
|
||||||
-c|--config)
|
|
||||||
_filedir
|
|
||||||
return 0 ;;
|
|
||||||
-o|--keymode)
|
|
||||||
COMPREPLY=( $( compgen -W "$( shash --listkeygen | tail -n +2 )" \
|
|
||||||
-- ${cur} ) )
|
|
||||||
return ;;
|
|
||||||
-a|--algorithm)
|
|
||||||
COMPREPLY=( $( compgen -W "$( shash --list )" \
|
|
||||||
-- ${cur} ) )
|
|
||||||
return ;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
COMPREPLY=( $( compgen -W '-V -q -m -d -c -b -t -o -i -a -l -k -h -v \
|
|
||||||
-L \
|
|
||||||
--verbose --quiet --nosalt --time --hmac --doublecheck \
|
|
||||||
--check --binary --text --keymode --config --algorithm \
|
|
||||||
--list --key --listkeygen --help --version --license' \
|
|
||||||
-- ${cur} ) )
|
|
||||||
_filedir
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
complete -F _shash ${filenames} shash
|
|
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<maintainer type="person">
|
|
||||||
<email>swegener@gentoo.org</email>
|
|
||||||
<name>Sven Wegener</name>
|
|
||||||
</maintainer>
|
|
||||||
<longdescription>shash is a command-line interface for libmhash and is used to generate or check digests or MACs of files.</longdescription>
|
|
||||||
</pkgmetadata>
|
|
@ -1,42 +0,0 @@
|
|||||||
# Copyright 1999-2022 Gentoo Authors
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI=8
|
|
||||||
|
|
||||||
inherit autotools bash-completion-r1
|
|
||||||
|
|
||||||
DESCRIPTION="Generate or check digests or MACs of files"
|
|
||||||
HOMEPAGE="http://mcrypt.hellug.gr/shash/"
|
|
||||||
SRC_URI="ftp://mcrypt.hellug.gr/pub/mcrypt/${PN}/${P}.tar.gz"
|
|
||||||
|
|
||||||
LICENSE="GPL-2"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
|
||||||
IUSE="static"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
>=app-crypt/mhash-0.8.18-r1
|
|
||||||
static? ( app-crypt/mhash[static-libs(+)] )"
|
|
||||||
RDEPEND="${DEPEND}"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${PV}-manpage-fixes.patch
|
|
||||||
"${FILESDIR}"/${P}-binary-files.patch
|
|
||||||
"${FILESDIR}"/${P}-format-security.patch
|
|
||||||
"${FILESDIR}"/${P}-C99-decls.patch
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
default
|
|
||||||
eautoreconf
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
econf $(use_enable static static-link)
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
default
|
|
||||||
dodoc doc/sample.shashrc doc/FORMAT
|
|
||||||
newbashcomp "${FILESDIR}"/shash.bash-completion ${PN}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user