Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Majer <amajer@suse.de>2020-02-28 14:14:18 +0300
committerBeth Griggs <Bethany.Griggs@uk.ibm.com>2020-03-02 23:21:14 +0300
commit47046aa5a95b0fe80c9b73c9f23f7574ef36fd48 (patch)
treeeb78ba0251f44ea6af75db3c0cddaec937a76d66
parentf235eea8b3c55a9b5b877cc3e1e9db644e9920f2 (diff)
deps: openssl: cherry-pick 4dcb150ea30f
OpenSSL 1.1.1d does not ship with getrandom syscall being predefined on all architectures. So when NodeJS is run with glibc prior to 2.25, where getentropy is unavailable, and the getrandom syscall is unknown, it will fail. PPC64LE or s390 are affected by lack of this definition. Original commit message. commit 4dcb150ea30f9bbfa7946e6b39c30a86aca5ed02 Author: Kurt Roeckx <kurt@roeckx.be> Date: Sat Sep 28 14:59:32 2019 +0200 Add defines for __NR_getrandom for all Linux architectures Fixes: https://github.com/openssl/openssl/issues/10015 Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> GH: https://github.com/openssl/openssl/pull/10044 Fixes: https://github.com/nodejs/node/issues/31671 PR-URL: https://github.com/nodejs/node/pull/32002 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
-rw-r--r--deps/openssl/openssl/crypto/rand/rand_unix.c52
1 files changed, 49 insertions, 3 deletions
diff --git a/deps/openssl/openssl/crypto/rand/rand_unix.c b/deps/openssl/openssl/crypto/rand/rand_unix.c
index 69efcdeed75..315af610f84 100644
--- a/deps/openssl/openssl/crypto/rand/rand_unix.c
+++ b/deps/openssl/openssl/crypto/rand/rand_unix.c
@@ -282,12 +282,58 @@ static ssize_t sysctl_random(char *buf, size_t buflen)
# if defined(OPENSSL_RAND_SEED_GETRANDOM)
# if defined(__linux) && !defined(__NR_getrandom)
-# if defined(__arm__) && defined(__NR_SYSCALL_BASE)
+# if defined(__arm__)
# define __NR_getrandom (__NR_SYSCALL_BASE+384)
# elif defined(__i386__)
# define __NR_getrandom 355
-# elif defined(__x86_64__) && !defined(__ILP32__)
-# define __NR_getrandom 318
+# elif defined(__x86_64__)
+# if defined(__ILP32__)
+# define __NR_getrandom (__X32_SYSCALL_BIT + 318)
+# else
+# define __NR_getrandom 318
+# endif
+# elif defined(__xtensa__)
+# define __NR_getrandom 338
+# elif defined(__s390__) || defined(__s390x__)
+# define __NR_getrandom 349
+# elif defined(__bfin__)
+# define __NR_getrandom 389
+# elif defined(__powerpc__)
+# define __NR_getrandom 359
+# elif defined(__mips__) || defined(__mips64)
+# if _MIPS_SIM == _MIPS_SIM_ABI32
+# define __NR_getrandom (__NR_Linux + 353)
+# elif _MIPS_SIM == _MIPS_SIM_ABI64
+# define __NR_getrandom (__NR_Linux + 313)
+# elif _MIPS_SIM == _MIPS_SIM_NABI32
+# define __NR_getrandom (__NR_Linux + 317)
+# endif
+# elif defined(__hppa__)
+# define __NR_getrandom (__NR_Linux + 339)
+# elif defined(__sparc__)
+# define __NR_getrandom 347
+# elif defined(__ia64__)
+# define __NR_getrandom 1339
+# elif defined(__alpha__)
+# define __NR_getrandom 511
+# elif defined(__sh__)
+# if defined(__SH5__)
+# define __NR_getrandom 373
+# else
+# define __NR_getrandom 384
+# endif
+# elif defined(__avr32__)
+# define __NR_getrandom 317
+# elif defined(__microblaze__)
+# define __NR_getrandom 385
+# elif defined(__m68k__)
+# define __NR_getrandom 352
+# elif defined(__cris__)
+# define __NR_getrandom 356
+# elif defined(__aarch64__)
+# define __NR_getrandom 278
+# else /* generic */
+# define __NR_getrandom 278
# endif
# endif