tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
truecrack: fix build on gcc-14
Petr Zahradnik
11 months ago
9aefcbba
f8447cdd
+60
-14
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
tr
truecrack
fix-empty-return.patch
package.nix
+11
pkgs/by-name/tr/truecrack/fix-empty-return.patch
···
1
1
+
--- a/src/Common/CpuCore.c
2
2
+
+++ b/src/Common/CpuCore.c
3
3
+
@@ -96,7 +96,7 @@
4
4
+
derive_key_whirlpool ( word, wordlength+1, salt, PKCS5_SALT_SIZE, 1000, headerKey, cpu_GetMaxPkcs5OutSize ());
5
5
+
else{
6
6
+
perror("Key derivation function not supported");
7
7
+
- return;
8
8
+
+ return 0;
9
9
+
}
10
10
+
11
11
+
value=cpu_Xts(encryptionAlgorithm,encryptedHeader,headerKey,cpu_GetMaxPkcs5OutSize(), masterKey, &length);
+49
-14
pkgs/by-name/tr/truecrack/package.nix
···
6
6
config,
7
7
cudaSupport ? config.cudaSupport,
8
8
pkg-config,
9
9
+
versionCheckHook,
9
10
}:
10
11
11
12
gccStdenv.mkDerivation rec {
···
15
16
src = fetchFromGitLab {
16
17
owner = "kalilinux";
17
18
repo = "packages/truecrack";
18
18
-
rev = "debian/${version}+git20150326-0kali1";
19
19
-
sha256 = "+Rw9SfaQtO1AJO6UVVDMCo8DT0dYEbv7zX8SI+pHCRQ=";
19
19
+
tag = "kali/${version}+git20150326-0kali4";
20
20
+
hash = "sha256-d6ld6KHSqYM4RymHf5qcm2AWK6FHWC0rFaLRfIQ2m5Q=";
20
21
};
22
22
+
23
23
+
patches = [
24
24
+
./fix-empty-return.patch
25
25
+
];
21
26
22
27
configureFlags = (
23
28
if cudaSupport then
···
38
43
cudatoolkit
39
44
];
40
45
41
41
-
# Workaround build failure on -fno-common toolchains like upstream
42
42
-
# gcc-10. Otherwise build fails as:
43
43
-
# ld: CpuAes.o:/build/source/src/Crypto/CpuAes.h:1233: multiple definition of
44
44
-
# `t_rc'; CpuCore.o:/build/source/src/Crypto/CpuAes.h:1237: first defined here
45
45
-
# TODO: remove on upstream fixes it:
46
46
-
# https://gitlab.com/kalilinux/packages/truecrack/-/issues/1
47
47
-
env.NIX_CFLAGS_COMPILE = "-fcommon";
46
46
+
env.NIX_CFLAGS_COMPILE = toString ([
47
47
+
# Workaround build failure on -fno-common toolchains like upstream
48
48
+
# gcc-10. Otherwise build fails as:
49
49
+
# ld: CpuAes.o:/build/source/src/Crypto/CpuAes.h:1233: multiple definition of
50
50
+
# `t_rc'; CpuCore.o:/build/source/src/Crypto/CpuAes.h:1237: first defined here
51
51
+
# TODO: remove on upstream fixes it:
52
52
+
# https://gitlab.com/kalilinux/packages/truecrack/-/issues/1
53
53
+
"-fcommon"
54
54
+
# Function are declared after they are used in the file, this is error since gcc-14.
55
55
+
# Common/Crypto.c:42:13: error: implicit declaration of function 'cpu_CipherInit'; did you mean 'CipherInit'? []
56
56
+
# https://gitlab.com/kalilinux/packages/truecrack/-/commit/5b0e3a96b747013bded7b33f65bb42be2dbafc86
57
57
+
"-Wno-error=implicit-function-declaration"
58
58
+
]);
59
59
+
60
60
+
enableParallelBuilding = true;
48
61
49
62
installFlags = [ "prefix=$(out)" ];
50
50
-
enableParallelBuilding = true;
63
63
+
64
64
+
doInstallCheck = true;
65
65
+
66
66
+
installCheckPhase = ''
67
67
+
runHook preInstallCheck
68
68
+
69
69
+
echo "Cracking test volumes"
70
70
+
$out/bin/${meta.mainProgram} -t test/ripemd160_aes.test.tc -w test/passwords.txt | grep -aF "Found password"
71
71
+
$out/bin/${meta.mainProgram} -t test/ripemd160_aes.test.tc -c test/tes -m 4 | grep -aF "Found password"
72
72
+
$out/bin/${meta.mainProgram} -t test/ripemd160_aes.test.tc -w test/passwords.txt | grep -aF "Found password"
73
73
+
$out/bin/${meta.mainProgram} -t test/whirlpool_aes.test.tc -w test/passwords.txt -k whirlpool | grep -aF "Found password"
74
74
+
$out/bin/${meta.mainProgram} -t test/sha512_aes.test.tc -w test/passwords.txt -k sha512 | grep -aF "Found password"
75
75
+
$out/bin/${meta.mainProgram} -t test/ripemd160_aes.test.tc -w test/passwords.txt | grep -aF "Found password"
76
76
+
$out/bin/${meta.mainProgram} -t test/ripemd160_serpent.test.tc -w test/passwords.txt -e serpent | grep -aF "Found password"
77
77
+
$out/bin/${meta.mainProgram} -t test/ripemd160_twofish.test.tc -w test/passwords.txt -e twofish | grep -aF "Found password"
78
78
+
echo "Finished cracking test volumes"
79
79
+
80
80
+
runHook postInstallCheck
81
81
+
'';
51
82
52
52
-
meta = with lib; {
83
83
+
nativeInstallCheckInputs = [
84
84
+
versionCheckHook
85
85
+
];
86
86
+
87
87
+
meta = {
53
88
description = "Brute-force password cracker for TrueCrypt volumes, optimized for Nvidia Cuda technology";
54
89
mainProgram = "truecrack";
55
90
homepage = "https://gitlab.com/kalilinux/packages/truecrack";
56
91
broken = cudaSupport;
57
57
-
license = licenses.gpl3Plus;
58
58
-
platforms = platforms.unix;
59
59
-
maintainers = with maintainers; [ ethancedwards8 ];
92
92
+
license = lib.licenses.gpl3Plus;
93
93
+
platforms = lib.platforms.unix;
94
94
+
maintainers = with lib.maintainers; [ ethancedwards8 ];
60
95
};
61
96
}