git.iko.soy/typeable/nixpkgs
on master help sign in
cipherscan: 2015-12-17 -> 2016-08-16
commit875c286ba39a93b36274bb8ccecdd33a5af83b00 authorFranz Pletz <fpletz@fnordicwalking.de> dateSun 4 Sep 2016, 07:26 (10 years ago) parentc45bf3c
2 files changed+19−114
pkgs/tools/security/cipherscan/default.nix+19−21 pkgs/tools/security/cipherscan/path.patch−93
pkgs/tools/security/cipherscan/default.nix+19−21
@@ -2,42 +2,40 @@
22
33stdenv.mkDerivation rec {
44 name = "cipherscan-${version}";
5− version = "2015-12-17";
5+ version = "2016-08-16";
6+
67 src = fetchFromGitHub {
7− owner = "jvehent";
8+ owner = "mozilla";
89 repo = "cipherscan";
9− rev = "18b0d1b952d027d20e38f07329817873ec077d26";
10− sha256 = "0b6fkfm2y8w04am4krspmapcc5ngn603n5rlwyjly92z2dawc7h8";
10+ rev = "74dd82e8ad994a140daf79489d3bd1c5ad928d38";
11+ sha256 = "16azhlmairnvdz7xmwgvfpn2pzw1p8z7c9b27m07fngqjkpx0mhh";
1112 };
12− buildInputs = [ makeWrapper python ];
13− patches = [ ./path.patch ];
13+
14+ nativeBuildInputs = [ makeWrapper ];
15+ buildInputs = [ python ];
16+
1417 buildPhase = ''
15− substituteInPlace cipherscan \
16− --replace "@OPENSSLBIN@" \
17− "${openssl.bin}/bin/openssl" \
18− --replace "@TIMEOUTBIN@" \
19− "${coreutils}/bin/timeout" \
20− --replace "@READLINKBIN@" \
21− "${coreutils}/bin/readlink"
22−
23− substituteInPlace analyze.py \
24− --replace "@OPENSSLBIN@" \
25− "${openssl.bin}/bin/openssl"
18+ substituteInPlace cipherscan --replace '$0' 'cipherscan'
2619 '';
20+
2721 installPhase = ''
2822 mkdir -p $out/bin
2923
3024 cp cipherscan $out/bin
3125 cp openssl.cnf $out/bin
32− cp analyze.py $out/bin
26+ cp analyze.py $out/bin/cipherscan-analyze
3327
34− wrapProgram $out/bin/analyze.py --set PYTHONPATH "$PYTHONPATH"
28+ wrapProgram $out/bin/cipherscan \
29+ --set NOAUTODETECT 1 \
30+ --set TIMEOUTBIN "${coreutils}/bin/timeout" \
31+ --set OPENSSLBIN "${openssl}/bin/openssl"
3532 '';
33+
3634 meta = with lib; {
35+ inherit (src.meta) homepage;
3736 description = "Very simple way to find out which SSL ciphersuites are supported by a target";
38− homepage = "https://github.com/jvehent/cipherscan";
3937 license = licenses.mpl20;
4038 platforms = platforms.all;
41− maintainers = with maintainers; [ cstrahan ];
39+ maintainers = with maintainers; [ cstrahan fpletz ];
4240 };
4341}
pkgs/tools/security/cipherscan/path.patchdeleted−93
@@ -1,93 +0,0 @@
1−diff --git a/analyze.py b/analyze.py
2−index bb62af8..e929253 100755
3−--- a/analyze.py
4−+++ b/analyze.py
5−@@ -418,13 +418,7 @@ def build_ciphers_lists(opensslbin):
6−
7− # use system openssl if not on linux 64
8− if not opensslbin:
9−- if platform.system() == 'Linux' and platform.architecture()[0] == '64bit':
10−- opensslbin = mypath + '/openssl'
11−- elif platform.system() == 'Darwin' and platform.architecture()[0] == '64bit':
12−- opensslbin = mypath + '/openssl-darwin64'
13−- else:
14−- opensslbin='openssl'
15−- print("warning: analyze.py is using system's openssl, which may limit the tested ciphers and recommendations")
16−+ opensslbin = "@OPENSSLBIN@"
17−
18− logging.debug('Loading all ciphers: ' + allC)
19− all_ciphers = subprocess.Popen([opensslbin, 'ciphers', allC],
20−diff --git a/cipherscan b/cipherscan
21−index 236b34f..a240d13 100755
22−--- a/cipherscan
23−+++ b/cipherscan
24−@@ -30,43 +30,12 @@ if [[ -n $NOAUTODETECT ]]; then
25− else
26− case "$(uname -s)" in
27− Darwin)
28−- opensslbin_name="openssl-darwin64"
29−-
30−- READLINKBIN=$(which greadlink 2>/dev/null)
31−- if [[ -z $READLINKBIN ]]; then
32−- echo "greadlink not found. (try: brew install coreutils)" 1>&2
33−- exit 1
34−- fi
35−- TIMEOUTBIN=$(which gtimeout 2>/dev/null)
36−- if [[ -z $TIMEOUTBIN ]]; then
37−- echo "gtimeout not found. (try: brew install coreutils)" 1>&2
38−- exit 1
39−- fi
40−+ READLINKBIN="@READLINKBIN@"
41−+ TIMEOUTBIN="@TIMEOUTBIN@"
42− ;;
43− *)
44−- opensslbin_name="openssl"
45−-
46−- # test that readlink or greadlink (darwin) are present
47−- READLINKBIN="$(which readlink)"
48−-
49−- if [[ -z $READLINKBIN ]]; then
50−- READLINKBIN="$(which greadlink)"
51−- if [[ -z $READLINKBIN ]]; then
52−- echo "neither readlink nor greadlink are present. install coreutils with {apt-get,yum,brew} install coreutils" 1>&2
53−- exit 1
54−- fi
55−- fi
56−-
57−- # test that timeout or gtimeout (darwin) are present
58−- TIMEOUTBIN="$(which timeout)"
59−-
60−- if [[ -z $TIMEOUTBIN ]]; then
61−- TIMEOUTBIN="$(which gtimeout)"
62−- if [[ -z $TIMEOUTBIN ]]; then
63−- echo "neither timeout nor gtimeout are present. install coreutils with {apt-get,yum,brew} install coreutils" 1>&2
64−- exit 1
65−- fi
66−- fi
67−+ READLINKBIN="@READLINKBIN@"
68−+ TIMEOUTBIN="@TIMEOUTBIN@"
69−
70− # Check for busybox, which has different arguments
71− TIMEOUTOUTPUT="$($TIMEOUTBIN --help 2>&1)"
72−@@ -1944,20 +1913,7 @@ do
73− done
74−
75− if [[ -z $OPENSSLBIN ]]; then
76−- readlink_result=$("$READLINKBIN" -f "$0")
77−- if [[ -z $readlink_result ]]; then
78−- echo "$READLINKBIN -f $0 failed, aborting." 1>&2
79−- exit 1
80−- fi
81−- REALPATH=$(dirname "$readlink_result")
82−- if [[ -z $REALPATH ]]; then
83−- echo "dirname $REALPATH failed, aborting." 1>&2
84−- exit 1
85−- fi
86−- OPENSSLBIN="${REALPATH}/${opensslbin_name}"
87−- if ! [[ -x "${OPENSSLBIN}" ]]; then
88−- OPENSSLBIN="$(which openssl)" # fallback to generic openssl
89−- fi
90−+ OPENSSLBIN="@OPENSSLBIN@"
91− fi
92− # use custom config file to enable GOST ciphers
93− if [[ -e $DIRNAMEPATH/openssl.cnf ]]; then