summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbcook <>2014-07-22 01:15:58 +0000
committerbcook <>2014-07-22 01:15:58 +0000
commit2384810741e4764a84e9c140c697eb7f1ff264c0 (patch)
tree16f1169fe597a79f33754d8ba9eeb04ccd498e09 /src
parent5f7c8e3b3667882edafd98090f7ead4e130824c8 (diff)
downloadopenbsd-2384810741e4764a84e9c140c697eb7f1ff264c0.tar.gz
openbsd-2384810741e4764a84e9c140c697eb7f1ff264c0.tar.bz2
openbsd-2384810741e4764a84e9c140c697eb7f1ff264c0.zip
better match proposed syscall api
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