summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorderaadt <>2015-08-25 17:22:56 +0000
committerderaadt <>2015-08-25 17:22:56 +0000
commit78d8e271d36088f927cd3ce17960abe312011aa0 (patch)
tree900feb9b6667d02783c7d459223bfcf8a378eb6f /src
parenteb4634b13e5bf3cb0ca79965ff6dc1c7b8009097 (diff)
downloadopenbsd-78d8e271d36088f927cd3ce17960abe312011aa0.tar.gz
openbsd-78d8e271d36088f927cd3ce17960abe312011aa0.tar.bz2
openbsd-78d8e271d36088f927cd3ce17960abe312011aa0.zip
KNF
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_freebsd.c10
-rw-r--r--src/lib/libcrypto/crypto/getentropy_freebsd.c10
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)
54int 54int
55getentropy(void *buf, size_t len) 55getentropy(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)
54int 54int
55getentropy(void *buf, size_t len) 55getentropy(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}