aboutsummaryrefslogtreecommitdiffstats
path: root/community/john
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-08-23 06:45:58 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-08-23 06:45:58 +0000
commitcaa15d2108a8e07649805f32784da705ed7761a6 (patch)
treeb67623ba4cdcfa76d80b4160e67da0289566218c /community/john
parentea586260e34b04432ea8ebf824e3f4c66341ed74 (diff)
downloadaports-caa15d2108a8e07649805f32784da705ed7761a6.tar.bz2
aports-caa15d2108a8e07649805f32784da705ed7761a6.tar.xz
community/john: moved from testing
Diffstat (limited to 'community/john')
-rw-r--r--community/john/APKBUILD183
-rw-r--r--community/john/gcc5-support.patch71
-rw-r--r--community/john/params-h.patch13
-rw-r--r--community/john/truecrypt_fmt_plug.patch14
4 files changed, 281 insertions, 0 deletions
diff --git a/community/john/APKBUILD b/community/john/APKBUILD
new file mode 100644
index 0000000000..f4df547fae
--- /dev/null
+++ b/community/john/APKBUILD
@@ -0,0 +1,183 @@
+# Contributor: Francesco Colista <fcolista@alpinelinux.org>
+# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
+pkgname=john
+pkgver=1.8.0
+_pkgrel=jumbo-1
+pkgrel=3
+pkgdesc="John the Ripper password cracker"
+url="http://www.openwall.com/john"
+arch="x86_64 armhf"
+license="GPL2"
+depends="nss"
+options="!strip"
+makedepends="libpcap-dev openssl-dev gmp-dev yasm-dev"
+install=""
+subpackages="$pkgname-doc \
+ $pkgname-scripts-py:py \
+ $pkgname-scripts-perl:perl \
+ $pkgname-scripts-ruby:ruby \
+ $pkgname-misc \
+ $pkgname-zsh-completion:zshcomp \
+ $pkgname-bash-completion:bashcomp"
+source="$pkgname-$pkgver.tar.gz::https://github.com/magnumripper/JohnTheRipper/archive/$pkgver-$_pkgrel.tar.gz
+ truecrypt_fmt_plug.patch
+ params-h.patch
+ gcc5-support.patch"
+builddir="$srcdir/JohnTheRipper-$pkgver-$_pkgrel"
+build() {
+ cd "$builddir"/src
+ sed -i -e "s/ac_default_prefix.*/ac_default_prefix=\/usr/g" configure
+ ./configure \
+ --disable-openmp
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p "$pkgdir"/usr/bin
+ mkdir -p "$pkgdir"/usr/share/doc/$pkgname
+
+ install -Dm644 run/john.conf ${pkgdir}/etc/john/john.conf
+ install -Dm644 run/john.local.conf ${pkgdir}/etc/john/john.local.conf
+ install -Dm644 doc/* ${pkgdir}/usr/share/doc/$pkgname
+ install -Dm644 doc/LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE
+
+ local john_bins="john calc_stat genmkvpwd mkvcalcproba \
+ relbench tgtsnarf raw2dyna"
+ for bin in $(echo ${john_bins}); do
+ install -Dm755 run/${bin} -t "${pkgdir}/usr/bin"
+ done
+
+ cd "${pkgdir}/usr/bin"
+ local john_links="hccap2john keepass2john mozilla2john \
+ pdf2john pfx2john pwsafe2john racf2john \
+ rar2john ssh2john unafs unique unsahdow \
+ undrop zip2john"
+ for link in $(echo ${john_links}); do
+ ln -s john ${link}
+ done
+}
+
+py() {
+ pkgdesc="Python Scripts for John the Ripper"
+ arch=noarch
+ depends="python libxml2 libgsf"
+ install_if="$pkgname=$pkgver-r$pkgrel"
+ cd "$builddir"
+ local john_scripts="1password2john.py ecryptfs2john.py \
+ kwallet2john.py openssl2john.py 7z2john.py efs2john.py \
+ lotus2john.py pcap2john.py aix2john.py encfs2john.py \
+ mcafee_epo2john.py pdf2john.py androidfde2john.py \
+ htdigest2john.py ml2john.py sipdump2john.py \
+ apex2john.py ikescan2john.py mozilla2john.py \
+ ssh2sshng.py bitcoin2john.py kdcdump2john.py \
+ netscreen.py sshng2john.py blockchain2john.py \
+ keychain2john.py odf2john.py strip2john.py \
+ cracf2john.py keystore2john.py office2john.py \
+ sxc2john.py dmg2john.py known_hosts2john.py \
+ openbsd_softraid2john.py"
+
+ for john_script in $(echo ${john_scripts}); do
+ install -D -m755 run/${john_script} \
+ "$subpkgdir"/usr/share/john
+ done
+}
+
+perl() {
+ pkgdesc="Perl Scripts for John the Ripper"
+ arch=noarch
+ depends="perl"
+ install_if="$pkgname=$pkgver-r$pkgrel"
+ cd "$builddir"
+ local john_scripts="aix2john.pl ios7tojohn.pl \
+ lion2john-alt.pl pass_gen.pl sap2john.pl \
+ cisco2john.pl ldif2john.pl lion2john.pl \
+ radius2john.pl sha-dump.pl hextoraw.pl \
+ leet.pl netntlm.pl rexgen2rules.pl \
+ sha-test.pl benchmark-unify"
+ for john_script in $(echo ${john_scripts}); do
+ install -D -m755 run/${john_script} \
+ "$subpkgdir"/usr/share/john
+ done
+}
+
+ruby() {
+ pkgdesc="Ruby Scripts for John the Ripper"
+ arch=noarch
+ depends="ruby"
+ install_if="$pkgname=$pkgver-r$pkgrel"
+ cd "$builddir"
+ local john_scripts="genincstats.rb"
+ for john_script in $(echo ${john_scripts}); do
+ install -D -m755 run/${john_script} \
+ "$subpkgdir"/usr/share/john
+ done
+}
+
+misc() {
+ pkgdesc="Misc tools for John the Ripper: password list and charset files"
+ arch=noarch
+ install_if="$pkgname=$pkgver-r$pkgrel"
+ cd "$builddir"
+ mkdir -p ${subpkgdir}/usr/share/john/kernels/
+
+ local john_pwdfiles="password.lst dictionary.rfc2865 stats"
+ local john_conffiles="dumb16.conf dumb32.conf dynamic.conf \
+ dynamic_flat_sse_formats.conf regex_alphabets.conf \
+ repeats16.conf repeats32.conf"
+ local john_chrfiles="lowernum.chr alnum.chr upper.chr lower.chr \
+ alpha.chr ascii.chr latin1.chr lanman.chr \
+ lowerspace.chr digits.chr lm_ascii.chr utf8.chr \
+ uppernum.chr makechr alnumspace.chr"
+
+ for john_pwdfiles in $(echo ${john_pwdfiles}); do
+ install -D -m644 run/${john_pwdfiles} \
+ "$subpkgdir"/usr/share/john
+ done
+
+ for john_conffiles in $(echo ${john_conffiles}); do
+ install -D -m644 run/${john_conffiles} \
+ "$subpkgdir"/usr/share/john
+ done
+
+
+ for john_chrfiles in $(echo ${john_chrfiles}); do
+ install -D -m644 run/${john_chrfiles} \
+ "$subpkgdir"/usr/share/john
+ done
+}
+
+bashcomp() {
+ depends=""
+ pkgdesc="Bash completions for $pkgname"
+ install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
+ arch="noarch"
+ cd "$builddir"
+ install -Dm644 run/john.bash_completion \
+ "$subpkgdir"/usr/share/bash-completion/completions/$pkgname || return 1
+}
+
+zshcomp() {
+ depends=""
+ pkgdesc="Zsh completions for $pkgname"
+ install_if="$pkgname=$pkgver-r$pkgrel zsh"
+ arch="noarch"
+ cd "$builddir"
+ install -Dm644 run/john.zsh_completion \
+ "$subpkgdir"/usr/share/zsh/site-functions/$pkgname || return 1
+}
+
+
+
+md5sums="2e80ec877e78d0c6ce72febb8844e0e2 john-1.8.0.tar.gz
+e6e158d946783b14e1109bd96d54bb64 truecrypt_fmt_plug.patch
+d6ab104062b9ce84b172ad7ecdd08226 params-h.patch
+b1f6ab678caabf4d3adb253735f46def gcc5-support.patch"
+sha256sums="95bbd3ecfbe51c6263317b3009bede98f20689a26c7aee191458ed9b26d5c9f6 john-1.8.0.tar.gz
+91731241b644dc8cf64d55260801277b168dcd38c5585c10120c75393f0c35fa truecrypt_fmt_plug.patch
+2b2396bf9e344bb28fcf91088d5dc12b0c91de3da74a4241d32c44496a291851 params-h.patch
+7abd8b061055f7c81de8cadc021050ac113f0f71a0bcfb83680f10d8ca6e04df gcc5-support.patch"
+sha512sums="8b7fad7a6330b5ff1afc306218ba698aaa27776b566f82c2e76102d5ceb10aeafa69d71fa6fff67c81996ea2c6a04384bab4696ed192306c6d074873562e7089 john-1.8.0.tar.gz
+80be6cc1b1b35c6a85392008638b2f8b6d8a518ee35f59405e2f5682e025e4b8beecf964148311e6f62d76b59153f04427024fa81aaf56ee2062ac2dbf0a9bcb truecrypt_fmt_plug.patch
+a5c22feb8bf11509c306a2f236f2bd4891fdfc3b01882f07d85015e0895d82f28df0dff78ba8d3a3862d8d95877a88a9eb8138e6c407b40881fa1455079b98fc params-h.patch
+4ebe8b41b1d0c3839348dcf5348332f9d7ce25919077fa054db64b7106150f299c6b177d117f7c18c1db672a494a6de6be8b5afe502f5ca3639602ba3aef6866 gcc5-support.patch"
diff --git a/community/john/gcc5-support.patch b/community/john/gcc5-support.patch
new file mode 100644
index 0000000000..3105add4d3
--- /dev/null
+++ b/community/john/gcc5-support.patch
@@ -0,0 +1,71 @@
+diff --git a/src/configure b/src/configure
+index 80653dc..1e62ce7 100755
+--- a/src/configure
++++ b/src/configure
+@@ -6165,6 +6165,53 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ fi
++ # Justified and Ancient (see #1093)
++ if test "1" = 1; then :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -std=gnu89" >&5
++$as_echo_n "checking if $CC supports -std=gnu89... " >&6; }
++fi
++ ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++ ac_saved_cflags="$CFLAGS"
++ CFLAGS="-Werror -std=gnu89"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ if test "1" = 1; then :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++fi
++ CFLAGS_EX="$CFLAGS_EX -std=gnu89"
++
++else
++ if test "1" = 1; then :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++ CFLAGS="$ac_saved_cflags"
++ ac_ext=c
++ac_cpp='$CPP $CPPFLAGS'
++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
++ac_compiler_gnu=$ac_cv_c_compiler_gnu
++
++
+
+ for i in "$CFLAGS_EX"; do
+ jtr_list_add_dupe=0
+diff --git a/src/configure.ac b/src/configure.ac
+index 5a3b1c7..0ea18f3 100644
+--- a/src/configure.ac
++++ b/src/configure.ac
+@@ -200,6 +200,8 @@ fi
+ JTR_FLAG_CHECK([-Wno-format-extra-args], 1)
+ #JTR_FLAG_CHECK([-Wno-unneeded-internal-declaration], 1)
+ AS_IF([test "x$JTR_FLAG_Q_CHECK_WORKS" = xyes], [JTR_FLAG_CHECK([-Qunused-arguments],1)])
++ # Justified and Ancient (see #1093)
++ JTR_FLAG_CHECK([-std=gnu89], 1)
+ JTR_LIST_ADD(CFLAGS_EXTRA, ["$CFLAGS_EX"])
+ ],[dnl
+ AC_MSG_NOTICE([Unable to validate $CC command line arguments. CFLAGS may need to be passed to ./configure for proper build])
diff --git a/community/john/params-h.patch b/community/john/params-h.patch
new file mode 100644
index 0000000000..0cd87a7ff5
--- /dev/null
+++ b/community/john/params-h.patch
@@ -0,0 +1,13 @@
+--- a/src/params.h.orig 2006-03-17 08:23:42.000000000 -0500
++++ b/src/params.h 2006-03-17 08:50:35.000000000 -0500
+@@ -101,8 +101,8 @@
+ /*
+ * File names.
+ */
+-#define CFG_FULL_NAME "$JOHN/john.conf"
+-#define CFG_ALT_NAME "$JOHN/john.ini"
++#define CFG_FULL_NAME "/etc/john/john.conf"
++#define CFG_ALT_NAME "/etc/john/john.ini"
+ #if JOHN_SYSTEMWIDE
+ #define CFG_PRIVATE_FULL_NAME JOHN_PRIVATE_HOME "/john.conf"
+ #define CFG_PRIVATE_ALT_NAME JOHN_PRIVATE_HOME "/john.ini"
diff --git a/community/john/truecrypt_fmt_plug.patch b/community/john/truecrypt_fmt_plug.patch
new file mode 100644
index 0000000000..20da51ba7e
--- /dev/null
+++ b/community/john/truecrypt_fmt_plug.patch
@@ -0,0 +1,14 @@
+--- a/src/truecrypt_fmt_plug.c.orig 2014-12-18 07:59:02.000000000 +0000
++++ b/src/truecrypt_fmt_plug.c 2014-12-18 20:00:47.321449585 +0000
+@@ -310,8 +310,8 @@ static int crypt_all(int *pcount, struct
+ pbkdf2_sha512_sse((const unsigned char **)pin, lens, psalt->salt, 64, psalt->num_iterations, &(x.poutc), sizeof(key), 0);
+ }
+ #else
+- if (is_sha512)
+- pbkdf2_sha512((const unsigned char*)key_buffer[i], strlen(key_buffer[i]), psalt->salt, 64, num_iterations, key, sizeof(key), 0);
++ if (psalt->hash_type == IS_SHA512)
++ pbkdf2_sha512((const unsigned char*)key_buffer[i], strlen((char*)key_buffer[i]), psalt->salt, 64, psalt->num_iterations, key, sizeof(key), 0);
+ #endif
+ else if (psalt->hash_type == IS_RIPEMD160)
+ pbkdf2_ripemd160(key_buffer[i], strlen((char*)(key_buffer[i])), psalt->salt, 64, psalt->num_iterations, key, sizeof(key), 0);
+