aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorquapka2024-07-25 14:22:14 +0200
committerquapka2024-07-25 14:22:14 +0200
commitb29f697ad640653c976f9f25c97358aa96a509a9 (patch)
tree0ac3c71cd7d62c1cff0eadf12056e0c2a0c4160b /flake.nix
parent2c484515b9f2d9584e4954ca06ffe6c173db0a7b (diff)
downloadECTester-b29f697ad640653c976f9f25c97358aa96a509a9.tar.gz
ECTester-b29f697ad640653c976f9f25c97358aa96a509a9.tar.zst
ECTester-b29f697ad640653c976f9f25c97358aa96a509a9.zip
Link TomCrypt statically and build the shim with Nix
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index bd93f5e..c841ce4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -64,9 +64,17 @@
libgpg-error = pkgs.libgpg-error.overrideAttrs (final: prev: {
configureFlags = ( prev.configureFlags or [] ) ++ [ "--enable-static" ];
});
- libtomcrypt = pkgs.libtomcrypt.overrideAttrs (final: prev: {
+ libtomcrypt = (pkgs.libtomcrypt.override { libtommath = libtommath; }).overrideAttrs (final: prev: {
makefile = "makefile.unix";
});
+ libtommath = pkgs.libtommath.overrideAttrs (final: prev: rec {
+ makefile = "makefile.unix";
+ version = "1.3.0";
+ src = pkgs.fetchurl {
+ url = "https://github.com/libtom/libtommath/releases/download/v${version}/ltm-${version}.tar.xz";
+ sha256 = "sha256-KWJy2TQ1mRMI63NgdgDANLVYgHoH6CnnURQuZcz6nQg=";
+ };
+ });
nettle = pkgs.nettle.overrideAttrs (final: prev: {
configureFlags = ( prev.configureFlags or [] ) ++ [ "--enable-static" ];
});
@@ -109,6 +117,8 @@
});
libresslShim = import ./nix/libresslshim.nix { pkgs = pkgs; libressl = libressl; };
boringsslShim = import ./nix/boringsslshim.nix { pkgs = pkgs; boringssl = patched_boringssl; };
+ # Current list of targets: tomcrypt botan cryptopp openssl boringssl gcrypt mbedtls ippcp nettle libressl
+ tomcryptShim = import ./nix/tomcryptshim.nix { inherit pkgs libtomcrypt libtommath; };
botanShim = import ./nix/botanshim.nix { inherit pkgs; };
mbedtlsShim = import ./nix/mbedtlsshim.nix { pkgs = pkgs; };
ippcryptoShim = import ./nix/ippcryptoshim.nix { pkgs = pkgs; ipp-crypto = customPkgs.ipp-crypto; };
@@ -146,6 +156,7 @@
pushd standalone/src/main/resources/cz/crcs/ectester/standalone/libs/jni/
make lib_timing.so lib_csignals.so lib_cppsignals.so
popd
+ cp ${tomcryptShim.out}/lib/tomcrypt_provider.so ${jniLibsPath}
cp ${botanShim.out}/lib/botan_provider.so ${jniLibsPath}
cp ${commonLibs}/lib/* ${jniLibsPath}
'';