about summary refs log tree commit diff
path: root/pkgs/tools/security/john
diff options
context:
space:
mode:
authorDaniel Fullmer <danielrf12@gmail.com>2017-12-31 18:15:56 -0500
committerDaniel Fullmer <danielrf12@gmail.com>2017-12-31 18:52:34 -0500
commit96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0 (patch)
tree70e579fa896dfc8d9ccc2265b1c76d76257b0118 /pkgs/tools/security/john
parent1bc288591ea4fe3159b7630dcd2b57733d80a2ff (diff)
downloadnixlib-96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0.tar
nixlib-96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0.tar.gz
nixlib-96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0.tar.bz2
nixlib-96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0.tar.lz
nixlib-96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0.tar.xz
nixlib-96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0.tar.zst
nixlib-96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0.zip
john: Fix extra utility programs
Diffstat (limited to 'pkgs/tools/security/john')
-rw-r--r--pkgs/tools/security/john/default.nix27
1 files changed, 18 insertions, 9 deletions
diff --git a/pkgs/tools/security/john/default.nix b/pkgs/tools/security/john/default.nix
index 37946b940cf1..7552b21ed333 100644
--- a/pkgs/tools/security/john/default.nix
+++ b/pkgs/tools/security/john/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, openssl, nss, nspr, kerberos, gmp, zlib, libpcap, re2
-, writeText, gcc
+, writeText, gcc, pythonPackages, perl, perlPackages, makeWrapper
 }:
 
 with stdenv.lib;
@@ -35,7 +35,11 @@ stdenv.mkDerivation rec {
   '';
   configureFlags = [ "--disable-native-macro" ];
 
-  buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 gcc ];
+  buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 gcc pythonPackages.wrapPython perl makeWrapper ];
+  propagatedBuildInputs = (with pythonPackages; [ dpkt scapy lxml ]) ++ # For pcap2john.py
+                          (with perlPackages; [ DigestMD4 DigestMD5 DigestSHA1 GetoptLong MIMEBase64 # For pass_gen.pl
+                                                NetLDAP ]); # For sha-dump.pl
+                          # TODO: Get dependencies for radius2john.pl and lion2john-alt.pl
 
   # gcc -DAC_BUILT -Wall vncpcap2john.o memdbg.o -g    -lpcap -fopenmp -o ../run/vncpcap2john
   # gcc: error: memdbg.o: No such file or directory
@@ -43,18 +47,23 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = [ "-DJOHN_SYSTEMWIDE=1" ];
 
-  installPhase = ''
-    mkdir -p "$out/etc/john" "$out/share/john" "$out/share/doc/john"
-    find ../run -mindepth 1 -maxdepth 1 -type f -executable \
-      -exec "${stdenv.shell}" "${writeText "john-binary-install.sh" ''
-        filename="$(basename "$1")"
-        install -vD "$1" "$out/bin/''${filename%.*}"
-      ''}" {} \;
+  postInstall = ''
+    mkdir -p "$out/bin" "$out/etc/john" "$out/share/john" "$out/share/doc/john"
+    find -L ../run -mindepth 1 -maxdepth 1 -type f -executable \
+      -exec cp -d {} "$out/bin" \;
     cp -vt "$out/etc/john" ../run/*.conf
     cp -vt "$out/share/john" ../run/*.chr ../run/password.lst
     cp -vrt "$out/share/doc/john" ../doc/*
   '';
 
+  postFixup = ''
+    wrapPythonPrograms
+
+    for i in $out/bin/*.pl; do
+      wrapProgram "$i" --prefix PERL5LIB : $PERL5LIB
+    done
+  '';
+
   meta = {
     description = "John the Ripper password cracker";
     license = licenses.gpl2;