2022-03-21 09:58:26 +03:00
|
|
|
# Copyright 1999-2022 Gentoo Authors
|
2018-12-19 09:18:04 +03:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=7
|
|
|
|
|
2021-12-05 10:52:57 +03:00
|
|
|
inherit autotools flag-o-matic toolchain-funcs pax-utils
|
2018-12-19 09:18:04 +03:00
|
|
|
|
2021-06-27 23:21:26 +03:00
|
|
|
DESCRIPTION="Fast password cracker"
|
2018-12-19 09:18:04 +03:00
|
|
|
HOMEPAGE="http://www.openwall.com/john/"
|
|
|
|
|
|
|
|
MY_PN="JohnTheRipper"
|
|
|
|
|
|
|
|
if [[ ${PV} == "9999" ]] ; then
|
|
|
|
EGIT_REPO_URI="https://github.com/magnumripper/${MY_PN}.git"
|
|
|
|
inherit git-r3
|
|
|
|
else
|
2021-12-05 10:52:57 +03:00
|
|
|
JUMBO="jumbo-1.1"
|
2018-12-19 09:18:04 +03:00
|
|
|
MY_PV="${PV}-${JUMBO}"
|
2021-12-05 10:52:57 +03:00
|
|
|
MY_P="john-${MY_PV}"
|
|
|
|
HASH_COMMIT="5d0c85f16f96ca7b6dd06640e95a5801081d6e20"
|
|
|
|
|
|
|
|
SRC_URI="https://github.com/openwall/john/archive/${HASH_COMMIT}.tar.gz -> ${P}.tar.gz"
|
|
|
|
S="${WORKDIR}/john-${HASH_COMMIT}"
|
|
|
|
|
2019-10-12 18:52:35 +03:00
|
|
|
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
2018-12-19 09:18:04 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
IUSE="custom-cflags kerberos mpi opencl openmp pcap"
|
|
|
|
|
2021-12-05 10:52:57 +03:00
|
|
|
DEPEND=">=dev-libs/openssl-1.0.1:=
|
2021-06-27 23:21:26 +03:00
|
|
|
virtual/libcrypt:=
|
2018-12-19 09:18:04 +03:00
|
|
|
mpi? ( virtual/mpi )
|
|
|
|
opencl? ( virtual/opencl )
|
|
|
|
kerberos? ( virtual/krb5 )
|
|
|
|
pcap? ( net-libs/libpcap )
|
2021-06-27 23:21:26 +03:00
|
|
|
dev-libs/gmp:=
|
2018-12-19 09:18:04 +03:00
|
|
|
sys-libs/zlib
|
|
|
|
app-arch/bzip2"
|
2021-12-05 10:52:57 +03:00
|
|
|
# Missing (unpackaged):
|
|
|
|
# - Digest::Haval256
|
|
|
|
# - Digest::x
|
|
|
|
# See bug #777369.
|
2018-12-19 09:18:04 +03:00
|
|
|
RDEPEND="${DEPEND}
|
2021-12-05 10:52:57 +03:00
|
|
|
dev-perl/Digest-MD2
|
|
|
|
virtual/perl-Digest-MD5
|
|
|
|
dev-perl/Digest-SHA3
|
|
|
|
dev-perl/Digest-GOST
|
|
|
|
!app-crypt/johntheripper"
|
2018-12-19 09:18:04 +03:00
|
|
|
|
|
|
|
pkg_setup() {
|
|
|
|
if use openmp && [[ ${MERGE_TYPE} != binary ]]; then
|
2021-12-05 10:52:57 +03:00
|
|
|
tc-has-openmp || die "Please switch to an OpenMP compatible compiler"
|
2018-12-19 09:18:04 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
default
|
2021-12-05 10:52:57 +03:00
|
|
|
|
|
|
|
cd src || die
|
|
|
|
eautoreconf
|
|
|
|
|
|
|
|
sed -i 's#$prefix/share/john#/etc/john#' configure || die
|
2018-12-19 09:18:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
cd src || die
|
|
|
|
|
|
|
|
use custom-cflags || strip-flags
|
|
|
|
|
|
|
|
econf \
|
2021-12-05 10:52:57 +03:00
|
|
|
--enable-pkg-config \
|
2018-12-19 09:18:04 +03:00
|
|
|
--disable-native-march \
|
|
|
|
--disable-native-tests \
|
|
|
|
--disable-rexgen \
|
|
|
|
--with-openssl \
|
|
|
|
--with-systemwide \
|
|
|
|
$(use_enable mpi) \
|
|
|
|
$(use_enable opencl) \
|
|
|
|
$(use_enable openmp) \
|
|
|
|
$(use_enable pcap)
|
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
2021-12-05 10:52:57 +03:00
|
|
|
# Uses default LD=$(CC) but if the user's set LD, it'll call it
|
|
|
|
# bug #729432.
|
2022-03-21 09:58:26 +03:00
|
|
|
emake LD="$(tc-getCC)" -C src
|
2018-12-19 09:18:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
src_test() {
|
|
|
|
pax-mark -mr run/john
|
2021-12-05 10:52:57 +03:00
|
|
|
|
2018-12-19 09:18:04 +03:00
|
|
|
#if use opencl; then
|
2021-12-05 10:52:57 +03:00
|
|
|
# GPU tests fail in portage, so run cpu only tests
|
2018-12-19 09:18:04 +03:00
|
|
|
# ./run/john --device=cpu --test=0 --verbosity=2 || die
|
|
|
|
#else
|
2021-12-05 10:52:57 +03:00
|
|
|
# Weak tests
|
|
|
|
#./run/john --test=0 --verbosity=2 || die
|
|
|
|
# Strong tests
|
2018-12-19 09:18:04 +03:00
|
|
|
#./run/john --test=1 --verbosity=2 || die
|
|
|
|
#fi
|
2021-12-05 10:52:57 +03:00
|
|
|
|
2018-12-19 09:18:04 +03:00
|
|
|
ewarn "When built systemwide, john can't run tests without reading files in /etc."
|
|
|
|
ewarn "Don't bother opening a bug for this unless you include a patch to fix it"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2021-12-05 10:52:57 +03:00
|
|
|
# Executables
|
2018-12-19 09:18:04 +03:00
|
|
|
dosbin run/john
|
|
|
|
newsbin run/mailer john-mailer
|
|
|
|
|
2018-12-20 09:00:42 +03:00
|
|
|
pax-mark -mr "${ED}/usr/sbin/john"
|
2018-12-19 09:18:04 +03:00
|
|
|
|
|
|
|
# grep '$(LN)' Makefile.in | head -n-3 | tail -n+2 | cut -d' ' -f3 | cut -d/ -f3
|
2021-12-05 10:52:57 +03:00
|
|
|
local s
|
2018-12-19 09:18:04 +03:00
|
|
|
for s in \
|
|
|
|
unshadow unafs undrop unique ssh2john putty2john pfx2john keepass2john keyring2john \
|
|
|
|
zip2john gpg2john rar2john racf2john keychain2john kwallet2john pwsafe2john dmg2john \
|
|
|
|
hccap2john base64conv truecrypt_volume2john keystore2john
|
|
|
|
do
|
2021-12-05 10:52:57 +03:00
|
|
|
dosym john /usr/sbin/${s}
|
2018-12-19 09:18:04 +03:00
|
|
|
done
|
|
|
|
|
2021-12-05 10:52:57 +03:00
|
|
|
# Scripts
|
|
|
|
exeinto /usr/share/john
|
|
|
|
doexe run/*.pl
|
|
|
|
doexe run/*.py
|
|
|
|
cd run || die
|
|
|
|
|
|
|
|
local s
|
|
|
|
for s in *.pl *.py; do
|
|
|
|
dosym ../share/john/${s} /usr/bin/${s}
|
|
|
|
done
|
|
|
|
cd .. || die
|
2018-12-19 09:18:04 +03:00
|
|
|
|
|
|
|
if use opencl; then
|
2018-12-20 09:00:42 +03:00
|
|
|
insinto /etc/john
|
2021-12-05 10:52:57 +03:00
|
|
|
doins -r run/opencl
|
2018-12-19 09:18:04 +03:00
|
|
|
fi
|
|
|
|
|
2021-12-05 10:52:57 +03:00
|
|
|
# Config files
|
2018-12-19 09:18:04 +03:00
|
|
|
insinto /etc/john
|
|
|
|
doins run/*.chr run/password.lst
|
|
|
|
doins run/*.conf
|
2018-12-20 09:00:42 +03:00
|
|
|
doins -r run/rules run/ztex
|
2018-12-19 09:18:04 +03:00
|
|
|
|
2021-12-05 10:52:57 +03:00
|
|
|
# Documentation
|
|
|
|
rm -f doc/README || die
|
|
|
|
dodoc -r README.md doc/*
|
2018-12-19 09:18:04 +03:00
|
|
|
}
|