diff options
author | 2014-07-22 01:15:58 +0000 | |
---|---|---|
committer | 2014-07-22 01:15:58 +0000 | |
commit | 6cb31805d5ceffed68fbf3679283be89785daaea (patch) | |
tree | bd7c75554cf4acdb84170614c41cf5f3d6c41f1c | |
parent | boot(9): Reduce diffs between hppa & hppa64 (& others) (diff) | |
download | wireguard-openbsd-6cb31805d5ceffed68fbf3679283be89785daaea.tar.xz wireguard-openbsd-6cb31805d5ceffed68fbf3679283be89785daaea.zip |
better match proposed syscall api
-rw-r--r-- | lib/libcrypto/arc4random/getentropy_linux.c | 10 | ||||
-rw-r--r-- | lib/libcrypto/crypto/getentropy_linux.c | 10 |
2 files changed, 4 insertions, 16 deletions
diff --git a/lib/libcrypto/arc4random/getentropy_linux.c b/lib/libcrypto/arc4random/getentropy_linux.c index 539a71af176..59bc3628a6f 100644 --- a/lib/libcrypto/arc4random/getentropy_linux.c +++ b/lib/libcrypto/arc4random/getentropy_linux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_linux.c,v 1.31 2014/07/21 23:34:54 deraadt Exp $ */ +/* $OpenBSD: getentropy_linux.c,v 1.32 2014/07/22 01:15:58 bcook Exp $ */ /* * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> @@ -197,15 +197,9 @@ getentropy_getrandom(void *buf, size_t len) #define SYS__getrandom 354 #endif #endif - struct __getrandom_args args = { - .buf = buf; - .len = len; - .flags = 0; - }; - if (len > 256) return (-1); - ret = syscall(SYS__getrandom, &args); + ret = syscall(SYS__getrandom, buf, len, 0); if (ret == len) return (0); #endif diff --git a/lib/libcrypto/crypto/getentropy_linux.c b/lib/libcrypto/crypto/getentropy_linux.c index 539a71af176..59bc3628a6f 100644 --- a/lib/libcrypto/crypto/getentropy_linux.c +++ b/lib/libcrypto/crypto/getentropy_linux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getentropy_linux.c,v 1.31 2014/07/21 23:34:54 deraadt Exp $ */ +/* $OpenBSD: getentropy_linux.c,v 1.32 2014/07/22 01:15:58 bcook Exp $ */ /* * Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org> @@ -197,15 +197,9 @@ getentropy_getrandom(void *buf, size_t len) #define SYS__getrandom 354 #endif #endif - struct __getrandom_args args = { - .buf = buf; - .len = len; - .flags = 0; - }; - if (len > 256) return (-1); - ret = syscall(SYS__getrandom, &args); + ret = syscall(SYS__getrandom, buf, len, 0); if (ret == len) return (0); #endif |