about summary refs log tree commit diff
path: root/pkgs/tools/security/hashcat
diff options
context:
space:
mode:
authorKier Davis <kierdavis@gmail.com>2018-11-17 20:10:52 +0000
committerKier Davis <kierdavis@gmail.com>2018-11-17 20:10:52 +0000
commitdf462d09e4f146bf85a3556af3bd7564802e979e (patch)
tree38fc785f7321ebdd0cfbda6ca550f042656e758c /pkgs/tools/security/hashcat
parent41391e9cd807373e1960344e9b4ee2588d172318 (diff)
hashcat: 4.2.1 -> 5.0.0
This introduces a dependency on xxHash. Unfortunately, hashcat's
build system wants to rebuild xxHash from the source code located
in `<hashcat source root>/deps/git/xxHash`, a Git submodule whose
contents are not included in the source tarball we currently
download.

This could be fixed by either using a recursive git clone instead
a tarball download, or patching the build files to use an existing
installation of xxHash (i.e. the one already provided by Nix). I
believe the latter is preferable since it avoids the situation in
which the xxHash version used by hashcat is different to the xxHash
version used by all other Nix packages.

Fortunately, this situation has been greatly improved [1] since
release 5.0.0; the next release of hashcat should drop usage of
git submodules and provide better support for using existing
installations of dependencies.

[1] https://github.com/hashcat/hashcat/commit/4177e1ee286f80c344f7bae6a65c40192f523e0a
Diffstat (limited to 'pkgs/tools/security/hashcat')
-rw-r--r--pkgs/tools/security/hashcat/default.nix9
-rw-r--r--pkgs/tools/security/hashcat/use-installed-xxhash.patch22
2 files changed, 27 insertions, 4 deletions
diff --git a/pkgs/tools/security/hashcat/default.nix b/pkgs/tools/security/hashcat/default.nix
index 9bac2d6c80352..68866a8cad4f7 100644
--- a/pkgs/tools/security/hashcat/default.nix
+++ b/pkgs/tools/security/hashcat/default.nix
@@ -1,16 +1,17 @@
-{ stdenv, fetchurl, makeWrapper, opencl-headers, ocl-icd }:
+{ stdenv, fetchurl, makeWrapper, opencl-headers, ocl-icd, xxHash }:
 
 stdenv.mkDerivation rec {
   name    = "hashcat-${version}";
-  version = "4.2.1";
+  version = "5.0.0";
 
   src = fetchurl {
     url = "https://hashcat.net/files/hashcat-${version}.tar.gz";
-    sha256 = "082k5srjwkfvnvz0bfcg5r12m9c2qjyfhnp135mparkf831p7bbx";
+    sha256 = "13xh1lmzdppvx8wr8blqhdr8vpa24j099kz2xzb9pcnqy26dk4kh";
   };
+  patches = [ ./use-installed-xxhash.patch ];
 
   nativeBuildInputs = [ makeWrapper ];
-  buildInputs = [ opencl-headers ];
+  buildInputs = [ opencl-headers xxHash ];
 
   makeFlags = [
     "OPENCL_HEADERS_KHRONOS=${opencl-headers}/include"
diff --git a/pkgs/tools/security/hashcat/use-installed-xxhash.patch b/pkgs/tools/security/hashcat/use-installed-xxhash.patch
new file mode 100644
index 0000000000000..d02303558ebb4
--- /dev/null
+++ b/pkgs/tools/security/hashcat/use-installed-xxhash.patch
@@ -0,0 +1,22 @@
+diff --git a/src/Makefile b/src/Makefile
+index 3a1cd680..576353fe 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -189,7 +189,7 @@ endif
+ # brain and xxHash
+ ifeq ($(ENABLE_BRAIN),1)
+ CFLAGS                  += -DWITH_BRAIN
+-CFLAGS                  += -Ideps/git/xxHash
++LFLAGS                  += -lxxhash
+ endif
+ 
+ ##
+@@ -313,7 +313,7 @@ WIN_32_OBJS             := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).WIN.32.o)
+ WIN_64_OBJS             := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).WIN.64.o)
+ 
+ ifeq ($(ENABLE_BRAIN),1)
+-OBJS_XXHASH             := xxhash
++OBJS_XXHASH             :=
+ 
+ NATIVE_STATIC_OBJS      += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).NATIVE.STATIC.o)
+ NATIVE_SHARED_OBJS      += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).NATIVE.SHARED.o)