12 sgxVersion = sgx-sdk.versionTag;
13 opensslVersion = "3.0.13";
16 pname = "sgx-ssl" + lib.optionalString debug "-debug";
17 version = "${sgxVersion}_${opensslVersion}";
19 src = fetchFromGitHub {
21 repo = "intel-sgx-ssl";
23 hash = "sha256-dmLyaG6v+skjSa0KxLAfIfSBOxp9grrI7ds6WdGPe0I=";
28 opensslSourceArchive = fetchurl {
29 url = "https://www.openssl.org/source/openssl-${opensslVersion}.tar.gz";
30 hash = "sha256-iFJXU/edO+wn0vp8ZqoLkrOqlJja/ZPXz6SzeAza4xM=";
34 ln -s ${opensslSourceArchive} $sourceRoot/openssl_source/openssl-${opensslVersion}.tar.gz
38 patchShebangs Linux/build_openssl.sh
40 # Skip the tests. Build and run separately (see below).
41 substituteInPlace Linux/sgx/Makefile \
42 --replace-fail '$(MAKE) -C $(TEST_DIR) all' \
54 ] ++ lib.optionals debug [
62 # These tests build on any x86_64-linux but BOTH SIM and HW will only _run_ on
63 # real Intel hardware. Split these out so OfBorg doesn't choke on this pkg.
66 # nix run .#sgx-ssl.tests.HW
67 # nix run .#sgx-ssl.tests.SIM
70 HW = callPackage ./tests.nix { sgxMode = "HW"; inherit opensslVersion; };
71 SIM = callPackage ./tests.nix { sgxMode = "SIM"; inherit opensslVersion; };
75 description = "Cryptographic library for Intel SGX enclave applications based on OpenSSL";
76 homepage = "https://github.com/intel/intel-sgx-ssl";
77 maintainers = with lib.maintainers; [ phlip9 trundle veehaitch ];
78 platforms = [ "x86_64-linux" ];
79 license = with lib.licenses; [ bsd3 openssl ];