summary refs log tree commit diff
path: root/pkgs/tools/security/cipherscan/default.nix
blob: eac237f2ff47f5d59b993c07e9a18ac43cf7cb26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv, lib, fetchFromGitHub, pkgconfig, openssl, makeWrapper, python, coreutils }:

stdenv.mkDerivation rec {
  name = "cipherscan-${version}";
  version = "2015-12-17";
  src = fetchFromGitHub {
    owner = "jvehent";
    repo = "cipherscan";
    rev = "18b0d1b952d027d20e38f07329817873ec077d26";
    sha256 = "0b6fkfm2y8w04am4krspmapcc5ngn603n5rlwyjly92z2dawc7h8";
  };
  buildInputs = [ makeWrapper python ];
  patches = [ ./path.patch ];
  buildPhase = ''
    substituteInPlace cipherscan \
      --replace "@OPENSSLBIN@" \
                "${openssl.bin}/bin/openssl" \
      --replace "@TIMEOUTBIN@" \
                "${coreutils}/bin/timeout" \
      --replace "@READLINKBIN@" \
                "${coreutils}/bin/readlink"

    substituteInPlace analyze.py \
      --replace "@OPENSSLBIN@" \
                "${openssl.bin}/bin/openssl"
  '';
  installPhase = ''
    mkdir -p $out/bin

    cp cipherscan $out/bin
    cp openssl.cnf $out/bin
    cp analyze.py $out/bin

    wrapProgram $out/bin/analyze.py --set PYTHONPATH "$PYTHONPATH"
  '';
  meta = with lib; {
    description = "Very simple way to find out which SSL ciphersuites are supported by a target";
    homepage = "https://github.com/jvehent/cipherscan";
    license = licenses.mpl20;
    platforms = platforms.all;
    maintainers = with maintainers; [ cstrahan ];
  };
}