diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/arc4random/getentropy_freebsd.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto/getentropy_freebsd.c | 10 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/lib/libcrypto/arc4random/getentropy_freebsd.c b/src/lib/libcrypto/arc4random/getentropy_freebsd.c index ec760ae43d..d5371b5578 100644 --- a/src/lib/libcrypto/arc4random/getentropy_freebsd.c +++ b/src/lib/libcrypto/arc4random/getentropy_freebsd.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getentropy_freebsd.c,v 1.1 2014/11/03 06:23:30 bcook Exp $ */ | 1 | /* $OpenBSD: getentropy_freebsd.c,v 1.2 2015/08/25 17:22:56 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2014 Pawel Jakub Dawidek <pjd@FreeBSD.org> | 4 | * Copyright (c) 2014 Pawel Jakub Dawidek <pjd@FreeBSD.org> |
@@ -54,11 +54,9 @@ getentropy_sysctl(u_char *buf, size_t size) | |||
54 | int | 54 | int |
55 | getentropy(void *buf, size_t len) | 55 | getentropy(void *buf, size_t len) |
56 | { | 56 | { |
57 | if (len <= 256 && | 57 | if (len <= 256 && getentropy_sysctl(buf, len) == len) |
58 | getentropy_sysctl(buf, len) == len) { | 58 | return (0); |
59 | return 0; | ||
60 | } | ||
61 | 59 | ||
62 | errno = EIO; | 60 | errno = EIO; |
63 | return -1; | 61 | return (-1); |
64 | } | 62 | } |
diff --git a/src/lib/libcrypto/crypto/getentropy_freebsd.c b/src/lib/libcrypto/crypto/getentropy_freebsd.c index ec760ae43d..d5371b5578 100644 --- a/src/lib/libcrypto/crypto/getentropy_freebsd.c +++ b/src/lib/libcrypto/crypto/getentropy_freebsd.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getentropy_freebsd.c,v 1.1 2014/11/03 06:23:30 bcook Exp $ */ | 1 | /* $OpenBSD: getentropy_freebsd.c,v 1.2 2015/08/25 17:22:56 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2014 Pawel Jakub Dawidek <pjd@FreeBSD.org> | 4 | * Copyright (c) 2014 Pawel Jakub Dawidek <pjd@FreeBSD.org> |
@@ -54,11 +54,9 @@ getentropy_sysctl(u_char *buf, size_t size) | |||
54 | int | 54 | int |
55 | getentropy(void *buf, size_t len) | 55 | getentropy(void *buf, size_t len) |
56 | { | 56 | { |
57 | if (len <= 256 && | 57 | if (len <= 256 && getentropy_sysctl(buf, len) == len) |
58 | getentropy_sysctl(buf, len) == len) { | 58 | return (0); |
59 | return 0; | ||
60 | } | ||
61 | 59 | ||
62 | errno = EIO; | 60 | errno = EIO; |
63 | return -1; | 61 | return (-1); |
64 | } | 62 | } |