truecrack: fix build on gcc-14

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