about summary refs log tree commit diff
path: root/pkgs/tools/misc/hashpump/default.nix
blob: 11b0650d849d780325ef97abcd49c3f1c20edd2e (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
{ stdenv, fetchFromGitHub, openssl, lib }:

stdenv.mkDerivation (finalAttrs: {
  pname = "hashpump";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "bwall";
    repo = "HashPump";
    rev = "v${finalAttrs.version}";
    hash = "sha256-xL/1os17agwFtdq0snS3ZJzwJhk22ujxfWLH65IMMEM=";
  };

  makeFlags = [ "INSTALLLOCATION=${placeholder "out"}/bin/" ];

  buildInputs = [ openssl ];

  doCheck = true;
  checkPhase = ''
    runHook preCheck
    ./hashpump --test
    runHook postCheck
  '';

  preInstall = ''
    mkdir -p $out/bin
  '';

  meta = {
    description = "A tool to exploit the hash length extension attack in various hashing algorithms";
    homepage = "https://github.com/bwall/HashPump";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ t4ccer ];
    platforms = lib.platforms.linux;
    mainProgram = "hashpump";
  };
})