Gentoo Archives: gentoo-commits

From: Rick Farina <zerochaos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/johntheripper-jumbo/, app-crypt/johntheripper-jumbo/files/
Date: Tue, 18 Dec 2018 21:40:40
Message-Id: 1545169225.1abd827624bea952700371febd5442ce2c8ebdd1.zerochaos@gentoo
1 commit: 1abd827624bea952700371febd5442ce2c8ebdd1
2 Author: Rick Farina <zerochaos <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 18 21:32:27 2018 +0000
4 Commit: Rick Farina <zerochaos <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 18 21:40:25 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1abd8276
7
8 app-crypt/johntheripper-jumbo: split jtr and jumbo
9
10 jumbo "patch" has taken on a life of it's own and is now vastly too
11 different than jtr to keep a sane unified ebuild
12
13 Package-Manager: Portage-2.3.52, Repoman-2.3.12
14 Signed-off-by: Rick Farina <zerochaos <AT> gentoo.org>
15
16 app-crypt/johntheripper-jumbo/Manifest | 1 +
17 .../johntheripper-jumbo/files/1.8.0-gcc5.patch | 63 +++++++++++
18 .../johntheripper-jumbo-1.8.0.ebuild | 126 +++++++++++++++++++++
19 .../johntheripper-jumbo-9999.ebuild | 123 ++++++++++++++++++++
20 app-crypt/johntheripper-jumbo/metadata.xml | 19 ++++
21 5 files changed, 332 insertions(+)
22
23 diff --git a/app-crypt/johntheripper-jumbo/Manifest b/app-crypt/johntheripper-jumbo/Manifest
24 new file mode 100644
25 index 00000000000..1cbbf2f69a9
26 --- /dev/null
27 +++ b/app-crypt/johntheripper-jumbo/Manifest
28 @@ -0,0 +1 @@
29 +DIST JohnTheRipper-1.8.0-jumbo-1.tar.gz 32533148 BLAKE2B 15929fa25314438619899582b209bee6902b1e53dc2df39ed6a686820665fd4d8e56d26b3f0082d05dc6be2f54add3526570d936c0a929641e33e6dcfb7a13b5 SHA512 8b7fad7a6330b5ff1afc306218ba698aaa27776b566f82c2e76102d5ceb10aeafa69d71fa6fff67c81996ea2c6a04384bab4696ed192306c6d074873562e7089
30
31 diff --git a/app-crypt/johntheripper-jumbo/files/1.8.0-gcc5.patch b/app-crypt/johntheripper-jumbo/files/1.8.0-gcc5.patch
32 new file mode 100644
33 index 00000000000..f2a7984955a
34 --- /dev/null
35 +++ b/app-crypt/johntheripper-jumbo/files/1.8.0-gcc5.patch
36 @@ -0,0 +1,63 @@
37 +From e2e868db3e153b3f959e119a51703d4afb99c624 Mon Sep 17 00:00:00 2001
38 +From: magnum <john.magnum@××××××××.com>
39 +Date: Wed, 13 May 2015 12:05:00 +0200
40 +Subject: [PATCH] Add another solution to #1093. This make it possible to build
41 + using gcc 5 without --std=gnu89 (although I kept the latter for now). See
42 + also #1250.
43 +
44 +---
45 + src/DES_bs_b.c | 3 +++
46 + src/MD5_std.c | 12 ++++++++++++
47 + 2 files changed, 15 insertions(+)
48 +
49 +diff --git a/src/DES_bs_b.c b/src/DES_bs_b.c
50 +index 306b4e4..18c9235 100644
51 +--- a/src/DES_bs_b.c
52 ++++ b/src/DES_bs_b.c
53 +@@ -1272,6 +1272,9 @@ static MAYBE_INLINE void DES_bs_finalize_keys(void)
54 + #endif
55 +
56 + #if DES_bs_mt
57 ++#if __GNUC__ >= 5
58 ++extern
59 ++#endif
60 + MAYBE_INLINE void DES_bs_set_salt_for_thread(int t, unsigned int salt)
61 + #else
62 + void DES_bs_set_salt(ARCH_WORD salt)
63 +diff --git a/src/MD5_std.c b/src/MD5_std.c
64 +index 6bdcd35..1eec9b4 100644
65 +--- a/src/MD5_std.c
66 ++++ b/src/MD5_std.c
67 +@@ -496,9 +496,15 @@ extern void MD5_body(MD5_word x[15], MD5_word out[4]);
68 + #if MD5_std_mt
69 + #define MD5_body(x, out) \
70 + MD5_body_for_thread(t, x, out)
71 ++#if __GNUC__ >= 5
72 ++extern
73 ++#endif
74 + MAYBE_INLINE_BODY void MD5_body_for_thread(int t,
75 + MD5_word x[15], MD5_word out[4])
76 + #else
77 ++#if __GNUC__ >= 5
78 ++extern
79 ++#endif
80 + MAYBE_INLINE_BODY void MD5_body(MD5_word x[15], MD5_word out[4])
81 + #endif
82 + {
83 +@@ -595,10 +601,16 @@ MAYBE_INLINE_BODY void MD5_body(MD5_word x[15], MD5_word out[4])
84 + #if MD5_std_mt
85 + #define MD5_body(x0, x1, out0, out1) \
86 + MD5_body_for_thread(t, x0, x1, out0, out1)
87 ++#if __GNUC__ >= 5
88 ++extern
89 ++#endif
90 + MAYBE_INLINE_BODY void MD5_body_for_thread(int t,
91 + MD5_word x0[15], MD5_word x1[15],
92 + MD5_word out0[4], MD5_word out1[4])
93 + #else
94 ++#if __GNUC__ >= 5
95 ++extern
96 ++#endif
97 + MAYBE_INLINE_BODY void MD5_body(MD5_word x0[15], MD5_word x1[15],
98 + MD5_word out0[4], MD5_word out1[4])
99 + #endif
100
101 diff --git a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.8.0.ebuild b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.8.0.ebuild
102 new file mode 100644
103 index 00000000000..6e8d04dc6d4
104 --- /dev/null
105 +++ b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-1.8.0.ebuild
106 @@ -0,0 +1,126 @@
107 +# Copyright 1999-2018 Gentoo Authors
108 +# Distributed under the terms of the GNU General Public License v2
109 +
110 +EAPI=7
111 +
112 +inherit flag-o-matic toolchain-funcs pax-utils
113 +
114 +DESCRIPTION="fast password cracker"
115 +HOMEPAGE="http://www.openwall.com/john/"
116 +
117 +MY_PN="JohnTheRipper"
118 +
119 +if [[ ${PV} == "9999" ]] ; then
120 + EGIT_REPO_URI="https://github.com/magnumripper/${MY_PN}.git"
121 + inherit git-r3
122 + KEYWORDS=""
123 +else
124 + JUMBO="jumbo-1"
125 + MY_PV="${PV}-${JUMBO}"
126 + MY_P="${MY_PN}-${MY_PV}"
127 + SRC_URI="https://github.com/magnumripper/${MY_PN}/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
128 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
129 + S="${WORKDIR}/${MY_P}"
130 +fi
131 +
132 +LICENSE="GPL-2"
133 +SLOT="0"
134 +#removed rexgen and commoncrypto
135 +IUSE="custom-cflags kerberos mpi opencl openmp pcap"
136 +
137 +DEPEND=">=dev-libs/openssl-1.0.1:0
138 + mpi? ( virtual/mpi )
139 + opencl? ( virtual/opencl )
140 + kerberos? ( virtual/krb5 )
141 + pcap? ( net-libs/libpcap )
142 + dev-libs/gmp:*
143 + sys-libs/zlib
144 + app-arch/bzip2"
145 +
146 +RDEPEND="${DEPEND}
147 + !app-crypt/johntheripper"
148 +
149 +pkg_setup() {
150 + if use openmp && [[ ${MERGE_TYPE} != binary ]]; then
151 + tc-has-openmp || die "Please switch to an openmp compatible compiler"
152 + fi
153 +}
154 +
155 +src_prepare() {
156 + eapply "${FILESDIR}/${PV}-gcc5.patch"
157 + sed -i 's#/usr/share/john#/etc/john#' src/params.h || die
158 + default
159 +}
160 +
161 +src_configure() {
162 + cd src || die
163 +
164 + use custom-cflags || strip-flags
165 +
166 + # John ignores CPPFLAGS, use CFLAGS instead
167 + append-cflags -DJOHN_SYSTEMWIDE=1
168 +
169 + econf \
170 + --disable-native-macro \
171 + --disable-native-tests \
172 + --without-commoncrypto \
173 + --disable-rexgen \
174 + --with-openssl \
175 + $(use_enable mpi) \
176 + $(use_enable opencl) \
177 + $(use_enable openmp) \
178 + $(use_enable pcap)
179 +}
180 +
181 +src_compile() {
182 + emake -C src
183 +}
184 +
185 +src_test() {
186 + pax-mark -mr run/john
187 + #if use opencl; then
188 + #gpu tests fail in portage, so run cpu only tests
189 + # ./run/john --device=cpu --test=0 --verbosity=2 || die
190 + #else
191 + #weak tests
192 + # ./run/john --test=0 --verbosity=2 || die
193 + #strong tests
194 + #./run/john --test=1 --verbosity=2 || die
195 + #fi
196 + ewarn "When built systemwide, john can't run tests without reading files in /etc."
197 + ewarn "Don't bother opening a bug for this unless you include a patch to fix it"
198 +}
199 +
200 +src_install() {
201 + # executables
202 + dosbin run/john
203 + newsbin run/mailer john-mailer
204 +
205 + pax-mark -mr "${ED}usr/sbin/john"
206 +
207 + # grep '$(LN)' Makefile.in | head -n-3 | tail -n+2 | cut -d' ' -f3 | cut -d/ -f3
208 + for s in \
209 + unshadow unafs undrop unique ssh2john putty2john pfx2john keepass2john keyring2john \
210 + zip2john gpg2john rar2john racf2john keychain2john kwallet2john pwsafe2john dmg2john \
211 + hccap2john base64conv truecrypt_volume2john keystore2john
212 + do
213 + dosym john /usr/sbin/$s
214 + done
215 +
216 + insinto /usr/share/john
217 + doins run/*.py
218 +
219 + if use opencl; then
220 + insinto /usr/share/john/kernels
221 + doins run/kernels/*
222 + fi
223 +
224 + # config files
225 + insinto /etc/john
226 + doins run/*.chr run/password.lst
227 + doins run/*.conf
228 + doins -r run/kernels
229 +
230 + # documentation
231 + dodoc doc/*
232 +}
233
234 diff --git a/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild
235 new file mode 100644
236 index 00000000000..1e72fa5104c
237 --- /dev/null
238 +++ b/app-crypt/johntheripper-jumbo/johntheripper-jumbo-9999.ebuild
239 @@ -0,0 +1,123 @@
240 +# Copyright 1999-2018 Gentoo Authors
241 +# Distributed under the terms of the GNU General Public License v2
242 +
243 +EAPI=7
244 +
245 +inherit flag-o-matic toolchain-funcs pax-utils
246 +
247 +DESCRIPTION="fast password cracker"
248 +HOMEPAGE="http://www.openwall.com/john/"
249 +
250 +MY_PN="JohnTheRipper"
251 +
252 +if [[ ${PV} == "9999" ]] ; then
253 + EGIT_REPO_URI="https://github.com/magnumripper/${MY_PN}.git"
254 + inherit git-r3
255 + KEYWORDS=""
256 +else
257 + JUMBO="jumbo-1"
258 + MY_PV="${PV}-${JUMBO}"
259 + MY_P="${MY_PN}-${MY_PV}"
260 + SRC_URI="https://github.com/magnumripper/${MY_PN}/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
261 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
262 + S="${WORKDIR}/${MY_P}"
263 +fi
264 +
265 +LICENSE="GPL-2"
266 +SLOT="0"
267 +#removed rexgen and commoncrypto
268 +IUSE="custom-cflags kerberos mpi opencl openmp pcap"
269 +
270 +DEPEND=">=dev-libs/openssl-1.0.1:0
271 + mpi? ( virtual/mpi )
272 + opencl? ( virtual/opencl )
273 + kerberos? ( virtual/krb5 )
274 + pcap? ( net-libs/libpcap )
275 + dev-libs/gmp:*
276 + sys-libs/zlib
277 + app-arch/bzip2"
278 +
279 +RDEPEND="${DEPEND}
280 + !app-crypt/johntheripper"
281 +
282 +pkg_setup() {
283 + if use openmp && [[ ${MERGE_TYPE} != binary ]]; then
284 + tc-has-openmp || die "Please switch to an openmp compatible compiler"
285 + fi
286 +}
287 +
288 +src_prepare() {
289 + sed -i 's#$prefix/share/john#/etc/john#' src/configure || die
290 + default
291 +}
292 +
293 +src_configure() {
294 + cd src || die
295 +
296 + use custom-cflags || strip-flags
297 +
298 + econf \
299 + --disable-native-march \
300 + --disable-native-tests \
301 + --without-commoncrypto \
302 + --disable-rexgen \
303 + --with-openssl \
304 + --with-systemwide \
305 + $(use_enable mpi) \
306 + $(use_enable opencl) \
307 + $(use_enable openmp) \
308 + $(use_enable pcap)
309 +}
310 +
311 +src_compile() {
312 + emake -C src
313 +}
314 +
315 +src_test() {
316 + pax-mark -mr run/john
317 + #if use opencl; then
318 + #gpu tests fail in portage, so run cpu only tests
319 + # ./run/john --device=cpu --test=0 --verbosity=2 || die
320 + #else
321 + #weak tests
322 + # ./run/john --test=0 --verbosity=2 || die
323 + #strong tests
324 + #./run/john --test=1 --verbosity=2 || die
325 + #fi
326 + ewarn "When built systemwide, john can't run tests without reading files in /etc."
327 + ewarn "Don't bother opening a bug for this unless you include a patch to fix it"
328 +}
329 +
330 +src_install() {
331 + # executables
332 + dosbin run/john
333 + newsbin run/mailer john-mailer
334 +
335 + pax-mark -mr "${ED}usr/sbin/john"
336 +
337 + # grep '$(LN)' Makefile.in | head -n-3 | tail -n+2 | cut -d' ' -f3 | cut -d/ -f3
338 + for s in \
339 + unshadow unafs undrop unique ssh2john putty2john pfx2john keepass2john keyring2john \
340 + zip2john gpg2john rar2john racf2john keychain2john kwallet2john pwsafe2john dmg2john \
341 + hccap2john base64conv truecrypt_volume2john keystore2john
342 + do
343 + dosym john /usr/sbin/$s
344 + done
345 +
346 + insinto /usr/share/john
347 + doins run/*.py
348 +
349 + if use opencl; then
350 + insinto /usr/share/john/kernels
351 + doins run/kernels/*
352 + fi
353 +
354 + # config files
355 + insinto /etc/john
356 + doins run/*.chr run/password.lst
357 + doins run/*.conf
358 + doins -r run/rules run/kernels run/ztex
359 +
360 + # documentation
361 + dodoc doc/*
362 +}
363
364 diff --git a/app-crypt/johntheripper-jumbo/metadata.xml b/app-crypt/johntheripper-jumbo/metadata.xml
365 new file mode 100644
366 index 00000000000..6eefb4340ea
367 --- /dev/null
368 +++ b/app-crypt/johntheripper-jumbo/metadata.xml
369 @@ -0,0 +1,19 @@
370 +<?xml version="1.0" encoding="UTF-8"?>
371 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
372 +<pkgmetadata>
373 + <maintainer type="person">
374 + <email>zerochaos@g.o</email>
375 + <name>Rick Farina</name>
376 + </maintainer>
377 + <maintainer type="project">
378 + <email>crypto@g.o</email>
379 + <name>Crypto</name>
380 + </maintainer>
381 + <upstream>
382 + <remote-id type="github">magnumripper/JohnTheRipper</remote-id>
383 + </upstream>
384 + <use>
385 + <flag name="opencl">Build with opencl/GPU cracking support</flag>
386 + <flag name="pcap">Build with pcap support</flag>
387 + </use>
388 +</pkgmetadata>