1{
2 lib,
3 stdenv,
4 fetchurl,
5 libmcrypt,
6 libmhash,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 version = "2.6.8";
11 pname = "mcrypt";
12
13 src = fetchurl {
14 url = "mirror://sourceforge/mcrypt/MCrypt/${finalAttrs.version}/mcrypt-${finalAttrs.version}.tar.gz";
15 hash = "sha256-UUWqhE5UzKid2rb7fdnllSgR2NeHxPS/J+smHmwYIJg=";
16 };
17
18 patches = [
19 ./format-string_CVE-2012-4426.patch
20 ./overflow_CVE-2012-4409.patch
21 ./segv.patch
22 ./sprintf_CVE-2012-4527.patch
23 ./malloc_to_stdlib.patch
24 ];
25
26 buildInputs = [
27 libmcrypt
28 libmhash
29 ];
30
31 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
32
33 meta = {
34 description = "Replacement for old UNIX crypt(1)";
35 longDescription = ''
36 mcrypt, and the accompanying libmcrypt, are intended to be replacements
37 for the old Unix crypt, except that they are under the GPL and support an
38 ever-wider range of algorithms and modes.
39 '';
40 homepage = "https://mcrypt.sourceforge.net";
41 license = lib.licenses.gpl3Plus;
42 platforms = lib.platforms.all;
43 maintainers = [ lib.maintainers.qknight ];
44 };
45})