Date: Saturday, June 18, 2016 @ 16:07:45 Author: anthraxx Revision: 180435
upgpkg: john 1.8.0.jumbo1-1 Added: john/trunk/fix-32bit.patch john/trunk/fix-i686-openmp.patch john/trunk/gcc5.patch Modified: john/trunk/PKGBUILD john/trunk/john.install john/trunk/params.h.patch -----------------------+ PKGBUILD | 215 ++++++++++++++++++++++++------------------------ fix-32bit.patch | 24 +++++ fix-i686-openmp.patch | 69 +++++++++++++++ gcc5.patch | 63 ++++++++++++++ john.install | 3 params.h.patch | 14 ++- 6 files changed, 276 insertions(+), 112 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2016-06-18 14:32:54 UTC (rev 180434) +++ PKGBUILD 2016-06-18 16:07:45 UTC (rev 180435) @@ -1,3 +1,4 @@ +# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org> # Maintainer: Thorsten Töpper <[email protected]> # Contributor: Andrea Scarpino <[email protected]> # Contributor: Dale Blount <[email protected]> @@ -5,127 +6,131 @@ # Contributor: Michal Krenek <[email protected]> pkgname=john -pkgver=1.7.9 -pkgrel=9 -_jumbover=7 -pkgdesc="John The Ripper - A fast password cracker (jumbo-$_jumbover included)" +_jumbover=1 +_johnver=1.8.0 +pkgver=${_johnver}.jumbo${_jumbover} +pkgrel=1 +pkgdesc='John the Ripper password cracker' +url='http://www.openwall.com/john' arch=('i686' 'x86_64') -url="http://www.openwall.com/$pkgname/" license=('GPL2' 'custom') -depends=('openssl') -optdepends=("perl: for executing some of the scripts at /usr/share/john" - "ruby: for executing some of the scripts at /usr/share/john" - "python: for executing some of the scripts at /usr/share/john") +depends=('openssl' 'gmp' 'libpcap' 'openmpi' 'gcc-libs' 'libcl') +optdepends=( + 'bash-completion: completion for bash' + 'perl: perl based john scripts' + 'ruby: ruby based john scripts' + 'python: python based john scripts' + 'opencl-nvidia: OpenCL implemention for NVIDIA' + 'opencl-mesa: OpenCL support for AMD/ATI Radeon mesa drivers' +) +makedepends=('pkg-config' 'opencl-headers') backup=('etc/john/john.conf') install=john.install -source=(http://www.openwall.com/$pkgname/g/$pkgname-$pkgver.tar.bz2 - http://www.openwall.com/john/g/john-$pkgver-jumbo-$_jumbover.diff.gz - ftp://ftp.kfki.hu/pub/packages/security/ssh/ossh/libdes-4.04b.tar.gz - params.h.patch) -md5sums=('45f54fc59386ecd67daaef9f19781d93' - 'b953fcb7f743eeeb5f938a28c352b8ef' - 'c8d5c69f86c2eedb485583b0305284a1' - 'f69ed632eba8fb9e45847a4b4a323787') +source=(http://www.openwall.com/john/j/john-${_johnver}-jumbo-${_jumbover}.tar.xz + params.h.patch + gcc5.patch + fix-32bit.patch + fix-i686-openmp.patch) +sha512sums=('163cd71f634c2d1e9d0fa760984cc05001bfeef8300098d6b9cc8bf7e1719fec1d37142c39d7fd65ef37ee96c95681f01d7f0b1941058b7f9926442e2df5cd8e' + '4e7c530bf75d0c56409018097a2fee4a991c8332b25f985b16d91ffb631079d46870fa0c54eb519c8d60c7425c62c616e24617e0ebbad4193ccef8d001c08893' + '941a8fbe435d24287be158648d3083062806de639ce822645d949a171b2e662249bb13d9f5903017792cc979c7ff89615681adaed2afbf0d9c6ca5fe825e135a' + '824497e6fa67b1ff17a4b87544dedf5361e5ba07617ffb9e7718f2e90152b0bc2f39cd80a1badd84de0ef1e3442783bda3df1332d990b722a29d04b8b7449590' + '7eddd3c7360f459fba02b6c398b530baa7151f127384a1a8551a74658acbfb11a7d206a0482ab357496074be4ca20192c192962938e9bcdf1976cb4421d9af2c') +prepare() { + cd ${pkgname}-${_johnver}-jumbo-${_jumbover} + patch -p0 < "${srcdir}/params.h.patch" + patch -p1 < "${srcdir}/gcc5.patch" + patch -p1 < "${srcdir}/fix-32bit.patch" + patch -Rp1 < "${srcdir}/fix-i686-openmp.patch" +} + build() { - # jumbo patch - cd ${srcdir}/$pkgname-$pkgver - patch -p1 < ${srcdir}/$pkgname-$pkgver-jumbo-$_jumbover.diff - cd ${srcdir}/john-$pkgver/src/ + cd ${pkgname}-${_johnver}-jumbo-${_jumbover}/src - # patch default params - patch -p0 < ${srcdir}/params.h.patch - if [ "$CARCH" == "x86_64" ]; then - sed -i 's|CFLAGS = -c -Wall -O2|CFLAGS = -c -Wall -O2 -march=x86-64 -DJOHN_SYSTEMWIDE=1|' Makefile - sed -i 's|^LDFLAGS =\(.*\)|LDFLAGS =\1 -lm|' Makefile - sed -i -e 's|-m486||g' Makefile - else sed -i 's|CFLAGS = -c -Wall -O2|CFLAGS = -c -Wall -O2 -march=i686 -DJOHN_SYSTEMWIDE=1|' Makefile - fi - sed -i 's|LIBS = -ldes|LIBS = -ldes -Ldes|' Makefile -# sed -i 's|#include <des.h>|#include "des/des.h"|' KRB5_fmt.c - sed -i 's|#include <des.h>|#include "des/des.h"|' KRB5_std.h + local JOHN_CFG_FULL_NAME="-DCFG_FULL_NAME='\"/etc/john/john.conf\"'" + local JOHN_SYSTEMWIDE_FLAGS="-DJOHN_SYSTEMWIDE_EXEC='\"/usr/lib/john\"' -DJOHN_SYSTEMWIDE_HOME='\"/usr/share/john\"'" + local JOHN_FLAGS="-DJOHN_SYSTEMWIDE=1 ${JOHN_SYSTEMWIDE_FLAGS} -DCPU_FALLBACK ${JOHN_CFG_FULL_NAME}" + local CFLAGS="${CFLAGS} ${JOHN_FLAGS}" + local CONFIGURE_FLAGS="--prefix=/usr --disable-native-tests --enable-openmp --enable-mpi" + CONFIGURE_FLAGS+=" --enable-opencl --enable-pkg-config --enable-pcap" - # enable OMP - sed -i 's|#OMPFLAGS = -fopenmp$|OMPFLAGS = -fopenmp|' Makefile - - # build john - if [ "$CARCH" == "x86_64" ]; then - make linux-x86-64 - else make linux-x86-mmx - fi + if [[ "${CARCH}" == "x86_64" ]]; then + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS}" + make clean; make + mv ../run/john{,-non-avx} + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS} -mavx" + make clean; make + mv ../run/john{,-non-xop} + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS} -mxop" + make clean; make + elif [[ "${CARCH}" == "i686" ]]; then + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS}" + make clean; make + mv ../run/john{,-non-mmx} + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS} -mmmx" + make clean; make + mv ../run/john{,-non-sse} + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS} -msse2" + make clean; make + mv ../run/john{,-non-avx} + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS} -mavx" + make clean; make + mv ../run/john{,-non-xop} + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS} -mxop" + make clean; make + else + ./configure ${CONFIGURE_FLAGS} CFLAGS="${CFLAGS}" + make clean; make + fi } package() { - # config file - sed -i 's|$JOHN/john.local.conf|/etc/john/john.local.conf|g' ${srcdir}/john-$pkgver/run/john.conf - sed -i 's|$JOHN|/usr/share/john|g' ${srcdir}/john-$pkgver/run/john.conf - install -Dm644 ${srcdir}/john-$pkgver/run/john.conf ${pkgdir}/etc/john/john.conf + cd ${pkgname}-${_johnver}-jumbo-${_jumbover} - # docs - install -d ${pkgdir}/usr/share/doc/john - install -m644 ${srcdir}/john-$pkgver/doc/* ${pkgdir}/usr/share/doc/john/ - install -Dm644 ${srcdir}/john-$pkgver/doc/LICENSE ${pkgdir}/usr/share/licenses/$pkgname/LICENSE + # config + sed 's|$JOHN/john.local.conf|/etc/john/john.local.conf|g' -i run/john.conf + install -Dm 644 run/john.conf -t "${pkgdir}/etc/john" + install -Dm 644 run/*.conf -t "${pkgdir}/usr/share/john" + rm "${pkgdir}/usr/share/john/"{john.conf,john.local.conf} - # install password list, charset files - install -d ${pkgdir}/usr/share/john/ - install -m644 ${srcdir}/${pkgname}-${pkgver}/run/password.lst ${pkgdir}/usr/share/john/ - install -m644 ${srcdir}/${pkgname}-${pkgver}/run/dictionary.rfc2865 ${pkgdir}/usr/share/john/ - install -m644 ${srcdir}/${pkgname}-${pkgver}/run/stats ${pkgdir}/usr/share/john/ - install -m644 ${srcdir}/${pkgname}-${pkgver}/run/{all,alnum,alpha,digits,lanman}.chr \ - ${pkgdir}/usr/share/john/ - install -m644 ${srcdir}/${pkgname}-${pkgver}/run/{dumb16,dumb32,dynamic}.conf \ - ${pkgdir}/usr/share/john/ + # opencl + install -Dm 644 run/kernels/* -t "${pkgdir}/usr/share/john/kernels" - # install scripts - john_scripts=(benchmark-unify \ - cracf2john.py \ - genincstats.rb \ - ldif2john.pl \ - lion2john-alt.pl \ - lion2john.pl \ - netntlm.pl \ - netscreen.py \ - odf2john.py \ - pass_gen.pl \ - radius2john.pl \ - sap2john.pl \ - sha-dump.pl \ - sha-test.pl \ - sipdump2john.py) - for john_script in "${john_scripts[@]}"; do - install -m755 ${srcdir}/${pkgname}-${pkgver}/run/${john_script} \ - ${pkgdir}/usr/share/john - done + # docs + install -Dm 644 doc/* -t "${pkgdir}/usr/share/doc/john" + install -Dm 644 doc/LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" - install -m644 ${srcdir}/${pkgname}-${pkgver}/run/dynamic.conf ${pkgdir}/etc/john/ - install -Dm644 ${srcdir}/${pkgname}-${pkgver}/run/john.bash_completion \ - ${pkgdir}/etc/bash_completion.d/john + # completion + install -Dm 644 run/john.bash_completion "${pkgdir}/usr/share/bash-completion/completions/john" + install -Dm 644 run/john.zsh_completion "${pkgdir}/usr/share/zsh/site-functions/_john" - # install binaries - install -Dm755 ${srcdir}/john-$pkgver/run/john ${pkgdir}/usr/bin/john - install -Dm755 ${srcdir}/john-$pkgver/run/calc_stat ${pkgdir}/usr/bin/calc_stat - install -Dm755 ${srcdir}/john-$pkgver/run/genmkvpwd ${pkgdir}/usr/bin/genmkvpwd - install -Dm755 ${srcdir}/john-$pkgver/run/mkvcalcproba ${pkgdir}/usr/bin/mkvcalcproba - install -Dm755 ${srcdir}/john-$pkgver/run/relbench ${pkgdir}/usr/bin/relbench - install -Dm755 ${srcdir}/john-$pkgver/run/tgtsnarf ${pkgdir}/usr/bin/tgtsnarf - install -Dm755 ${srcdir}/john-$pkgver/run/mailer ${pkgdir}/usr/bin/john-mailer - install -Dm755 ${srcdir}/john-$pkgver/run/raw2dyna ${pkgdir}/usr/bin/raw2dyna + # binaries + install -Dm 755 run/john -t "${pkgdir}/usr/bin" + install -Dm 755 run/john-non-* -t "${pkgdir}/usr/lib/john"||true + local john_bins=(calc_stat cprepair genmkvpwd luks2john mkvcalcproba raw2dyna \ + relbench tgtsnarf uaf2john wpapcap2john vncpcap2john SIPdump) + for bin in "${john_bins[@]}"; do + install -Dm 755 run/${bin} -t "${pkgdir}/usr/bin" + done - # create links - cd ${pkgdir}/usr/bin - ln -s john hccap2john - ln -s john keepass2john - ln -s john pdf2john - ln -s john pwsafe2john - ln -s john racf2john - ln -s john rar2john - ln -s john ssh2john - ln -s john unafs - ln -s john unique - ln -s john unshadow - ln -s john undrop - ln -s john zip2john + # scripts + install -Dm 755 run/*.py run/*.pl run/*.rb run/{mailer,benchmark-unify} -t "${pkgdir}/usr/share/john" + + # data + install -Dm 644 run/*.chr run/*.lst run/dictionary* run/stats -t "${pkgdir}/usr/share/john" + + # syminks + cd "${pkgdir}/usr/bin" + local john_links=(base64conv dmg2john gpg2john hccap2john \ + keepass2john keychain2john keyring2john keystore2john \ + kwallet2john pfx2john putty2john pwsafe2john \ + racf2john rar2john ssh2john unique \ + unshadow zip2john unafs undrop \ + truecrypt_volume2john) + for link in "${john_links[@]}"; do + ln -s john ${link} + done } -# vim:set ts=2 sw=2 et: - +# vim: ts=2 sw=2 et: Added: fix-32bit.patch =================================================================== --- fix-32bit.patch (rev 0) +++ fix-32bit.patch 2016-06-18 16:07:45 UTC (rev 180435) @@ -0,0 +1,24 @@ +From 480e95b0e449863be3e1a5b0bc634a67df28b618 Mon Sep 17 00:00:00 2001 +From: Solar <[email protected]> +Date: Thu, 18 Dec 2014 21:24:01 +0100 +Subject: [PATCH] Fix a bug in truecrypt for non-x86 archs. Closes #912. + +--- + src/truecrypt_fmt_plug.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/truecrypt_fmt_plug.c b/src/truecrypt_fmt_plug.c +index 1c95c39..8cef85e 100644 +--- a/src/truecrypt_fmt_plug.c ++++ b/src/truecrypt_fmt_plug.c +@@ -310,8 +310,8 @@ static int crypt_all(int *pcount, struct db_salt *salt) + 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); Added: fix-i686-openmp.patch =================================================================== --- fix-i686-openmp.patch (rev 0) +++ fix-i686-openmp.patch 2016-06-18 16:07:45 UTC (rev 180435) @@ -0,0 +1,69 @@ +From 70d2140adda533680aec3c0cb0e828a868fafa68 Mon Sep 17 00:00:00 2001 +From: jfoug <[email protected]> +Date: Fri, 28 Nov 2014 06:43:27 -0600 +Subject: [PATCH] crypt: problems with #defines and strdup + +--- + src/c3_fmt.c | 35 ++++++++++++++++++++++------------- + 1 file changed, 22 insertions(+), 13 deletions(-) + +diff --git a/src/c3_fmt.c b/src/c3_fmt.c +index d1c694e..0fe867f 100644 +--- a/src/c3_fmt.c ++++ b/src/c3_fmt.c +@@ -17,6 +17,28 @@ + + #if HAVE_CRYPT + ++/* if this comes after the #define crap below, there are often ++ * problems with strdup or other things not being defined. We ++ * move this block of includes to above the _XOPEN_* defines ++ */ ++#if STRING_WITH_STRINGS ++#include <string.h> ++#include <strings.h> ++#elif HAVE_STRING_H ++#include <string.h> ++#elif HAVE_STRINGS_H ++#include <strings.h> ++#endif ++#if !AC_BUILT ++#include <string.h> ++#ifndef _MSC_VER ++#include <strings.h> ++#endif ++#undef _XOPEN_VERSION ++#undef _XOPEN_SOURCE ++#undef _XOPEN_SOURCE_EXTENDED ++#undef _GNU_SOURCE ++ + #define _XOPEN_SOURCE 4 /* for crypt(3) */ + #define _XOPEN_SOURCE_EXTENDED 1 /* for OpenBSD */ + #define _XOPEN_VERSION 4 +@@ -24,11 +46,6 @@ + #define _GNU_SOURCE 1 /* for crypt_r(3) */ + #include <stdio.h> + +-#if !AC_BUILT +-#include <string.h> +-#ifndef _MSC_VER +-#include <strings.h> +-#endif + #ifdef __CYGWIN__ + #include <crypt.h> + #endif +@@ -41,14 +58,6 @@ + #endif + #endif + +-#if STRING_WITH_STRINGS +-#include <string.h> +-#include <strings.h> +-#elif HAVE_STRING_H +-#include <string.h> +-#elif HAVE_STRINGS_H +-#include <strings.h> +-#endif + #if HAVE_CRYPT_H + #include <crypt.h> + #endif Added: gcc5.patch =================================================================== --- gcc5.patch (rev 0) +++ gcc5.patch 2016-06-18 16:07:45 UTC (rev 180435) @@ -0,0 +1,63 @@ +From e2e868db3e153b3f959e119a51703d4afb99c624 Mon Sep 17 00:00:00 2001 +From: magnum <[email protected]> +Date: Wed, 13 May 2015 12:05:00 +0200 +Subject: [PATCH] Add another solution to #1093. This make it possible to build + using gcc 5 without --std=gnu89 (although I kept the latter for now). See + also #1250. + +--- + src/DES_bs_b.c | 3 +++ + src/MD5_std.c | 12 ++++++++++++ + 2 files changed, 15 insertions(+) + +diff --git a/src/DES_bs_b.c b/src/DES_bs_b.c +index 306b4e4..18c9235 100644 +--- a/src/DES_bs_b.c ++++ b/src/DES_bs_b.c +@@ -1272,6 +1272,9 @@ static MAYBE_INLINE void DES_bs_finalize_keys(void) + #endif + + #if DES_bs_mt ++#if __GNUC__ >= 5 ++extern ++#endif + MAYBE_INLINE void DES_bs_set_salt_for_thread(int t, unsigned int salt) + #else + void DES_bs_set_salt(ARCH_WORD salt) +diff --git a/src/MD5_std.c b/src/MD5_std.c +index 6bdcd35..1eec9b4 100644 +--- a/src/MD5_std.c ++++ b/src/MD5_std.c +@@ -496,9 +496,15 @@ extern void MD5_body(MD5_word x[15], MD5_word out[4]); + #if MD5_std_mt + #define MD5_body(x, out) \ + MD5_body_for_thread(t, x, out) ++#if __GNUC__ >= 5 ++extern ++#endif + MAYBE_INLINE_BODY void MD5_body_for_thread(int t, + MD5_word x[15], MD5_word out[4]) + #else ++#if __GNUC__ >= 5 ++extern ++#endif + MAYBE_INLINE_BODY void MD5_body(MD5_word x[15], MD5_word out[4]) + #endif + { +@@ -595,10 +601,16 @@ MAYBE_INLINE_BODY void MD5_body(MD5_word x[15], MD5_word out[4]) + #if MD5_std_mt + #define MD5_body(x0, x1, out0, out1) \ + MD5_body_for_thread(t, x0, x1, out0, out1) ++#if __GNUC__ >= 5 ++extern ++#endif + MAYBE_INLINE_BODY void MD5_body_for_thread(int t, + MD5_word x0[15], MD5_word x1[15], + MD5_word out0[4], MD5_word out1[4]) + #else ++#if __GNUC__ >= 5 ++extern ++#endif + MAYBE_INLINE_BODY void MD5_body(MD5_word x0[15], MD5_word x1[15], + MD5_word out0[4], MD5_word out1[4]) + #endif Modified: john.install =================================================================== --- john.install 2016-06-18 14:32:54 UTC (rev 180434) +++ john.install 2016-06-18 16:07:45 UTC (rev 180435) @@ -2,9 +2,8 @@ touch /etc/john/john.local.conf 2> /dev/null } - post_upgrade() { post_install $1 } -# vim:set ts=2 sw=2 et: +# vim: ts=2 sw=2 et: Modified: params.h.patch =================================================================== --- params.h.patch 2016-06-18 14:32:54 UTC (rev 180434) +++ params.h.patch 2016-06-18 16:07:45 UTC (rev 180435) @@ -1,13 +1,17 @@ ---- params.h.orig 2006-03-17 08:23:42.000000000 -0500 -+++ params.h 2006-03-17 08:50:35.000000000 -0500 -@@ -101,8 +101,8 @@ +--- src/params.h 2014-12-18 15:14:33.000000000 +0000 ++++ src/params.h 2015-01-03 13:49:57.994775328 +0000 +@@ -135,8 +135,12 @@ /* * 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" ++#ifndef CFG_FULL_NAME ++#define CFG_FULL_NAME "$JOHN/john.conf" ++#endif ++#ifndef CFG_ALT_NAME ++#define CFG_ALT_NAME "$JOHN/john.ini" ++#endif #if JOHN_SYSTEMWIDE #define CFG_PRIVATE_FULL_NAME JOHN_PRIVATE_HOME "/john.conf" #define CFG_PRIVATE_ALT_NAME JOHN_PRIVATE_HOME "/john.ini"
