summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/arc4random/getentropy_solaris.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-09-11 11:52:55 +0000
committerderaadt <deraadt@openbsd.org>2015-09-11 11:52:55 +0000
commit044fc755ab8a41e1db871f293b6da2332fa31ad2 (patch)
treef22ab60e687a64ca89981e80933eaf6d92459330 /lib/libcrypto/arc4random/getentropy_solaris.c
parentAvoid undefined behavior with isascii, cast its argument to unsigned char. (diff)
downloadwireguard-openbsd-044fc755ab8a41e1db871f293b6da2332fa31ad2.tar.xz
wireguard-openbsd-044fc755ab8a41e1db871f293b6da2332fa31ad2.zip
unify files further
Diffstat (limited to 'lib/libcrypto/arc4random/getentropy_solaris.c')
-rw-r--r--lib/libcrypto/arc4random/getentropy_solaris.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libcrypto/arc4random/getentropy_solaris.c b/lib/libcrypto/arc4random/getentropy_solaris.c
index 4133d895fd9..53ce742fac7 100644
--- a/lib/libcrypto/arc4random/getentropy_solaris.c
+++ b/lib/libcrypto/arc4random/getentropy_solaris.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getentropy_solaris.c,v 1.10 2015/08/25 17:26:43 deraadt Exp $ */
+/* $OpenBSD: getentropy_solaris.c,v 1.11 2015/09/11 11:52:55 deraadt Exp $ */
/*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
@@ -81,7 +81,7 @@ getentropy(void *buf, size_t len)
if (len > 256) {
errno = EIO;
- return -1;
+ return (-1);
}
/*
@@ -160,8 +160,8 @@ gotdata(char *buf, size_t len)
for (i = 0; i < len; ++i)
any_set |= buf[i];
if (any_set == 0)
- return -1;
- return 0;
+ return (-1);
+ return (0);
}
static int
@@ -212,11 +212,11 @@ start:
close(fd);
if (gotdata(buf, len) == 0) {
errno = save_errno;
- return 0; /* satisfied */
+ return (0); /* satisfied */
}
nodevrandom:
errno = EIO;
- return -1;
+ return (-1);
}
static const int cl[] = {
@@ -250,7 +250,7 @@ getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data)
SHA512_CTX *ctx = data;
SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr));
- return 0;
+ return (0);
}
static int
@@ -438,8 +438,8 @@ getentropy_fallback(void *buf, size_t len)
explicit_bzero(results, sizeof results);
if (gotdata(buf, len) == 0) {
errno = save_errno;
- return 0; /* satisfied */
+ return (0); /* satisfied */
}
errno = EIO;
- return -1;
+ return (-1);
}