From 0b2b1d5fdd21c776baa90db06c339f01a78a4f1c Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 7 Oct 2016 15:54:31 +0000 Subject: community/john: rebuild against libressl --- community/john/APKBUILD | 18 ++- community/john/libressl.patch | 293 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 305 insertions(+), 6 deletions(-) create mode 100644 community/john/libressl.patch diff --git a/community/john/APKBUILD b/community/john/APKBUILD index f4df547fae..3423dd4d28 100644 --- a/community/john/APKBUILD +++ b/community/john/APKBUILD @@ -3,14 +3,14 @@ pkgname=john pkgver=1.8.0 _pkgrel=jumbo-1 -pkgrel=3 +pkgrel=4 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" +makedepends="libpcap-dev libressl-dev gmp-dev yasm-dev" install="" subpackages="$pkgname-doc \ $pkgname-scripts-py:py \ @@ -22,11 +22,14 @@ subpackages="$pkgname-doc \ 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" + gcc5-support.patch + libressl.patch + " builddir="$srcdir/JohnTheRipper-$pkgver-$_pkgrel" build() { cd "$builddir"/src sed -i -e "s/ac_default_prefix.*/ac_default_prefix=\/usr/g" configure + export OPENSSL_LIBS="-lssl -lcrypto" ./configure \ --disable-openmp make || return 1 @@ -172,12 +175,15 @@ zshcomp() { md5sums="2e80ec877e78d0c6ce72febb8844e0e2 john-1.8.0.tar.gz e6e158d946783b14e1109bd96d54bb64 truecrypt_fmt_plug.patch d6ab104062b9ce84b172ad7ecdd08226 params-h.patch -b1f6ab678caabf4d3adb253735f46def gcc5-support.patch" +b1f6ab678caabf4d3adb253735f46def gcc5-support.patch +b20aa081f750286be0c9664f5853dbfc libressl.patch" sha256sums="95bbd3ecfbe51c6263317b3009bede98f20689a26c7aee191458ed9b26d5c9f6 john-1.8.0.tar.gz 91731241b644dc8cf64d55260801277b168dcd38c5585c10120c75393f0c35fa truecrypt_fmt_plug.patch 2b2396bf9e344bb28fcf91088d5dc12b0c91de3da74a4241d32c44496a291851 params-h.patch -7abd8b061055f7c81de8cadc021050ac113f0f71a0bcfb83680f10d8ca6e04df gcc5-support.patch" +7abd8b061055f7c81de8cadc021050ac113f0f71a0bcfb83680f10d8ca6e04df gcc5-support.patch +d02ce505b7f01f3b415aa7d42b73da289bf73277c1d1e0e4933ea266c10ae777 libressl.patch" sha512sums="8b7fad7a6330b5ff1afc306218ba698aaa27776b566f82c2e76102d5ceb10aeafa69d71fa6fff67c81996ea2c6a04384bab4696ed192306c6d074873562e7089 john-1.8.0.tar.gz 80be6cc1b1b35c6a85392008638b2f8b6d8a518ee35f59405e2f5682e025e4b8beecf964148311e6f62d76b59153f04427024fa81aaf56ee2062ac2dbf0a9bcb truecrypt_fmt_plug.patch a5c22feb8bf11509c306a2f236f2bd4891fdfc3b01882f07d85015e0895d82f28df0dff78ba8d3a3862d8d95877a88a9eb8138e6c407b40881fa1455079b98fc params-h.patch -4ebe8b41b1d0c3839348dcf5348332f9d7ce25919077fa054db64b7106150f299c6b177d117f7c18c1db672a494a6de6be8b5afe502f5ca3639602ba3aef6866 gcc5-support.patch" +4ebe8b41b1d0c3839348dcf5348332f9d7ce25919077fa054db64b7106150f299c6b177d117f7c18c1db672a494a6de6be8b5afe502f5ca3639602ba3aef6866 gcc5-support.patch +fb46431fe3e42e36c72361c13460e8ac626d2f146fa84c8f6e17e5407e69530a84ceb1de6bc9910c1a03a6e907fc113f7000a2cbc3936ae0860103d3e2d489b0 libressl.patch" diff --git a/community/john/libressl.patch b/community/john/libressl.patch new file mode 100644 index 0000000000..f60414d782 --- /dev/null +++ b/community/john/libressl.patch @@ -0,0 +1,293 @@ +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 +-#include +- +-#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 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 */ -- cgit v1.2.3