Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/hashcat/, app-crypt/hashcat/files/
Date: Tue, 07 Sep 2021 20:27:18
Message-Id: 1631046417.1632d007342a9cf30f0b201fb2085e9bdc2e96c2.sam@gentoo
1 commit: 1632d007342a9cf30f0b201fb2085e9bdc2e96c2
2 Author: Miezhiko <Miezhiko <AT> gmail <DOT> com>
3 AuthorDate: Thu Sep 2 14:01:36 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 7 20:26:57 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1632d007
7
8 app-crypt/hashcat: update to 6.2.4 and fix compilation without brain
9
10 Signed-off-by: Miezhiko <Miezhiko <AT> gmail.com>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 app-crypt/hashcat/Manifest | 1 +
14 .../hashcat/files/hashcat-6.2.4-brainless.patch | 41 ++++++++
15 app-crypt/hashcat/hashcat-6.2.4.ebuild | 112 +++++++++++++++++++++
16 3 files changed, 154 insertions(+)
17
18 diff --git a/app-crypt/hashcat/Manifest b/app-crypt/hashcat/Manifest
19 index 47f1c021b86..cb78361074a 100644
20 --- a/app-crypt/hashcat/Manifest
21 +++ b/app-crypt/hashcat/Manifest
22 @@ -1 +1,2 @@
23 DIST hashcat-6.2.1.tar.gz 5815254 BLAKE2B b6ce0edf7a7fe725570e557b6b414c8aad02e24933b2610be2607c895778d635543a90806aa40c3521f83f93de3b7556f04274d4f9893dacb53af82974df0be2 SHA512 435d8c66e1de14a4a95364eb06f41d10d221c4cf3286bed5ce333d3d07fe7ec2097fa57a3f925ef108a0c17091a65dc18b9c782f69ab8c0575061c14c9354563
24 +DIST hashcat-6.2.4.tar.gz 6269444 BLAKE2B 15d774253841350710e89bb6358f5fd615ef6e0645f271507d5bfc3e814be1533f78b83b90c11b24c7088ac60f2bb9098cf3410c4bedb5d53b0ccff4d840664c SHA512 bb18646794e168616e6f018b41c1a17c26bb0d8625aaeec0bd0d734efbc331008f432efde7b3d08e8838c995c771a406670812edaf7d605e7fdff9ef001aa954
25
26 diff --git a/app-crypt/hashcat/files/hashcat-6.2.4-brainless.patch b/app-crypt/hashcat/files/hashcat-6.2.4-brainless.patch
27 new file mode 100644
28 index 00000000000..66d85d45c0b
29 --- /dev/null
30 +++ b/app-crypt/hashcat/files/hashcat-6.2.4-brainless.patch
31 @@ -0,0 +1,41 @@
32 +https://github.com/hashcat/hashcat/pull/2961#event-5251978340
33 +From 0d5aed883b45cf3c218cb71916b08d56ae3d25a3 Mon Sep 17 00:00:00 2001
34 +From: Miezhiko <Miezhiko@×××××.com>
35 +Date: Thu, 2 Sep 2021 17:52:27 +0400
36 +Subject: [PATCH] Fix compilation without brain
37 +
38 +Signed-off-by: Miezhiko <Miezhiko@×××××.com>
39 +---
40 + src/hashcat.c | 5 ++++-
41 + 1 file changed, 4 insertions(+), 1 deletion(-)
42 +
43 +diff --git a/src/hashcat.c b/src/hashcat.c
44 +index 163d7408d..bf936ccc0 100644
45 +--- a/src/hashcat.c
46 ++++ b/src/hashcat.c
47 +@@ -922,7 +922,10 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
48 +
49 + // clean up
50 +
51 ++ #ifdef WITH_BRAIN
52 + brain_ctx_destroy (hashcat_ctx);
53 ++ #endif
54 ++
55 + bitmap_ctx_destroy (hashcat_ctx);
56 + combinator_ctx_destroy (hashcat_ctx);
57 + cpt_ctx_destroy (hashcat_ctx);
58 +@@ -1090,13 +1093,13 @@ int hashcat_session_init (hashcat_ctx_t *hashcat_ctx, const char *install_folder
59 + }
60 + }
61 + #endif
62 +- #endif
63 +
64 + /**
65 + * brain
66 + */
67 +
68 + if (brain_ctx_init (hashcat_ctx) == -1) return -1;
69 ++ #endif
70 +
71 + /**
72 + * logfile
73
74 diff --git a/app-crypt/hashcat/hashcat-6.2.4.ebuild b/app-crypt/hashcat/hashcat-6.2.4.ebuild
75 new file mode 100644
76 index 00000000000..4a204caae63
77 --- /dev/null
78 +++ b/app-crypt/hashcat/hashcat-6.2.4.ebuild
79 @@ -0,0 +1,112 @@
80 +# Copyright 1999-2021 Gentoo Authors
81 +# Distributed under the terms of the GNU General Public License v2
82 +
83 +EAPI=7
84 +
85 +inherit pax-utils toolchain-funcs
86 +
87 +DESCRIPTION="World's fastest and most advanced password recovery utility"
88 +HOMEPAGE="https://github.com/hashcat/hashcat"
89 +LICENSE="MIT"
90 +SLOT="0"
91 +if [ "${PV}" = "9999" ]; then
92 + inherit git-r3
93 + EGIT_REPO_URI="https://github.com/hashcat/hashcat.git"
94 +else
95 + KEYWORDS="~amd64"
96 + SRC_URI="https://github.com/hashcat/hashcat/archive/v${PV}.tar.gz -> ${P}.tar.gz"
97 +fi
98 +
99 +IUSE="brain video_cards_nvidia"
100 +DEPEND="
101 + app-arch/lzma
102 + app-arch/unrar
103 + sys-libs/zlib[minizip]
104 + brain? ( dev-libs/xxhash )
105 + video_cards_nvidia? ( >x11-drivers/nvidia-drivers-440.64
106 + || ( dev-util/nvidia-cuda-toolkit
107 + virtual/opencl )
108 + )
109 + !video_cards_nvidia? ( virtual/opencl )"
110 +RDEPEND="${DEPEND}"
111 +
112 +PATCHES=(
113 + "${FILESDIR}"/${PN}-6.2.4-brainless.patch
114 +)
115 +
116 +src_prepare() {
117 + # remove bundled stuff
118 + rm -r deps/OpenCL-Headers || die "Failed to remove bundled OpenCL Headers"
119 + rm -r deps/xxHash || die "Failed to remove bundled xxHash"
120 + # TODO: Gentoo's app-arch/lzma doesn't install the needed files
121 + #rm -r deps/LZMA-SDK || die "Failed to remove bundled LZMA-SDK"
122 + #rm -r deps || die "Failed to remove bundled deps"
123 +
124 + # do not strip
125 + sed -i "/LFLAGS += -s/d" src/Makefile
126 + # do not add random CFLAGS
127 + sed -i "s/-O2//" src/Makefile || die
128 + #sed -i "#LZMA_SDK_INCLUDE#d" src/Makefile || die
129 + # respect CC, CXX, AR
130 + sed -i \
131 + -e 's/:= gcc/:= $(CC)/' \
132 + -e 's/:= g++/:= $(CXX)/' \
133 + -e 's/:= ar/:= $(AR)/' \
134 + src/Makefile || die
135 +
136 + export PREFIX="${EPREFIX}"/usr
137 + export LIBRARY_FOLDER="/usr/$(get_libdir)"
138 + export DOCUMENT_FOLDER="/usr/share/doc/${PF}"
139 +
140 + default
141 +}
142 +
143 +src_compile() {
144 + tc-export CC CXX AR
145 +
146 + # Use bundled unrar for now, bug #792720
147 + emake \
148 + SHARED=1 \
149 + PRODUCTION=1 \
150 + ENABLE_BRAIN=$(usex brain 1 0) \
151 + USE_SYSTEM_LZMA=0 \
152 + USE_SYSTEM_OPENCL=1 \
153 + USE_SYSTEM_UNRAR=0 \
154 + USE_SYSTEM_ZLIB=1 \
155 + USE_SYSTEM_XXHASH=1 \
156 + VERSION_PURE="${PV}"
157 +
158 + pax-mark -mr hashcat
159 +}
160 +
161 +src_test() {
162 + if use video_cards_nvidia; then
163 + addwrite /dev/nvidia0
164 + addwrite /dev/nvidiactl
165 + addwrite /dev/nvidia-uvm
166 + if [ ! -w /dev/nvidia0 ]; then
167 + einfo "To run these tests, portage likely must be in the video group."
168 + einfo "Please run \"gpasswd -a portage video\" if the tests will fail"
169 + fi
170 + #elif use vidia_cards_fglrx; then
171 + # addwrite /dev/ati
172 + fi
173 + #this always exits with 255 despite success
174 + #./hashcat -b -m 2500 || die "Test failed"
175 + LD_PRELOAD=./libhashcat.so.${PV} ./hashcat -a 3 -m 1500 nQCk49SiErOgk || die "Test failed"
176 +}
177 +
178 +src_install() {
179 + emake \
180 + DESTDIR="${ED}" \
181 + SHARED=1 \
182 + PRODUCTION=1 \
183 + ENABLE_BRAIN=$(usex brain 1 0) \
184 + USE_SYSTEM_LZMA=0 \
185 + USE_SYSTEM_OPENCL=1 \
186 + USE_SYSTEM_UNRAR=1 \
187 + USE_SYSTEM_ZLIB=1 \
188 + USE_SYSTEM_XXHASH=1 \
189 + VERSION_PURE="${PV}" \
190 + install
191 +}