Add a fallback definition for __NR_getrandom for ARM linux
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 17 Aug 2019 11:22:07 +0000 (13:22 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 19 Aug 2019 05:03:05 +0000 (07:03 +0200)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9619)

crypto/rand/rand_unix.c

index e45e018e4a633ae3891affc86520f4c9e733c1d8..de86e48f3a4dbef301046db4b1334a687892f2b7 100644 (file)
@@ -254,6 +254,13 @@ static ssize_t sysctl_random(char *buf, size_t buflen)
 #  endif
 
 #  if defined(OPENSSL_RAND_SEED_GETRANDOM)
 #  endif
 
 #  if defined(OPENSSL_RAND_SEED_GETRANDOM)
+
+#   if defined(__linux) && !defined(__NR_getrandom)
+#    if defined(__arm__) && defined(__NR_SYSCALL_BASE)
+#     define __NR_getrandom    (__NR_SYSCALL_BASE+384)
+#    endif
+#   endif
+
 /*
  * syscall_random(): Try to get random data using a system call
  * returns the number of bytes returned in buf, or < 0 on error.
 /*
  * syscall_random(): Try to get random data using a system call
  * returns the number of bytes returned in buf, or < 0 on error.