comparison Resources/Patches/openssl-1.1.1f.patch @ 3805:cdb429340112

Fix OpenSSL initialization on Linux Standard Base
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 02 Apr 2020 16:45:20 +0200
parents e9834343d327
children
comparison
equal deleted inserted replaced
3804:552703b37114 3805:cdb429340112
1 diff -urEb openssl-1.1.1f.orig/crypto/rand/rand_unix.c openssl-1.1.1f/crypto/rand/rand_unix.c 1 diff -urEb openssl-1.1.1f.orig/crypto/rand/rand_unix.c openssl-1.1.1f/crypto/rand/rand_unix.c
2 --- openssl-1.1.1f.orig/crypto/rand/rand_unix.c 2020-04-02 13:14:23.195439492 +0200 2 --- openssl-1.1.1f.orig/crypto/rand/rand_unix.c 2020-03-31 14:17:45.000000000 +0200
3 +++ openssl-1.1.1f/crypto/rand/rand_unix.c 2020-04-02 13:15:18.079473769 +0200 3 +++ openssl-1.1.1f/crypto/rand/rand_unix.c 2020-04-02 16:38:56.091240847 +0200
4 @@ -387,7 +387,7 @@ 4 @@ -445,6 +445,7 @@
5 # endif 5 * system call and this should always succeed which renders
6 6 * this alternative but essentially identical source moot.
7 /* Linux supports this since version 3.17 */ 7 */
8 -# if defined(__linux) && defined(__NR_getrandom) 8 +#if !defined(__LSB_VERSION__) // "syscall()" is not available in LSB
9 +# if defined(__linux) && defined(__NR_getrandom) && !defined(__LSB_VERSION__) 9 if (uname(&un) == 0) {
10 return syscall(__NR_getrandom, buf, buflen, 0); 10 kernel[0] = atoi(un.release);
11 # elif (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND) 11 p = strchr(un.release, '.');
12 return sysctl_random(buf, buflen); 12 @@ -455,6 +456,7 @@
13 return 0;
14 }
15 }
16 +#endif
17 /* Open /dev/random and wait for it to be readable */
18 if ((fd = open(DEVRANDOM_WAIT, O_RDONLY)) != -1) {
19 if (DEVRANDM_WAIT_USE_SELECT && fd < FD_SETSIZE) {