2021-05-16 15:28:26 +02:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, libtool, libtommath }:
|
2014-10-15 03:05:51 +02:00
|
|
|
|
2017-11-08 23:04:09 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "libtomcrypt";
|
2018-07-09 00:05:45 +02:00
|
|
|
version = "1.18.2";
|
2014-10-15 03:05:51 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-11-08 23:04:09 +01:00
|
|
|
url = "https://github.com/libtom/libtomcrypt/releases/download/v${version}/crypt-${version}.tar.xz";
|
2018-07-09 00:05:45 +02:00
|
|
|
sha256 = "113vfrgapyv72lalhd3nkw7jnks8az0gcb5wqn9hj19nhcxlrbcn";
|
2014-10-15 03:05:51 +02:00
|
|
|
};
|
|
|
|
|
2020-06-26 00:01:00 +02:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2019-17362.patch";
|
|
|
|
url = "https://github.com/libtom/libtomcrypt/pull/508/commits/25c26a3b7a9ad8192ccc923e15cf62bf0108ef94.patch";
|
|
|
|
sha256 = "1bwsj0pwffxw648wd713z3xcyrbxc2z646psrzp38ys564fjh5zf";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-05-16 15:28:26 +02:00
|
|
|
nativeBuildInputs = [ libtool libtommath ];
|
2017-11-08 23:04:09 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace makefile.shared --replace "LT:=glibtool" "LT:=libtool"
|
|
|
|
'';
|
2014-10-15 03:05:51 +02:00
|
|
|
|
|
|
|
preBuild = ''
|
2021-05-16 15:28:26 +02:00
|
|
|
makeFlagsArray+=(PREFIX=$out \
|
|
|
|
CFLAGS="-DUSE_LTM -DLTM_DESC -DLTC_PTHREAD" \
|
|
|
|
EXTRALIBS=\"-ltommath\" \
|
2014-10-15 03:05:51 +02:00
|
|
|
INSTALL_GROUP=$(id -g) \
|
|
|
|
INSTALL_USER=$(id -u))
|
|
|
|
'';
|
|
|
|
|
|
|
|
makefile = "makefile.shared";
|
|
|
|
|
2017-11-08 23:04:09 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.libtom.net/LibTomCrypt/";
|
2015-04-30 17:05:14 +02:00
|
|
|
description = "A fairly comprehensive, modular and portable cryptographic toolkit";
|
2017-11-08 23:04:09 +01:00
|
|
|
license = with licenses; [ publicDomain wtfpl ];
|
|
|
|
platforms = platforms.linux;
|
2014-10-15 03:05:51 +02:00
|
|
|
};
|
|
|
|
}
|