summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_linux.c10
-rw-r--r--src/lib/libcrypto/crypto/getentropy_linux.c10
2 files changed, 4 insertions, 16 deletions
diff --git a/src/lib/libcrypto/arc4random/getentropy_linux.c b/src/lib/libcrypto/arc4random/getentropy_linux.c
index 539a71af17..59bc3628a6 100644
--- a/src/lib/libcrypto/arc4random/getentropy_linux.c
+++ b/src/lib/libcrypto/arc4random/getentropy_linux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_linux.c,v 1.31 2014/07/21 23:34:54 deraadt Exp $ */ 1/* $OpenBSD: getentropy_linux.c,v 1.32 2014/07/22 01:15:58 bcook Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> 4 * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@@ -197,15 +197,9 @@ getentropy_getrandom(void *buf, size_t len)
197#define SYS__getrandom 354 197#define SYS__getrandom 354
198#endif 198#endif
199#endif 199#endif
200 struct __getrandom_args args = {
201 .buf = buf;
202 .len = len;
203 .flags = 0;
204 };
205
206 if (len > 256) 200 if (len > 256)
207 return (-1); 201 return (-1);
208 ret = syscall(SYS__getrandom, &args); 202 ret = syscall(SYS__getrandom, buf, len, 0);
209 if (ret == len) 203 if (ret == len)
210 return (0); 204 return (0);
211#endif 205#endif
diff --git a/src/lib/libcrypto/crypto/getentropy_linux.c b/src/lib/libcrypto/crypto/getentropy_linux.c
index 539a71af17..59bc3628a6 100644
--- a/src/lib/libcrypto/crypto/getentropy_linux.c
+++ b/src/lib/libcrypto/crypto/getentropy_linux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_linux.c,v 1.31 2014/07/21 23:34:54 deraadt Exp $ */ 1/* $OpenBSD: getentropy_linux.c,v 1.32 2014/07/22 01:15:58 bcook Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> 4 * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@@ -197,15 +197,9 @@ getentropy_getrandom(void *buf, size_t len)
197#define SYS__getrandom 354 197#define SYS__getrandom 354
198#endif 198#endif
199#endif 199#endif
200 struct __getrandom_args args = {
201 .buf = buf;
202 .len = len;
203 .flags = 0;
204 };
205
206 if (len > 256) 200 if (len > 256)
207 return (-1); 201 return (-1);
208 ret = syscall(SYS__getrandom, &args); 202 ret = syscall(SYS__getrandom, buf, len, 0);
209 if (ret == len) 203 if (ret == len)
210 return (0); 204 return (0);
211#endif 205#endif