Open yeahtoo opened 4 years ago
ok, at last i found the problem is in openssl, if no mac address the system entropy is generate very slow, so the program is block in openssl initial,so change the /dev/random to /dev/urandom,here is my modify in openssl: diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
index fe457ca..7059e94 100644
--- a/crypto/rand/rand_unix.c
+++ b/crypto/rand/rand_unix.c
@@ -633,7 +633,9 @@ size_t rand_pool_acquire_entropy(RAND_POOL *pool)
bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
while (bytes_needed != 0 && attempts-- > 0) {
buffer = rand_pool_add_begin(pool, bytes_needed);
- bytes = syscall_random(buffer, bytes_needed);
+ memset(buffer, 0x26, bytes_needed);
+ bytes = bytes_needed;
+ // bytes = syscall_random(buffer, bytes_needed);
if (bytes > 0) {
rand_pool_add_end(pool, bytes, 8 * bytes);
bytes_needed -= bytes;
diff --git a/e_os.h b/e_os.h
index 34223a0..94df2af 100644
--- a/e_os.h
+++ b/e_os.h
@@ -30,7 +30,7 @@
# define DEVRANDOM "/dev/urandom", "/dev/random", "/dev/hwrng", "/dev/srandom"
# if defined(__linux) && !defined(__ANDROID__)
# ifndef DEVRANDOM_WAIT
-# define DEVRANDOM_WAIT "/dev/random"
+# define DEVRANDOM_WAIT "/dev/urandom"
# endif
/*
* Linux kernels 4.8 and later changes how their random device works and there
what you did is removing entropy from ssl generation, so it will have same initialization everytime, which is bad, because you need to catch communication only once, and then you will be able to decrypt it always.
first of, since this issue is with openssl, send it to openssl authors, second ... you really should not use openssl library patched with your "fix" if you care about your system security.
what you did is removing entropy from ssl generation, so it will have same initialization everytime, which is bad, because you need to catch communication only once, and then you will be able to decrypt it always.
first of, since this issue is with openssl, send it to openssl authors, second ... you really should not use openssl library patched with your "fix" if you care about your system security.
ok, thanks for your advise
Hi, my application use "usbmuxd_get_device_list" to get the device counts, if counts > 0 will connect the device. And i found the first power on(has no avliable network device), it almous wait 20~80 seconds to be connect successful,but the phone is always pluged on the hardware, and if i use plug a usb wifi or usb phy device, first power on, the connection will be very faster. and after first power on connect successful, i plug out and plug in the iphone, the connection is normal(not slow), if has network device or not. here is my application log: