Skip to content

Commit b2cc4c9

Browse files
committed
app-crypt/shash: Sync with Gentoo
It's from Gentoo commit a457ca66361ff3b68cd39b0ed38e770077de0db0.
1 parent 6440735 commit b2cc4c9

File tree

5 files changed

+215
-14
lines changed

5 files changed

+215
-14
lines changed

sdk_container/src/third_party/portage-stable/app-crypt/shash/files/0.2.6-manpage-fixes.patch

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
diff -pruN shash-0.2.6/doc/shash.1 shash-0.2.6-r1/doc/shash.1
2-
--- shash-0.2.6/doc/shash.1 2004-09-18 09:51:04.004647112 +0100
3-
+++ shash-0.2.6-r1/doc/shash.1 2004-09-18 09:57:26.062565480 +0100
1+
--- a/doc/shash.1
2+
+++ b/doc/shash.1
43
@@ -31,7 +31,7 @@ Because of this shash also supports HMAC
54
a mechanism for message authentication using cryptographic hash functions.
65
So shash can use a key with a hash algorithm to produce hashes that can only
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
--- a/src/environ.c
2+
+++ b/src/environ.c
3+
@@ -4,7 +4,7 @@
4+
#endif
5+
#include "environ.h"
6+
7+
-int check_env()
8+
+int check_env(void)
9+
{
10+
11+
if (getenv(SHASH_KEY) != NULL
12+
@@ -15,7 +15,7 @@
13+
}
14+
15+
char *
16+
- get_env_key()
17+
+ get_env_key(void)
18+
{
19+
20+
if (getenv(SHASH_KEY) != NULL) {
21+
@@ -26,7 +26,7 @@
22+
23+
}
24+
25+
-char *get_env_bit_mode()
26+
+char *get_env_bit_mode(void)
27+
{
28+
29+
return getenv(SHASH_KEYMODE);
30+
--- a/src/environ.h
31+
+++ b/src/environ.h
32+
@@ -3,7 +3,7 @@
33+
#define SHASH_KEY "SHASH_KEY"
34+
#define SHASH_KEYMODE "SHASH_KEYMODE"
35+
36+
-int check_env();
37+
-char * get_env_key();
38+
-char * get_env_bit_mode();
39+
+int check_env(void);
40+
+char * get_env_key(void);
41+
+char * get_env_bit_mode(void);
42+
43+
--- a/src/errors.c
44+
+++ b/src/errors.c
45+
@@ -1,5 +1,7 @@
46+
#include <defines.h>
47+
48+
+#include <stdio.h>
49+
+
50+
extern int quiet;
51+
52+
void err_quit(char *errmsg)
53+
--- a/src/extra.c
54+
+++ b/src/extra.c
55+
@@ -1,5 +1,10 @@
56+
#include <defines.h>
57+
58+
+#include <pwd.h>
59+
+#include <stdlib.h>
60+
+#include <string.h>
61+
+#include <sys/stat.h>
62+
+
63+
#ifdef HAVE_STAT
64+
65+
int check_file(char *filename)
66+
--- a/src/gaaout.c
67+
+++ b/src/gaaout.c
68+
@@ -11,6 +11,11 @@
69+
#endif
70+
#endif
71+
72+
+void hash_license(void);
73+
+void hash_version(void);
74+
+void list_keygen_algorithms(void);
75+
+int hash_list(void);
76+
+
77+
void* gaa_malloc( size_t size) {
78+
void* ret;
79+
ret = malloc(size);
80+
--- a/src/random.c
81+
+++ b/src/random.c
82+
@@ -24,7 +24,7 @@
83+
static FILE *ffd;
84+
85+
word32
86+
-get_rand32()
87+
+get_rand32(void)
88+
{
89+
int fd, x;
90+
word32 rand_data;
91+
@@ -46,7 +46,7 @@
92+
93+
94+
word8
95+
-get_rand8()
96+
+get_rand8(void)
97+
{
98+
99+
int fd, x;
100+
@@ -69,7 +69,7 @@
101+
102+
103+
word32
104+
-get_safe_rand32()
105+
+get_safe_rand32(void)
106+
{
107+
int fd, x;
108+
word32 rand_data;
109+
@@ -91,7 +91,7 @@
110+
111+
112+
word8
113+
-get_safe_rand8()
114+
+get_safe_rand8(void)
115+
{
116+
117+
int fd, x;
118+
@@ -131,13 +131,13 @@
119+
return 0;
120+
}
121+
122+
-void close_rand()
123+
+void close_rand(void)
124+
{
125+
fclose(ffd);
126+
}
127+
128+
word32
129+
-get_o_rand32()
130+
+get_o_rand32(void)
131+
{
132+
int x;
133+
word32 rand_data;
134+
@@ -152,7 +152,7 @@
135+
}
136+
137+
word8
138+
-get_o_rand8()
139+
+get_o_rand8(void)
140+
{
141+
142+
int x;
143+
--- a/src/random.h
144+
+++ b/src/random.h
145+
@@ -1,14 +1,14 @@
146+
147+
#ifdef HAVE_DEV_RANDOM
148+
149+
-word32 get_rand32();
150+
-word8 get_rand8();
151+
-word32 get_safe_rand32();
152+
-word8 get_safe_rand8();
153+
+word32 get_rand32(void);
154+
+word8 get_rand8(void);
155+
+word32 get_safe_rand32(void);
156+
+word8 get_safe_rand8(void);
157+
158+
int open_rand(int);
159+
-void close_rand();
160+
-word32 get_o_rand32();
161+
-word8 get_o_rand8();
162+
+void close_rand(void);
163+
+word32 get_o_rand32(void);
164+
+word8 get_o_rand8(void);
165+
166+
#endif
167+
--- a/src/shash.c
168+
+++ b/src/shash.c
169+
@@ -485,7 +485,7 @@
170+
}
171+
}
172+
173+
-int hash_list()
174+
+int hash_list(void)
175+
{
176+
hashid i;
177+
char *y;
178+
@@ -715,7 +715,7 @@
179+
return counter;
180+
}
181+
182+
-void hash_license()
183+
+void hash_license(void)
184+
{
185+
fprintf(stdout, ("\nCopyright (C) 1999,2001,2002 Nikos Mavroyanopoulos\n"
186+
"This program is free software; you can redistribute it and/or modify \n"
187+
@@ -733,7 +733,7 @@
188+
"Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"));
189+
}
190+
191+
-void hash_version()
192+
+void hash_version(void)
193+
{
194+
fprintf(stderr, ("shash v.%s (%s-%s-%s)\n"), VERSION, T_CPU,
195+
T_VENDOR, T_OS);

sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-binary-files.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- shash-0.2.6/src/shash.c
2-
+++ shash-0.2.6/src/shash.c
1+
--- a/src/shash.c
2+
+++ b/src/shash.c
33
@@ -631,11 +631,11 @@
44

55
if (nosalt == FALSE && hmac == 1) {

sdk_container/src/third_party/portage-stable/app-crypt/shash/files/shash-0.2.6-format-security.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- shash-0.2.6/src/errors.c
2-
+++ shash-0.2.6/src/errors.c
1+
--- a/src/errors.c
2+
+++ b/src/errors.c
33
@@ -4,7 +4,7 @@
44

55
void err_quit(char *errmsg)
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
1-
# Copyright 1999-2021 Gentoo Authors
1+
# Copyright 1999-2022 Gentoo Authors
22
# Distributed under the terms of the GNU General Public License v2
33

4-
EAPI=6
4+
EAPI=8
55

6-
inherit bash-completion-r1
6+
inherit autotools bash-completion-r1
77

88
DESCRIPTION="Generate or check digests or MACs of files"
99
HOMEPAGE="http://mcrypt.hellug.gr/shash/"
1010
SRC_URI="ftp://mcrypt.hellug.gr/pub/mcrypt/${PN}/${P}.tar.gz"
1111

1212
LICENSE="GPL-2"
1313
SLOT="0"
14-
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
14+
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
1515
IUSE="static"
1616

17-
DEPEND=">=app-crypt/mhash-0.8.18-r1
17+
DEPEND="
18+
>=app-crypt/mhash-0.8.18-r1
1819
static? ( app-crypt/mhash[static-libs(+)] )"
1920
RDEPEND="${DEPEND}"
2021

2122
PATCHES=(
2223
"${FILESDIR}"/${PV}-manpage-fixes.patch
2324
"${FILESDIR}"/${P}-binary-files.patch
2425
"${FILESDIR}"/${P}-format-security.patch
26+
"${FILESDIR}"/${P}-C99-decls.patch
2527
)
2628

29+
src_prepare() {
30+
default
31+
eautoreconf
32+
}
33+
2734
src_configure() {
2835
econf $(use_enable static static-link)
2936
}
3037

3138
src_install() {
32-
emake install DESTDIR="${D}"
33-
dodoc AUTHORS ChangeLog INSTALL NEWS doc/sample.shashrc doc/FORMAT
39+
default
40+
dodoc doc/sample.shashrc doc/FORMAT
3441
newbashcomp "${FILESDIR}"/shash.bash-completion ${PN}
3542
}

0 commit comments

Comments
 (0)