From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- app-crypt/johntheripper/Manifest | 12 + .../johntheripper-1.7.3.1-mkdir-sandbox.patch | 12 + .../files/johntheripper-1.7.6-cflags.patch | 83 +++++++ .../files/johntheripper-1.7.9-clang.patch | 15 ++ .../johntheripper-1.7.9-ppc-compile-fix.patch | 17 ++ .../johntheripper/johntheripper-1.7.9-r10.ebuild | 268 ++++++++++++++++++++ .../johntheripper/johntheripper-1.7.9-r11.ebuild | 273 +++++++++++++++++++++ .../johntheripper/johntheripper-1.7.9-r6.ebuild | 250 +++++++++++++++++++ app-crypt/johntheripper/metadata.xml | 18 ++ 9 files changed, 948 insertions(+) create mode 100644 app-crypt/johntheripper/Manifest create mode 100644 app-crypt/johntheripper/files/johntheripper-1.7.3.1-mkdir-sandbox.patch create mode 100644 app-crypt/johntheripper/files/johntheripper-1.7.6-cflags.patch create mode 100644 app-crypt/johntheripper/files/johntheripper-1.7.9-clang.patch create mode 100644 app-crypt/johntheripper/files/johntheripper-1.7.9-ppc-compile-fix.patch create mode 100644 app-crypt/johntheripper/johntheripper-1.7.9-r10.ebuild create mode 100644 app-crypt/johntheripper/johntheripper-1.7.9-r11.ebuild create mode 100644 app-crypt/johntheripper/johntheripper-1.7.9-r6.ebuild create mode 100644 app-crypt/johntheripper/metadata.xml (limited to 'app-crypt/johntheripper') diff --git a/app-crypt/johntheripper/Manifest b/app-crypt/johntheripper/Manifest new file mode 100644 index 000000000000..118a65f34402 --- /dev/null +++ b/app-crypt/johntheripper/Manifest @@ -0,0 +1,12 @@ +AUX johntheripper-1.7.3.1-mkdir-sandbox.patch 562 SHA256 9bf9577ed74048b4df82bc6fcf546469e07c93d27de438dd3aa36b5b360b27f0 SHA512 7aac967890dd57a67b6248722cefe9764e6ddfb280cb06f511e3f71e16527689098d39a80c32316f343030e3e5161e0e0003b83f95707b6a89dbf590fa5256a4 WHIRLPOOL 470ef8046765f009f367adeb217eb1300f99e517d07e3ff01aa4b38d2a529b39a2ca9a8d7dea45956c2f209b3acf5d0aa3d442cab5c148d05be893a0646e33e3 +AUX johntheripper-1.7.6-cflags.patch 2927 SHA256 3c4438ec4dcc3e8c81f1180544cd005f561a013b25ea51ad36189ced8a29f36f SHA512 47d9f074c9a639caf2366c425220f03c4daf882cbac3d86fa2649a5b12de3784713800be0f719a37b0b92c0c4b0a36ded247c351f894514cfa8fe67a0e23c732 WHIRLPOOL 9e209861eef8276515fdc46573a5ed2ba9dda658aebc6c767481cbdd0ccb1c30d35a8b1463b973a81c957dcb76455697814a8461f790415a7c07730bfdfba155 +AUX johntheripper-1.7.9-clang.patch 454 SHA256 8a6b1816e2251a467eb7c03c251d62ddd802204de0b8c42acdc3641bed5735b3 SHA512 8fe7579f9ff27e43d1d42287823a8c885b8095600a076cb5807c4fb9f94798e730b817a56f8e3120a762959d06a09e9a4e312656bea4cee858198ae4cff0b5e7 WHIRLPOOL dfb0135cdc432fa42d41d25e48a037ea2ca86234b704e93509f19849bbf3c521a4ea68ea2cea64652d6031dae232d7b14fe5b76c3faf9cebb620eabb5e655272 +AUX johntheripper-1.7.9-ppc-compile-fix.patch 444 SHA256 cd7174313d4592f39274e473623a8943c86c92ba896df23ee9cbdc6c7673d4fb SHA512 4af86bb0c5bfc4d88914f195744a596a71236fa49340b47748974a242fde82266fb6bfb41cb266980a3367b1c1a3797960f057a42c5ece3cdc09229c5a4a1513 WHIRLPOOL 6da1106b38cc3129ff1e170366c255c44d1e159bd158c5a743279225134c4899c8a7325f87cbc40e269e64aaa00d33ba0a6972778e6b44e10c01925bad0ba948 +DIST john-1.7.9-jumbo-7.diff.gz 1074044 SHA256 9e87e5660965e6e55214176299f67dd1b8a40820805441c62a57af6a6a4a19f5 SHA512 07a461df199fc776e8f62e969a95762fc1c99b72cdbd4a83d06f05ed236eaac9a918356ec9b8f8d060d1a9b2b8aa5c4021dfe53382761a5a76269ec66a5bd28a WHIRLPOOL da09df93277d90580cd08de2981a9d45df89f9a82f901f8bdc43acc66b97b6eb5515e603dc691cc000852a0847b943a104dee1826a59a000e09488604224f15a +DIST john-1.7.9.tar.bz2 717505 SHA256 1d40083e37a7bc1ba1177651cbb27898dcf2a812b8ccf1430db0c372ac6dc199 SHA512 121b4aa6fbb62b14db366aed739d7db760c136a4c3a39d8bba32bde269350354b3d18d15ee783f61b17913b0dd6773068cb01b3d3bbad290c309ae1cd027568b WHIRLPOOL e217d3ae3bafaa0d2465402a1c98f05018da9a95ce61effc7f2f20af4aa9ef9a54a636fc7025dfc283e815f5ebd07fafd64e4b01564739fe97053dbeafbd2b13 +EBUILD johntheripper-1.7.9-r10.ebuild 6458 SHA256 fa3a2b3305e0fb345b4452a34fd32a8a6abdc4eb14c9a19f8f450c0eba8d3445 SHA512 8f501299c07785dd117729a0b7140c06f95c821079ea3aaa8012d0915ba74e248de7a9da33e462ace27ad93298f0f08261689c5bccbf7df07e86fd13c4faa641 WHIRLPOOL 7c11364916aa3b8bccfa4c88c742d3f7e75ab6d38fd402c70a0cbd2f6f3ead82ed812dd0ae2012fb3e271088c8308bfe52242e97290a0202ee67310b1ec2c613 +EBUILD johntheripper-1.7.9-r11.ebuild 6502 SHA256 44db878d9cee087a49b3829fb36cffc06339e3a515c878149ed75228e367b36c SHA512 3c622e14aa90edef71ee68efeb514d7a99c94b8759b621f6b6a4f06fc60867b612c9ba9c4c5ebc92966efd28c25177eb1464923ba77006569ca5de51a86e0f96 WHIRLPOOL bdbaed8ad25838369eeb182ac738dac436f2f6ab56be79c39904652feadbc669d5e3b8b37db5db7e310675f038da29ec867ea128982859c48aa1ad20b362eb34 +EBUILD johntheripper-1.7.9-r6.ebuild 6006 SHA256 2faba4c76ed7789b584ba389ecafb23752ad8c92280587989f2d23b228c2ba1a SHA512 c9d890a764acc3e6231203c486da1870d31c70596e8543cfae61bf276c6cc08bac5b211946b1ec78644a1b6307ac854d3dc046fce3e89e294ee6210c9d7b1a90 WHIRLPOOL efd1dd9bce6c628f31eaf24f3aa6af5b10e11202f73472f5e70b3c50bdb515f5cbce42734c6de223eb529d42222ced55492d54711326fa7dde82bf854c670d6d +MISC ChangeLog 3375 SHA256 a64a3e0d13ba813acb0dc3df0956b606c23fed899594d9955ca2c0cb0674c7af SHA512 5d72d92970b32c4f1bfad49b93b1c38b1968fcd5b21ad907cac67fedcfd5a016b237cb781a3c553bdaecc615d5e9dc3d95a577ea79933a5c27bb15bd5af0247d WHIRLPOOL 756739c72aee260361343f5e4d5e57f204ccdcd55318511ea081387a455c381fdc4b1568c02cb594fe6864a283ac1e924c0d1717d5d518a08b375a3314143b54 +MISC ChangeLog-2015 28703 SHA256 374cbf05dc93924e08b672c8266bf686248aab8593a11ec91de2f71f4f14458a SHA512 d88a87a673d00584eec8c901f6156ab4500a7307f889a297eb32f3cda7c94533c3b1e5a6c3602e36869513c25b469338b70c8acffb8f5334fc4ef06c9dfcbd1c WHIRLPOOL c08eb6745d969aad7598c51a65989c528059905859385f1b81f2a7d5ba3bd98b7cf206fbf4420fe86d78b3888c24be4a9206baa88281c899fe2f2978271366ea +MISC metadata.xml 698 SHA256 1cc08fedd1da223180d854c2a62ca74f141c1f0b84574ca6ad70d4bba081d63c SHA512 148a01668f397d5e9cceacd4eb7ec903da251db713ce31a5a82d1e57af2aecbf9483f07226776039c3886ce96bc064199277e1d8af26679ae27630bb65d35feb WHIRLPOOL db488b951aac23e9ff34c353ed8831dcda22f38c5a165f74256bc65af44226d02d712eb9b8a2fa26d7e3f456e2471c3413064fa411756af3e88fed6e96427ba7 diff --git a/app-crypt/johntheripper/files/johntheripper-1.7.3.1-mkdir-sandbox.patch b/app-crypt/johntheripper/files/johntheripper-1.7.3.1-mkdir-sandbox.patch new file mode 100644 index 000000000000..5600f3cc17ec --- /dev/null +++ b/app-crypt/johntheripper/files/johntheripper-1.7.3.1-mkdir-sandbox.patch @@ -0,0 +1,12 @@ +diff -urNp john-1.7.3.1.org/src/path.c john-1.7.3.1/src/path.c +--- john-1.7.3.1.org/src/path.c 2003-10-01 04:26:25.000000000 +0300 ++++ john-1.7.3.1/src/path.c 2007-11-10 15:53:23.000000000 +0200 +@@ -55,7 +55,7 @@ void path_init(char **argv) + #ifdef JOHN_PRIVATE_HOME + private = path_expand(JOHN_PRIVATE_HOME); + if (mkdir(private, S_IRUSR | S_IWUSR | S_IXUSR)) { +- if (errno != EEXIST) pexit("mkdir: %s", private); ++ if (errno != EEXIST && errno != EACCES) pexit("mkdir: %s", private); + } else + fprintf(stderr, "Created directory: %s\n", private); + #endif diff --git a/app-crypt/johntheripper/files/johntheripper-1.7.6-cflags.patch b/app-crypt/johntheripper/files/johntheripper-1.7.6-cflags.patch new file mode 100644 index 000000000000..4b6637a29d8f --- /dev/null +++ b/app-crypt/johntheripper/files/johntheripper-1.7.6-cflags.patch @@ -0,0 +1,83 @@ +--- Makefile 2010-07-18 15:27:51.000000000 -0400 ++++ Makefile.mine 2010-07-18 15:30:09.000000000 -0400 +@@ -629,7 +629,7 @@ + macosx-ppc32-altivec: + $(LN) ppc32alt.h arch.h + $(MAKE) $(PROJ) \ +- CFLAGS="-c -Wall -fomit-frame-pointer" \ ++ CFLAGS="$(CFLAGS) -c -Wall -fomit-frame-pointer" \ + OPT_NORMAL="-fast -mcpu=7450" \ + OPT_INLINE="-fast -mcpu=7450 -finline-limit=4000 -faltivec -maltivec" + +@@ -638,7 +638,7 @@ + $(LN) ppc32alt.h arch.h + $(MAKE) $(PROJ) \ + ASFLAGS="$(ASFLAGS) -arch ppc" \ +- CFLAGS="-c -Wall -arch ppc -fomit-frame-pointer" \ ++ CFLAGS="$(CFLAGS) -c -Wall -arch ppc -fomit-frame-pointer" \ + LDFLAGS="$(LDFLAGS) -arch ppc" \ + OPT_NORMAL="-fast -mcpu=7450" \ + OPT_INLINE="-fast -mcpu=7450 -finline-limit=4000 -faltivec -maltivec" +@@ -650,7 +650,7 @@ + $(LN) ppc32.h arch.h + $(MAKE) $(PROJ) \ + CC=cc \ +- CFLAGS="-c -traditional-cpp" \ ++ CFLAGS="$(CFLAGS) -c -traditional-cpp" \ + OPT_NORMAL="-O2" \ + OPT_INLINE="-O3" + +@@ -658,7 +658,7 @@ + $(LN) ppc32.h arch.h + $(MAKE) $(PROJ) \ + ASFLAGS="$(ASFLAGS) -arch ppc" \ +- CFLAGS="-c -Wall -arch ppc -fomit-frame-pointer" \ ++ CFLAGS="$(CFLAGS) -c -Wall -arch ppc -fomit-frame-pointer" \ + LDFLAGS="$(LDFLAGS) -arch ppc" \ + OPT_NORMAL="-O2" \ + OPT_INLINE="-O3 -finline-limit=4000" +@@ -667,7 +667,7 @@ + macosx-ppc64-altivec: + $(LN) ppc64alt.h arch.h + $(MAKE) $(PROJ) \ +- CFLAGS="-c -m64 -Wall -fomit-frame-pointer" \ ++ CFLAGS="$(CFLAGS) -c -m64 -Wall -fomit-frame-pointer" \ + LDFLAGS="$(LDFLAGS) -m64" \ + OPT_NORMAL="-fast" \ + OPT_INLINE="-fast -finline-limit=4000 -faltivec -maltivec" +@@ -676,7 +676,7 @@ + $(LN) ppc64alt.h arch.h + $(MAKE) $(PROJ) \ + ASFLAGS="$(ASFLAGS) -arch ppc" \ +- CFLAGS="-c -arch ppc -m64 -Wall -fomit-frame-pointer" \ ++ CFLAGS="$(CFLAGS) -c -arch ppc -m64 -Wall -fomit-frame-pointer" \ + LDFLAGS="$(LDFLAGS) -arch ppc -m64" \ + OPT_NORMAL="-fast" \ + OPT_INLINE="-fast -finline-limit=4000 -faltivec -maltivec" +@@ -684,7 +684,7 @@ + macosx-ppc64: + $(LN) ppc64.h arch.h + $(MAKE) $(PROJ) \ +- CFLAGS="-c -m64 -Wall -fomit-frame-pointer" \ ++ CFLAGS="$(CFLAGS) -c -m64 -Wall -fomit-frame-pointer" \ + LDFLAGS="$(LDFLAGS) -m64" \ + OPT_NORMAL="-fast" \ + OPT_INLINE="-fast -finline-limit=4000" +@@ -693,7 +693,7 @@ + $(LN) ppc64.h arch.h + $(MAKE) $(PROJ) \ + ASFLAGS="$(ASFLAGS) -arch ppc" \ +- CFLAGS="-c -arch ppc -m64 -Wall -fomit-frame-pointer" \ ++ CFLAGS="$(CFLAGS) -c -arch ppc -m64 -Wall -fomit-frame-pointer" \ + LDFLAGS="$(LDFLAGS) -arch ppc -m64" \ + OPT_NORMAL="-fast" \ + OPT_INLINE="-fast -finline-limit=4000" +@@ -723,7 +723,7 @@ + $(LN) ppc32alt.h arch.h + $(MAKE) $(PROJ) \ + ASFLAGS="$(ASFLAGS) -arch ppc" \ +- CFLAGS="-c -Wall -arch ppc -fomit-frame-pointer" \ ++ CFLAGS="$(CFLAGS) -c -Wall -arch ppc -fomit-frame-pointer" \ + LDFLAGS="$(LDFLAGS) -arch ppc" \ + OPT_NORMAL="-fast -mcpu=7450" \ + OPT_INLINE="-fast -mcpu=7450 -finline-limit=4000 -faltivec -maltivec" diff --git a/app-crypt/johntheripper/files/johntheripper-1.7.9-clang.patch b/app-crypt/johntheripper/files/johntheripper-1.7.9-clang.patch new file mode 100644 index 000000000000..1b85914ed4ff --- /dev/null +++ b/app-crypt/johntheripper/files/johntheripper-1.7.9-clang.patch @@ -0,0 +1,15 @@ +Fix for building johntheripper with clang. + +https://bugs.gentoo.org/show_bug.cgi?id=554392 + +--- john-1.7.9-jumbo-7/src/rawSHA1_ng_fmt.c ++++ john-1.7.9-jumbo-7/src/rawSHA1_ng_fmt.c +@@ -530,7 +530,7 @@ + + #if defined(__SSE4_1__) + +-# if !defined(__INTEL_COMPILER) ++# if !defined(__INTEL_COMPILER) && !defined(__clang__) + // This intrinsic is not always available in GCC, so define it here. + static inline int _mm_testz_si128 (__m128i __M, __m128i __V) + { diff --git a/app-crypt/johntheripper/files/johntheripper-1.7.9-ppc-compile-fix.patch b/app-crypt/johntheripper/files/johntheripper-1.7.9-ppc-compile-fix.patch new file mode 100644 index 000000000000..c28ec21a0ae8 --- /dev/null +++ b/app-crypt/johntheripper/files/johntheripper-1.7.9-ppc-compile-fix.patch @@ -0,0 +1,17 @@ +diff -ru john-1.7.9.orig/src/gost_plug.c john-1.7.9/src/gost_plug.c +--- john-1.7.9.orig/src/gost_plug.c 2013-01-20 16:15:45.464000001 +0000 ++++ john-1.7.9/src/gost_plug.c 2013-01-20 16:16:06.104000001 +0000 +@@ -531,7 +531,6 @@ + } + #endif + +-#ifndef __GLIBC__ + void rhash_u32_swap_copy(void* to, int index, const void* from, size_t length) { + size_t i; + unsigned int *pO, *pI; +@@ -542,4 +541,3 @@ + *pO++ = bswap_32(*pI++); + } + } +-#endif + diff --git a/app-crypt/johntheripper/johntheripper-1.7.9-r10.ebuild b/app-crypt/johntheripper/johntheripper-1.7.9-r10.ebuild new file mode 100644 index 000000000000..fc6fab5d5284 --- /dev/null +++ b/app-crypt/johntheripper/johntheripper-1.7.9-r10.ebuild @@ -0,0 +1,268 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit cuda eutils flag-o-matic toolchain-funcs pax-utils multilib + +MY_PN="john" +MY_P="${MY_PN}-${PV}" + +JUMBO="jumbo-7" + +DESCRIPTION="fast password cracker" +HOMEPAGE="http://www.openwall.com/john/" + +SRC_URI="http://www.openwall.com/john/g/${MY_P}.tar.bz2 + !minimal? ( http://www.openwall.com/john/g/${MY_P}-${JUMBO}.diff.gz )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos" +#Remove AltiVec USE flag. Appears to be an upstream issue. +IUSE="cuda custom-cflags -minimal cpu_flags_x86_mmx libressl mozilla mpi opencl openmp cpu_flags_x86_sse2" +REQUIRED_USE="openmp? ( !minimal ) + mpi? ( !minimal ) + cuda? ( !minimal ) + opencl? ( !minimal ) + mozilla? ( !minimal )" + +DEPEND="sys-libs/zlib + !minimal? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + mpi? ( virtual/mpi ) + cuda? ( x11-drivers/nvidia-drivers + dev-util/nvidia-cuda-toolkit:= ) + opencl? ( virtual/opencl ) + mozilla? ( dev-libs/nss dev-libs/nspr )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +has_xop() { + echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __XOP__ 1" +} + +has_avx() { + echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __AVX__ 1" +} + +get_target() { + if use alpha; then + echo "linux-alpha" + elif use amd64; then + if has_xop; then + echo "linux-x86-64-xop" + elif has_avx; then + echo "linux-x86-64-avx" + else + echo "linux-x86-64" + fi + elif use ppc; then + #if use altivec; then + # echo "linux-ppc32-altivec" + #else + echo "linux-ppc32" + #fi + elif use ppc64; then + #if use altivec; then + # echo "linux-ppc32-altivec" + #else + echo "linux-ppc64" + #fi + # linux-ppc64-altivec is slightly slower than linux-ppc32-altivec for most hash types. + # as per the Makefile comments + elif use sparc; then + echo "linux-sparc" + elif use x86; then + if has_xop; then + echo "linux-x86-xop" + elif has_avx; then + echo "linux-x86-avx" + elif use cpu_flags_x86_sse2; then + echo "linux-x86-sse2" + elif use cpu_flags_x86_mmx; then + echo "linux-x86-mmx" + else + echo "linux-x86-any" + fi + elif use ppc-macos; then + # force AltiVec, the non-altivec profile contains ancient compiler cruft + # if use altivec; then + echo "macosx-ppc32-altivec" + # else + # echo "macosx-ppc32" + # fi + # for Tiger this can be macosx-ppc64 + elif use x86-macos; then + if use cpu_flags_x86_sse2; then + echo "macosx-x86-sse2" + else + echo "macosx-x86" + fi + elif use x86-solaris; then + echo "solaris-x86-any" + elif use x86-fbsd; then + if use cpu_flags_x86_sse2; then + echo "freebsd-x86-sse2" + elif use cpu_flags_x86_mmx; then + echo "freebsd-x86-mmx" + else + echo "freebsd-x86-any" + fi + elif use amd64-fbsd; then + echo "freebsd-x86-64" + else + echo "generic" + fi +} + +get_john_objs() { + echo -n '${JOHN_COMMON_OBJS} ' + if use opencl; then + echo -n '${OCL_OBJS} ' + fi + if use cuda; then + echo -n '${CUDA_OBJS}' + fi +} + +pkg_setup() { + if use openmp && [[ ${MERGE_TYPE} != binary ]]; then + tc-has-openmp || die "Please switch to an openmp compatible compiler" + fi +} + +src_prepare() { + if ! use minimal; then + epatch "${WORKDIR}/${MY_P}-${JUMBO}.diff" + + if use mpi ; then + sed -e "s/^#CC = mpicc/CC = mpicc/" \ + -e "s/^#MPIOBJ =/MPIOBJ =/" \ + -i src/Makefile || die + fi + + # fix typo in jumbo patch + sed -i 's:All15:All5:' run/john.conf || die + # fix compile on ppc (only needed for jumbo-7) + epatch "${FILESDIR}/${P}-ppc-compile-fix.patch" + fi + + cd src + epatch "${FILESDIR}/${PN}-1.7.6-cflags.patch" + epatch "${FILESDIR}/${PN}-1.7.3.1-mkdir-sandbox.patch" + + if ! use minimal; then + sed -e "s/LDFLAGS *= */override LDFLAGS += /" -e "/LDFLAGS/s/-s//" \ + -e "/LDFLAGS/s/-L[^ ]*//g" -e "/CFLAGS/s/-[IL][^ ]*//g" \ + -i Makefile || die "sed Makefile failed" + sed -i 's#/usr/local#/opt#g' Makefile || die + fi + sed -i 's#JOHN_OBJS = \\#JOHN_COMMON_OBJS = \\#g' Makefile || die + + if use cuda; then + cuda_src_prepare + sed \ + -e "/^NVCC_FLAGS/s:-arch sm_10:${NVCCFLAGS}:g" \ + -i Makefile || die + fi + + if use mozilla; then + sed -i -e '/HAVE_NSS =/s/^#*//' -e 's/NSS_override//' Makefile || die + fi +} + +src_compile() { + local OMP + + use custom-cflags || strip-flags + echo "#define JOHN_SYSTEMWIDE 1" >> config.gentoo + echo "#define JOHN_SYSTEMWIDE_HOME \"${EPREFIX}/etc/john\"" >> config.gentoo + echo "#define JOHN_SYSTEMWIDE_EXEC \"${EPREFIX}/usr/libexec/john\"" >> config.gentoo + append-flags -fPIC -fPIE + gcc-specs-pie && append-ldflags -nopie + use openmp && OMP="-fopenmp" + + CPP="$(tc-getCXX)" CC="$(tc-getCC)" AS="$(tc-getCC)" LD="$(tc-getCC)" + if use mpi; then + CPP=mpicxx CC=mpicc AS=mpicc LD=mpicc + fi + + #this stuff was all stolen from the Makefile, if build breaks, check this first + if use opencl; then + GPUCFLAGS="${GPUCFLAGS} -DCL_VERSION_1_0" + GPULDFLAGS="${GPULDFLAGS} -lOpenCL" + fi + if use cuda; then + GPUCFLAGS="${GPUCFLAGS} -DHAVE_CUDA" + GPULDFLAGS="${GPULDFLAGS} -L/opt/cuda/$(get_libdir) -lcudart" + fi + + emake -C src/ \ + CPP="${CPP}" CC="${CC}" AS="${AS}" LD="${LD}" \ + CFLAGS="-c -Wall -include ../config.gentoo ${CFLAGS} ${OMP} ${GPUCFLAGS}" \ + LDFLAGS="${LDFLAGS} ${GPULDFLAGS}" \ + OPT_NORMAL="" \ + OMPFLAGS="${OMP}" \ + JOHN_OBJS="$(get_john_objs)" \ + $(get_target) +} + +src_test() { + if use opencl; then + cp src/opencl/*.cl run/ + cp src/opencl_*.h run/ + fi + pax-mark -mr run/john + if use opencl || use cuda; then + ewarn "GPU tests fail, skipping all tests..." + else + make -C src/ check + fi +} + +src_install() { + # executables + dosbin run/john + newsbin run/mailer john-mailer + + pax-mark -mr "${ED}usr/sbin/john" || die + + dosym john /usr/sbin/unafs + dosym john /usr/sbin/unique + dosym john /usr/sbin/unshadow + + # jumbo-patch additions + if ! use minimal; then + for s in \ + keychain2john keepass2john pwsafe2john hccap2john \ + racf2john zip2john rar2john pdf2john ssh2john undrop \ + ; do + dosym john /usr/sbin/$s + done + use mozilla && dosym john /usr/sbin/mozilla2john + dosbin run/calc_stat + dosbin run/genmkvpwd + dosbin run/mkvcalcproba + dosbin run/raw2dyna + dosbin run/tgtsnarf + insinto /etc/john + doins run/genincstats.rb run/stats + doins run/netscreen.py run/sap2john.pl + if use opencl; then + doins src/opencl/*.cl + doins src/opencl_*.h + fi + fi + + # config files + insinto /etc/john + doins run/*.chr run/password.lst + doins run/*.conf + + # documentation + dodoc doc/* +} diff --git a/app-crypt/johntheripper/johntheripper-1.7.9-r11.ebuild b/app-crypt/johntheripper/johntheripper-1.7.9-r11.ebuild new file mode 100644 index 000000000000..b4d60a13decb --- /dev/null +++ b/app-crypt/johntheripper/johntheripper-1.7.9-r11.ebuild @@ -0,0 +1,273 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit cuda eutils flag-o-matic toolchain-funcs pax-utils multilib + +MY_PN="john" +MY_P="${MY_PN}-${PV}" + +JUMBO="jumbo-7" + +DESCRIPTION="fast password cracker" +HOMEPAGE="http://www.openwall.com/john/" + +SRC_URI="http://www.openwall.com/john/g/${MY_P}.tar.bz2 + !minimal? ( http://www.openwall.com/john/g/${MY_P}-${JUMBO}.diff.gz )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos" +#Remove AltiVec USE flag. Appears to be an upstream issue. +IUSE="cuda custom-cflags -minimal cpu_flags_x86_mmx libressl mozilla mpi opencl openmp cpu_flags_x86_sse2" +REQUIRED_USE="openmp? ( !minimal ) + mpi? ( !minimal ) + cuda? ( !minimal ) + opencl? ( !minimal ) + mozilla? ( !minimal )" + +DEPEND="sys-libs/zlib + !minimal? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + ) + mpi? ( virtual/mpi ) + cuda? ( x11-drivers/nvidia-drivers + dev-util/nvidia-cuda-toolkit:= ) + opencl? ( virtual/opencl ) + mozilla? ( dev-libs/nss dev-libs/nspr )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +has_xop() { + echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __XOP__ 1" +} + +has_avx() { + echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __AVX__ 1" +} + +get_target() { + if use alpha; then + echo "linux-alpha" + elif use amd64; then + if has_xop; then + echo "linux-x86-64-xop" + elif has_avx; then + echo "linux-x86-64-avx" + else + echo "linux-x86-64" + fi + elif use ppc; then + #if use altivec; then + # echo "linux-ppc32-altivec" + #else + echo "linux-ppc32" + #fi + elif use ppc64; then + #if use altivec; then + # echo "linux-ppc32-altivec" + #else + echo "linux-ppc64" + #fi + # linux-ppc64-altivec is slightly slower than linux-ppc32-altivec for most hash types. + # as per the Makefile comments + elif use sparc; then + echo "linux-sparc" + elif use x86; then + if has_xop; then + echo "linux-x86-xop" + elif has_avx; then + echo "linux-x86-avx" + elif use cpu_flags_x86_sse2; then + echo "linux-x86-sse2" + elif use cpu_flags_x86_mmx; then + echo "linux-x86-mmx" + else + echo "linux-x86-any" + fi + elif use ppc-macos; then + # force AltiVec, the non-altivec profile contains ancient compiler cruft + # if use altivec; then + echo "macosx-ppc32-altivec" + # else + # echo "macosx-ppc32" + # fi + # for Tiger this can be macosx-ppc64 + elif use x86-macos; then + if use cpu_flags_x86_sse2; then + echo "macosx-x86-sse2" + else + echo "macosx-x86" + fi + elif use x86-solaris; then + echo "solaris-x86-any" + elif use x86-fbsd; then + if use cpu_flags_x86_sse2; then + echo "freebsd-x86-sse2" + elif use cpu_flags_x86_mmx; then + echo "freebsd-x86-mmx" + else + echo "freebsd-x86-any" + fi + elif use amd64-fbsd; then + echo "freebsd-x86-64" + else + echo "generic" + fi +} + +get_john_objs() { + echo -n '${JOHN_COMMON_OBJS} ' + if use opencl; then + echo -n '${OCL_OBJS} ' + fi + if use cuda; then + echo -n '${CUDA_OBJS}' + fi +} + +pkg_setup() { + if use openmp && [[ ${MERGE_TYPE} != binary ]]; then + tc-has-openmp || die "Please switch to an openmp compatible compiler" + fi +} + +src_prepare() { + if ! use minimal; then + eapply "${WORKDIR}/${MY_P}-${JUMBO}.diff" + + if use mpi ; then + sed -e "s/^#CC = mpicc/CC = mpicc/" \ + -e "s/^#MPIOBJ =/MPIOBJ =/" \ + -i src/Makefile || die + fi + + # fix typo in jumbo patch + sed -i 's:All15:All5:' run/john.conf || die + # fix compile on ppc (only needed for jumbo-7) + eapply "${FILESDIR}/${P}-ppc-compile-fix.patch" + fi + + cd src || die + eapply -p0 "${FILESDIR}/${PN}-1.7.6-cflags.patch" + eapply -p2 "${FILESDIR}/${PN}-1.7.3.1-mkdir-sandbox.patch" + eapply -p2 "${FILESDIR}/${PN}-1.7.9-clang.patch" + eapply_user + + if ! use minimal; then + sed -e "s/LDFLAGS *= */override LDFLAGS += /" -e "/LDFLAGS/s/-s//" \ + -e "/LDFLAGS/s/-L[^ ]*//g" -e "/CFLAGS/s/-[IL][^ ]*//g" \ + -i Makefile || die "sed Makefile failed" + sed -i 's#/usr/local#/opt#g' Makefile || die + fi + sed -i 's#JOHN_OBJS = \\#JOHN_COMMON_OBJS = \\#g' Makefile || die + + if use cuda; then + cuda_src_prepare + sed \ + -e "/^NVCC_FLAGS/s:-arch sm_10:${NVCCFLAGS}:g" \ + -i Makefile || die + fi + + if use mozilla; then + sed -i -e '/HAVE_NSS =/s/^#*//' -e 's/NSS_override//' Makefile || die + fi +} + +src_compile() { + local OMP + + use custom-cflags || strip-flags + cat <<- EOF >> config.gentoo || die + #define JOHN_SYSTEMWIDE 1 + #define JOHN_SYSTEMWIDE_HOME "${EPREFIX}/etc/john" + #define JOHN_SYSTEMWIDE_EXEC "${EPREFIX}/usr/libexec/john" +EOF + + append-flags -fPIC -fPIE + gcc-specs-pie && append-ldflags -nopie + use openmp && OMP="-fopenmp" + + CPP="$(tc-getCXX)" CC="$(tc-getCC)" AS="$(tc-getCC)" LD="$(tc-getCC)" + if use mpi; then + CPP=mpicxx CC=mpicc AS=mpicc LD=mpicc + fi + + #this stuff was all stolen from the Makefile, if build breaks, check this first + if use opencl; then + GPUCFLAGS="${GPUCFLAGS} -DCL_VERSION_1_0" + GPULDFLAGS="${GPULDFLAGS} -lOpenCL" + fi + if use cuda; then + GPUCFLAGS="${GPUCFLAGS} -DHAVE_CUDA" + GPULDFLAGS="${GPULDFLAGS} -L/opt/cuda/$(get_libdir) -lcudart" + fi + + emake -C src/ \ + CPP="${CPP}" CC="${CC}" AS="${AS}" LD="${LD}" \ + CFLAGS="-c -Wall -include ../config.gentoo ${CFLAGS} ${OMP} ${GPUCFLAGS}" \ + LDFLAGS="${LDFLAGS} ${GPULDFLAGS}" \ + OPT_NORMAL="" \ + OMPFLAGS="${OMP}" \ + JOHN_OBJS="$(get_john_objs)" \ + $(get_target) +} + +src_test() { + if use opencl; then + cp src/opencl/*.cl run/ + cp src/opencl_*.h run/ + fi + pax-mark -mr run/john + if use opencl || use cuda; then + ewarn "GPU tests fail, skipping all tests..." + else + make -C src/ check + fi +} + +src_install() { + # executables + dosbin run/john + newsbin run/mailer john-mailer + + pax-mark -mr "${ED}usr/sbin/john" || die + + dosym john /usr/sbin/unafs + dosym john /usr/sbin/unique + dosym john /usr/sbin/unshadow + + # jumbo-patch additions + if ! use minimal; then + for s in \ + keychain2john keepass2john pwsafe2john hccap2john \ + racf2john zip2john rar2john pdf2john ssh2john undrop \ + ; do + dosym john /usr/sbin/$s + done + use mozilla && dosym john /usr/sbin/mozilla2john + dosbin run/calc_stat + dosbin run/genmkvpwd + dosbin run/mkvcalcproba + dosbin run/raw2dyna + dosbin run/tgtsnarf + insinto /etc/john + doins run/genincstats.rb run/stats + doins run/netscreen.py run/sap2john.pl + if use opencl; then + doins src/opencl/*.cl + doins src/opencl_*.h + fi + fi + + # config files + insinto /etc/john + doins run/*.chr run/password.lst + doins run/*.conf + + # documentation + dodoc doc/* +} diff --git a/app-crypt/johntheripper/johntheripper-1.7.9-r6.ebuild b/app-crypt/johntheripper/johntheripper-1.7.9-r6.ebuild new file mode 100644 index 000000000000..81c08300e9a7 --- /dev/null +++ b/app-crypt/johntheripper/johntheripper-1.7.9-r6.ebuild @@ -0,0 +1,250 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="4" + +inherit eutils flag-o-matic toolchain-funcs pax-utils multilib + +MY_PN="john" +MY_P="${MY_PN}-${PV}" + +JUMBO="jumbo-7" + +DESCRIPTION="fast password cracker" +HOMEPAGE="http://www.openwall.com/john/" + +SRC_URI="http://www.openwall.com/john/g/${MY_P}.tar.bz2 + !minimal? ( http://www.openwall.com/john/g/${MY_P}-${JUMBO}.diff.gz )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ~mips ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos" +#Remove AltiVec USE flag. Appears to be an upstream issue. +IUSE="cuda custom-cflags -minimal cpu_flags_x86_mmx mpi opencl openmp cpu_flags_x86_sse2" +REQUIRED_USE="openmp? ( !minimal ) + mpi? ( !minimal ) + cuda? ( !minimal ) + opencl? ( !minimal )" + +RDEPEND="sys-libs/zlib + !minimal? ( >=dev-libs/openssl-0.9.7:0 ) + mpi? ( virtual/mpi ) + cuda? ( x11-drivers/nvidia-drivers dev-util/nvidia-cuda-toolkit ) + opencl? ( virtual/opencl )" +DEPEND="${RDEPEND}" + +S="${WORKDIR}/${MY_P}" + +has_xop() { + echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __XOP__ 1" +} + +has_avx() { + echo | $(tc-getCC) ${CFLAGS} -E -dM - | grep -q "#define __AVX__ 1" +} + +get_target() { + if use alpha; then + echo "linux-alpha" + elif use amd64; then + if has_xop; then + echo "linux-x86-64-xop" + elif has_avx; then + echo "linux-x86-64-avx" + else + echo "linux-x86-64" + fi + elif use ppc; then + #if use altivec; then + # echo "linux-ppc32-altivec" + #else + echo "linux-ppc32" + #fi + elif use ppc64; then + #if use altivec; then + # echo "linux-ppc32-altivec" + #else + echo "linux-ppc64" + #fi + # linux-ppc64-altivec is slightly slower than linux-ppc32-altivec for most hash types. + # as per the Makefile comments + elif use sparc; then + echo "linux-sparc" + elif use x86; then + if has_xop; then + echo "linux-x86-xop" + elif has_avx; then + echo "linux-x86-avx" + elif use cpu_flags_x86_sse2; then + echo "linux-x86-sse2" + elif use cpu_flags_x86_mmx; then + echo "linux-x86-mmx" + else + echo "linux-x86-any" + fi + elif use ppc-macos; then + # force AltiVec, the non-altivec profile contains ancient compiler cruft + # if use altivec; then + echo "macosx-ppc32-altivec" + # else + # echo "macosx-ppc32" + # fi + # for Tiger this can be macosx-ppc64 + elif use x86-macos; then + if use cpu_flags_x86_sse2; then + echo "macosx-x86-sse2" + else + echo "macosx-x86" + fi + elif use x86-solaris; then + echo "solaris-x86-any" + elif use x86-fbsd; then + if use cpu_flags_x86_sse2; then + echo "freebsd-x86-sse2" + elif use cpu_flags_x86_mmx; then + echo "freebsd-x86-mmx" + else + echo "freebsd-x86-any" + fi + elif use amd64-fbsd; then + echo "freebsd-x86-64" + else + echo "generic" + fi +} + +get_john_objs() { + echo -n '${JOHN_COMMON_OBJS} ' + if use opencl; then + echo -n '${OCL_OBJS} ' + fi + if use cuda; then + echo -n '${CUDA_OBJS}' + fi +} + +pkg_setup() { + if use openmp ; then + tc-has-openmp || die "Please switch to an openmp compatible compiler" + fi +} + +src_prepare() { + if ! use minimal; then + epatch "${WORKDIR}/${MY_P}-${JUMBO}.diff" + + if use mpi ; then + sed -e "s/^#CC = mpicc/CC = mpicc/" \ + -e "s/^#MPIOBJ =/MPIOBJ =/" \ + -i src/Makefile || die + fi + + # fix typo in jumbo patch + sed -i 's:All15:All5:' run/john.conf || die + # fix compile on ppc (only needed for jumbo-7) + epatch "${FILESDIR}/${P}-ppc-compile-fix.patch" + fi + + cd src + epatch "${FILESDIR}/${PN}-1.7.6-cflags.patch" + epatch "${FILESDIR}/${PN}-1.7.3.1-mkdir-sandbox.patch" + + if ! use minimal; then + sed -e "s/LDFLAGS *= */override LDFLAGS += /" -e "/LDFLAGS/s/-s//" \ + -e "/LDFLAGS/s/-L[^ ]*//g" -e "/CFLAGS/s/-[IL][^ ]*//g" \ + -i Makefile || die "sed Makefile failed" + sed -i 's#/usr/local#/opt#g' Makefile || die + fi + sed -i 's#JOHN_OBJS = \\#JOHN_COMMON_OBJS = \\#g' Makefile || die +} + +src_compile() { + local OMP + + use custom-cflags || strip-flags + echo "#define JOHN_SYSTEMWIDE 1" >> config.gentoo + echo "#define JOHN_SYSTEMWIDE_HOME \"${EPREFIX}/etc/john\"" >> config.gentoo + echo "#define JOHN_SYSTEMWIDE_EXEC \"${EPREFIX}/usr/libexec/john\"" >> config.gentoo + append-flags -fPIC -fPIE + gcc-specs-pie && append-ldflags -nopie + use openmp && OMP="-fopenmp" + + CPP="$(tc-getCXX)" CC="$(tc-getCC)" AS="$(tc-getCC)" LD="$(tc-getCC)" + if use mpi; then + CPP=mpicxx CC=mpicc AS=mpicc LD=mpicc + fi + + #this stuff was all stolen from the Makefile, if build breaks, check this first + if use opencl; then + GPUCFLAGS="${GPUCFLAGS} -DCL_VERSION_1_0" + GPULDFLAGS="${GPULDFLAGS} -lOpenCL" + fi + if use cuda; then + GPUCFLAGS="${GPUCFLAGS} -DHAVE_CUDA" + GPULDFLAGS="${GPULDFLAGS} -L/opt/cuda/$(get_libdir) -lcudart" + fi + + emake -C src/ \ + CPP="${CPP}" CC="${CC}" AS="${AS}" LD="${LD}" \ + CFLAGS="-c -Wall -include ../config.gentoo ${CFLAGS} ${OMP} ${GPUCFLAGS}" \ + LDFLAGS="${LDFLAGS} ${GPULDFLAGS}" \ + OPT_NORMAL="" \ + OMPFLAGS="${OMP}" \ + JOHN_OBJS="$(get_john_objs)" \ + $(get_target) +} + +src_test() { + if use opencl; then + cp src/opencl/*.cl run/ + cp src/opencl_*.h run/ + fi + pax-mark -mr run/john + if use opencl || use cuda; then + ewarn "GPU tests fail, skipping all tests..." + else + make -C src/ check + fi +} + +src_install() { + # executables + dosbin run/john + newsbin run/mailer john-mailer + + pax-mark -mr "${ED}usr/sbin/john" || die + + dosym john /usr/sbin/unafs + dosym john /usr/sbin/unique + dosym john /usr/sbin/unshadow + + # jumbo-patch additions + if ! use minimal; then + for s in \ + keychain2john keepass2john pwsafe2john hccap2john \ + racf2john zip2john rar2john pdf2john ssh2john undrop \ + ; do + dosym john /usr/sbin/$s + done + dosbin run/calc_stat + dosbin run/genmkvpwd + dosbin run/mkvcalcproba + dosbin run/raw2dyna + dosbin run/tgtsnarf + insinto /etc/john + doins run/genincstats.rb run/stats + doins run/netscreen.py run/sap2john.pl + if use opencl; then + doins src/opencl/*.cl + doins src/opencl_*.h + fi + fi + + # config files + insinto /etc/john + doins run/*.chr run/password.lst + doins run/*.conf + + # documentation + dodoc doc/* +} diff --git a/app-crypt/johntheripper/metadata.xml b/app-crypt/johntheripper/metadata.xml new file mode 100644 index 000000000000..ea96d4b19271 --- /dev/null +++ b/app-crypt/johntheripper/metadata.xml @@ -0,0 +1,18 @@ + + + + + zerochaos@gentoo.org + Rick Farina + Any and all help appreciated + + + crypto@gentoo.org + Crypto + + + Use nvidia cuda toolkit for speeding up cracking on capable devices + Support mozilla password cracking + Enable opencl support for speeding up cracking on capable devices + + -- cgit v1.2.3