diff options
| author | Ondřej Surý <ondrej@sury.org> | 2016-08-30 11:18:13 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2016-08-30 11:21:50 +0200 |
| commit | 705053409dade9bc9f691a25f9754a129fa37406 (patch) | |
| tree | b4a080db9630fb9a85b63e918c4cc51b8b8f2cec /src | |
| parent | 6a6a85b0ecfbe1a68e0b2d86ba1f75a17f8c1598 (diff) | |
| download | luaossl-705053409dade9bc9f691a25f9754a129fa37406.tar.gz luaossl-705053409dade9bc9f691a25f9754a129fa37406.tar.bz2 luaossl-705053409dade9bc9f691a25f9754a129fa37406.zip | |
Use syscall() to call getrandom()
Diffstat (limited to 'src')
| -rw-r--r-- | src/openssl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/openssl.c b/src/openssl.c index 136110f..c25651b 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | #include <linux/version.h> | 59 | #include <linux/version.h> |
| 60 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) | 60 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) |
| 61 | #define HAVE_GETRANDOM | 61 | #define HAVE_GETRANDOM |
| 62 | #include <sys/syscall.h> | ||
| 62 | #include <linux/random.h> | 63 | #include <linux/random.h> |
| 63 | #else | 64 | #else |
| 64 | #define HAVE_SYS_SYSCTL_H | 65 | #define HAVE_SYS_SYSCTL_H |
| @@ -7852,7 +7853,7 @@ static int randL_stir(struct randL_state *st, unsigned rqstd) { | |||
| 7852 | while (count < rqstd) { | 7853 | while (count < rqstd) { |
| 7853 | size_t n = MIN(rqstd - count, sizeof data); | 7854 | size_t n = MIN(rqstd - count, sizeof data); |
| 7854 | 7855 | ||
| 7855 | n = getrandom(data, n, 0); | 7856 | n = syscall(SYS_getrandom, data, n, 0); |
| 7856 | 7857 | ||
| 7857 | if (n == -1) { | 7858 | if (n == -1) { |
| 7858 | break; | 7859 | break; |
