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>
This commit is contained in:
Moritz Angermann 2023-10-09 21:04:29 +08:00 committed by GitHub
parent bc26c23d58
commit 73b3ea3648
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 34 deletions

View file

@ -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"

View file

@ -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 <sys/stat.h>
#include <unistd.h>
-#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();
}