From 73b3ea36481c11e28332c734f43c2ddeacc9c231 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Mon, 9 Oct 2023 21:04:29 +0800 Subject: [PATCH] Drop entropy patch (#3191) * Drop entropy patch We don't need the patch anymore. We can set -fDoNotGetEntropy these days to achieve the same. * remove entropy.patch --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> --- flake.nix | 8 ++++---- scripts/nix/entropy.patch | 30 ------------------------------ 2 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 scripts/nix/entropy.patch diff --git a/flake.nix b/flake.nix index f6a68246e2..44a2e287ea 100644 --- a/flake.nix +++ b/flake.nix @@ -287,7 +287,7 @@ extra-modules = [{ packages.simplexmq.flags.swift = true; packages.direct-sqlcipher.flags.commoncrypto = true; - packages.entropy.patches = [ ./scripts/nix/entropy.patch ]; + packages.entropy.flags.DoNotGetEntropy = true; }]; }).simplex-chat.components.library.override ( iosOverrides "pkg-ios-aarch64-swift-json" @@ -297,7 +297,7 @@ pkgs' = pkgs; extra-modules = [{ packages.direct-sqlcipher.flags.commoncrypto = true; - packages.entropy.patches = [ ./scripts/nix/entropy.patch ]; + packages.entropy.flags.DoNotGetEntropy = true; }]; }).simplex-chat.components.library.override ( iosOverrides "pkg-ios-aarch64-tagged-json" @@ -310,7 +310,7 @@ extra-modules = [{ packages.simplexmq.flags.swift = true; packages.direct-sqlcipher.flags.commoncrypto = true; - packages.entropy.patches = [ ./scripts/nix/entropy.patch ]; + packages.entropy.flags.DoNotGetEntropy = true; }]; }).simplex-chat.components.library.override ( iosOverrides "pkg-ios-x86_64-swift-json" @@ -320,7 +320,7 @@ pkgs' = pkgs; extra-modules = [{ packages.direct-sqlcipher.flags.commoncrypto = true; - packages.entropy.patches = [ ./scripts/nix/entropy.patch ]; + packages.entropy.flags.DoNotGetEntropy = true; }]; }).simplex-chat.components.library.override ( iosOverrides "pkg-ios-x86_64-tagged-json" diff --git a/scripts/nix/entropy.patch b/scripts/nix/entropy.patch deleted file mode 100644 index 2add42acb3..0000000000 --- a/scripts/nix/entropy.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/cbits/random_initialized.c b/cbits/random_initialized.c -index 36ac968..ab708b0 100644 ---- a/cbits/random_initialized.c -+++ b/cbits/random_initialized.c -@@ -5,14 +5,6 @@ - #include - #include - --#ifdef HAVE_GETENTROPY --static int ensure_pool_initialized_getentropy() --{ -- char tmp; -- return getentropy(&tmp, sizeof(tmp)); --} --#endif -- - // Poll /dev/random to wait for randomness. This is a proxy for the /dev/urandom - // pool being initialized. - static int ensure_pool_initialized_poll() -@@ -45,10 +37,5 @@ static int ensure_pool_initialized_poll() - // Returns 0 on success, non-zero on failure. - int ensure_pool_initialized() - { --#ifdef HAVE_GETENTROPY -- if (ensure_pool_initialized_getentropy() == 0) -- return 0; --#endif -- - return ensure_pool_initialized_poll(); - }