aboutsummaryrefslogtreecommitdiffstats
path: root/community/john
diff options
context:
space:
mode:
authorJ0WI <J0WI@users.noreply.github.com>2019-08-09 18:34:21 +0200
committerLeo <thinkabit.ukim@gmail.com>2019-08-09 19:39:54 -0300
commit7d9088e726f56c89ec685f92e90d99ada1ae5684 (patch)
treece28763e1186a073a3b27289ecc7f94cb56c4571 /community/john
parente0f31363292f21e9cb69415564549b3b7d467b5a (diff)
community/john: modernize
Diffstat (limited to 'community/john')
-rw-r--r--community/john/APKBUILD25
-rw-r--r--community/john/gcc5-support.patch71
-rw-r--r--community/john/libressl.patch293
-rw-r--r--community/john/params-h.patch13
-rw-r--r--community/john/truecrypt_fmt_plug.patch14
5 files changed, 12 insertions, 404 deletions
diff --git a/community/john/APKBUILD b/community/john/APKBUILD
index 5fa32568c17..8264be23904 100644
--- a/community/john/APKBUILD
+++ b/community/john/APKBUILD
@@ -4,28 +4,28 @@
pkgname=john
pkgver=1.9.0
_pkgrel=jumbo-1
-pkgrel=0
+pkgrel=1
pkgdesc="John the Ripper password cracker"
-url="http://www.openwall.com/john"
-arch="aarch64 x86_64 armhf armv7"
-license="GPL-2.0"
+url="https://www.openwall.com/john"
+arch="all !s390x !x86"
+license="GPL-2.0-or-later"
depends="nss"
options="!strip"
makedepends="libpcap-dev openssl-dev gmp-dev yasm-dev zlib-dev"
-subpackages="$pkgname-doc
- "
+subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/magnumripper/JohnTheRipper/archive/$pkgver.tar.gz"
builddir="$srcdir"/JohnTheRipper-$pkgver
+
build() {
cd "$builddir"/src
local _arch=
case "$CARCH" in
- aarch64) _arch=arm64le;;
- arm*) _arch=arm32le;;
- ppc64le) _arch=ppc64;;
- x86) _arch=x86-any;;
- x86_64) _arch=x86-64;
+ aarch64) _arch=arm64le;;
+ arm*) _arch=arm32le;;
+ ppc64le) _arch=ppc64;;
+ x86) _arch=x86-any;;
+ x86_64) _arch=x86-64;
esac
make linux-$_arch
@@ -37,7 +37,6 @@ check() {
}
package() {
- cd "$builddir"
mkdir -p "$pkgdir"/usr/bin
mkdir -p "$pkgdir"/usr/share/doc/$pkgname
@@ -51,7 +50,7 @@ package() {
done
for link in unafs unique unshadow; do
- ln -s john "$pkgdir"/usr/bin/${link}
+ ln -s john "$pkgdir"/usr/bin/$link
done
install -Dm644 run/password.lst "$pkgdir"/usr/share/john/password.lst
}
diff --git a/community/john/gcc5-support.patch b/community/john/gcc5-support.patch
deleted file mode 100644
index 3105add4d36..00000000000
--- a/community/john/gcc5-support.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-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/libressl.patch b/community/john/libressl.patch
deleted file mode 100644
index f60414d782e..00000000000
--- a/community/john/libressl.patch
+++ /dev/null
@@ -1,293 +0,0 @@
-diff --git a/src/KRB4_fmt_plug.c b/src/KRB4_fmt_plug.c
-index f2134bc..a64e059 100644
---- a/src/KRB4_fmt_plug.c
-+++ b/src/KRB4_fmt_plug.c
-@@ -50,7 +50,7 @@ john_register_one(&fmt_KRB4);
- #include "formats.h"
- #include "memdbg.h"
-
--#define TGT_LENGTH 16 /* 2 des_cblock's */
-+#define TGT_LENGTH 16 /* 2 DES_cblock's */
-
- #define FORMAT_LABEL "krb4"
- #define FORMAT_NAME "Kerberos v4 TGT"
-@@ -202,7 +202,7 @@ static int crypt_all(int *pcount, struct db_salt *salt)
- saved_salt->realm,
- &saved_key.key);
- else
-- des_string_to_key(saved_key.string,
-+ DES_string_to_key(saved_key.string,
- &saved_key.key);
-
- return *pcount;
-diff --git a/src/KRB4_std_plug.c b/src/KRB4_std_plug.c
-index 6e248ac..e85b0fc 100644
---- a/src/KRB4_std_plug.c
-+++ b/src/KRB4_std_plug.c
-@@ -35,8 +35,8 @@
- #include "KRB4_std.h"
- #include "memdbg.h"
-
--#ifndef des_fixup_key_parity
--#define des_fixup_key_parity des_set_odd_parity
-+#ifndef DES_fixup_key_parity
-+#define DES_fixup_key_parity DES_set_odd_parity
- #endif
-
- static void
-@@ -88,7 +88,7 @@ afs_cmu_StringToKey (char *str, char *cell, DES_cblock *key)
- keybytes[i] = (unsigned char) (temp << 1);
- }
- }
-- des_fixup_key_parity (key);
-+ DES_fixup_key_parity (key);
- }
-
- /*
-@@ -111,16 +111,16 @@ afs_transarc_StringToKey (char *str, char *cell, DES_cblock *key)
-
- memcpy(&ivec, "kerberos", 8);
- memcpy(&temp_key, "kerberos", 8);
-- des_fixup_key_parity (&temp_key);
-+ DES_fixup_key_parity (&temp_key);
- DES_key_sched (&temp_key, &schedule);
- DES_cbc_cksum ((unsigned char *)password, &ivec, passlen, &schedule, &ivec);
-
- memcpy(&temp_key, &ivec, 8);
-- des_fixup_key_parity (&temp_key);
-+ DES_fixup_key_parity (&temp_key);
- DES_key_sched (&temp_key, &schedule);
- DES_cbc_cksum ((unsigned char *)password, key, passlen, &schedule, &ivec);
-
-- des_fixup_key_parity (key);
-+ DES_fixup_key_parity (key);
- }
-
- void
-diff --git a/src/common.h b/src/common.h
-index fce8c63..7fbebc3 100644
---- a/src/common.h
-+++ b/src/common.h
-@@ -75,4 +75,6 @@ extern const char itoa16u[16]; // uppercase
- */
- extern void common_init(void);
-
-+#define C_Block DES_cblock
-+
- #endif
-diff --git a/src/rawSHA0_fmt_plug.c b/src/rawSHA0_fmt_plug.c
-deleted file mode 100644
-index 9375fff..0000000
---- a/src/rawSHA0_fmt_plug.c
-+++ /dev/null
-@@ -1,210 +0,0 @@
--/*
-- * This software is Copyright (c) 2011 magnum, and it is hereby released to the
-- * general public under the following terms: Redistribution and use in source
-- * and binary forms, with or without modification, are permitted.
-- *
-- * Based on Raw-SHA1, but this is OpenSSL only.
-- */
--
--#if FMT_EXTERNS_H
--extern struct fmt_main fmt_rawSHA_0;
--#elif FMT_REGISTERS_H
--john_register_one(&fmt_rawSHA_0);
--#else
--
--#include <string.h>
--#include <openssl/sha.h>
--
--#include "arch.h"
--#include "misc.h"
--#include "common.h"
--#include "formats.h"
--#include "memdbg.h"
--
--#define FORMAT_LABEL "Raw-SHA"
--#define FORMAT_NAME "\"SHA-0\""
--#define ALGORITHM_NAME "SHA 32/" ARCH_BITS_STR
--
--#define BENCHMARK_COMMENT ""
--#define BENCHMARK_LENGTH -1
--
--#define FORMAT_TAG "$SHA$"
--#define TAG_LENGTH 5
--
--#define PLAINTEXT_LENGTH 125
--#define HASH_LENGTH 40
--#define CIPHERTEXT_LENGTH (HASH_LENGTH + TAG_LENGTH)
--
--#define BINARY_SIZE 20
--#define BINARY_ALIGN 4
--#define SALT_SIZE 0
--#define SALT_ALIGN 1
--
--#define MIN_KEYS_PER_CRYPT 1
--#define MAX_KEYS_PER_CRYPT 1
--
--static struct fmt_tests tests[] = {
-- {"17e7ba749415d4d332447a43830ef39ac8100ab8", "magnum"},
-- {FORMAT_TAG "17e7ba749415d4d332447a43830ef39ac8100ab8", "magnum"},
-- {FORMAT_TAG "f96cea198ad1dd5617ac084a3d92c6107708c0ef", ""},
-- {NULL}
--};
--
--static char saved_key[PLAINTEXT_LENGTH + 1];
--static ARCH_WORD_32 crypt_key[BINARY_SIZE / 4];
--static SHA_CTX ctx;
--
--static int valid(char *ciphertext, struct fmt_main *self)
--{
-- int i;
--
-- if (!strncmp(ciphertext, FORMAT_TAG, TAG_LENGTH))
-- ciphertext += TAG_LENGTH;
--
-- if (strlen(ciphertext) != HASH_LENGTH)
-- return 0;
--
-- for (i = 0; i < HASH_LENGTH; i++){
-- if (!( (('0' <= ciphertext[i])&&(ciphertext[i] <= '9')) ||
-- (('a' <= ciphertext[i])&&(ciphertext[i] <= 'f'))
-- || (('A' <= ciphertext[i])&&(ciphertext[i] <= 'F'))))
-- return 0;
-- }
-- return 1;
--}
--
--static char *split(char *ciphertext, int index, struct fmt_main *self)
--{
-- static char out[CIPHERTEXT_LENGTH + 1];
--
-- if (!strncmp(ciphertext, FORMAT_TAG, TAG_LENGTH))
-- ciphertext += TAG_LENGTH;
--
-- strncpy(out, FORMAT_TAG, sizeof(out));
--
-- memcpy(&out[TAG_LENGTH], ciphertext, HASH_LENGTH);
-- out[CIPHERTEXT_LENGTH] = 0;
--
-- strlwr(&out[TAG_LENGTH]);
--
-- return out;
--}
--
--static void set_key(char *key, int index) {
-- strnzcpy(saved_key, key, PLAINTEXT_LENGTH+1);
--}
--
--static char *get_key(int index) {
-- return saved_key;
--}
--
--static int cmp_all(void *binary, int count) {
-- return !memcmp(binary, crypt_key, BINARY_SIZE);
--}
--
--static int cmp_exact(char *source, int count){
-- return (1);
--}
--
--static int cmp_one(void * binary, int index)
--{
-- return cmp_all(binary, index);
--}
--
--static int crypt_all(int *pcount, struct db_salt *salt)
--{
-- int count = *pcount;
--
-- SHA_Init( &ctx );
-- SHA_Update( &ctx, (unsigned char *) saved_key, strlen( saved_key ) );
-- SHA_Final( (unsigned char *) crypt_key, &ctx);
--
-- return count;
--}
--
--static void *binary(char *ciphertext)
--{
-- static ARCH_WORD_32 outb[BINARY_SIZE / 4];
-- unsigned char *realcipher = (unsigned char*)outb;
-- int i;
--
-- ciphertext += TAG_LENGTH;
--
-- for(i=0;i<BINARY_SIZE;i++)
-- {
-- realcipher[i] = atoi16[ARCH_INDEX(ciphertext[i*2])]*16 + atoi16[ARCH_INDEX(ciphertext[i*2+1])];
-- }
-- return (void *)realcipher;
--}
--
--static int get_hash_0(int index) { return ((unsigned int *)crypt_key)[0] & 0xf; }
--static int get_hash_1(int index) { return ((unsigned int *)crypt_key)[0] & 0xff; }
--static int get_hash_2(int index) { return ((unsigned int *)crypt_key)[0] & 0xfff; }
--static int get_hash_3(int index) { return ((unsigned int *)crypt_key)[0] & 0xffff; }
--static int get_hash_4(int index) { return ((unsigned int *)crypt_key)[0] & 0xfffff; }
--static int get_hash_5(int index) { return ((unsigned int *)crypt_key)[0] & 0xffffff; }
--static int get_hash_6(int index) { return ((unsigned int *)crypt_key)[0] & 0x7ffffff; }
--
--struct fmt_main fmt_rawSHA_0 = {
-- {
-- FORMAT_LABEL,
-- FORMAT_NAME,
-- ALGORITHM_NAME,
-- BENCHMARK_COMMENT,
-- BENCHMARK_LENGTH,
-- PLAINTEXT_LENGTH,
-- BINARY_SIZE,
-- BINARY_ALIGN,
-- SALT_SIZE,
-- SALT_ALIGN,
-- MIN_KEYS_PER_CRYPT,
-- MAX_KEYS_PER_CRYPT,
-- FMT_CASE | FMT_8_BIT | FMT_SPLIT_UNIFIES_CASE,
--#if FMT_MAIN_VERSION > 11
-- { NULL },
--#endif
-- tests
-- }, {
-- fmt_default_init,
-- fmt_default_done,
-- fmt_default_reset,
-- fmt_default_prepare,
-- valid,
-- split,
-- binary,
-- fmt_default_salt,
--#if FMT_MAIN_VERSION > 11
-- { NULL },
--#endif
-- fmt_default_source,
-- {
-- fmt_default_binary_hash_0,
-- fmt_default_binary_hash_1,
-- fmt_default_binary_hash_2,
-- fmt_default_binary_hash_3,
-- fmt_default_binary_hash_4,
-- fmt_default_binary_hash_5,
-- fmt_default_binary_hash_6
-- },
-- fmt_default_salt_hash,
-- fmt_default_set_salt,
-- set_key,
-- get_key,
-- fmt_default_clear_keys,
-- crypt_all,
-- {
-- get_hash_0,
-- get_hash_1,
-- get_hash_2,
-- get_hash_3,
-- get_hash_4,
-- get_hash_5,
-- get_hash_6
-- },
-- cmp_all,
-- cmp_one,
-- cmp_exact
-- }
--};
--
--#endif /* plugin stanza */
diff --git a/community/john/params-h.patch b/community/john/params-h.patch
deleted file mode 100644
index 0cd87a7ff54..00000000000
--- a/community/john/params-h.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- 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
deleted file mode 100644
index 20da51ba7e2..00000000000
--- a/community/john/truecrypt_fmt_plug.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- 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);
-