summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arc4random/getentropy_solaris.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/arc4random/getentropy_solaris.c')
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_solaris.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/arc4random/getentropy_solaris.c b/src/lib/libcrypto/arc4random/getentropy_solaris.c
index 4133d895fd..53ce742fac 100644
--- a/src/lib/libcrypto/arc4random/getentropy_solaris.c
+++ b/src/lib/libcrypto/arc4random/getentropy_solaris.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_solaris.c,v 1.10 2015/08/25 17:26:43 deraadt Exp $ */ 1/* $OpenBSD: getentropy_solaris.c,v 1.11 2015/09/11 11:52:55 deraadt 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>
@@ -81,7 +81,7 @@ getentropy(void *buf, size_t len)
81 81
82 if (len > 256) { 82 if (len > 256) {
83 errno = EIO; 83 errno = EIO;
84 return -1; 84 return (-1);
85 } 85 }
86 86
87 /* 87 /*
@@ -160,8 +160,8 @@ gotdata(char *buf, size_t len)
160 for (i = 0; i < len; ++i) 160 for (i = 0; i < len; ++i)
161 any_set |= buf[i]; 161 any_set |= buf[i];
162 if (any_set == 0) 162 if (any_set == 0)
163 return -1; 163 return (-1);
164 return 0; 164 return (0);
165} 165}
166 166
167static int 167static int
@@ -212,11 +212,11 @@ start:
212 close(fd); 212 close(fd);
213 if (gotdata(buf, len) == 0) { 213 if (gotdata(buf, len) == 0) {
214 errno = save_errno; 214 errno = save_errno;
215 return 0; /* satisfied */ 215 return (0); /* satisfied */
216 } 216 }
217nodevrandom: 217nodevrandom:
218 errno = EIO; 218 errno = EIO;
219 return -1; 219 return (-1);
220} 220}
221 221
222static const int cl[] = { 222static const int cl[] = {
@@ -250,7 +250,7 @@ getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data)
250 SHA512_CTX *ctx = data; 250 SHA512_CTX *ctx = data;
251 251
252 SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr)); 252 SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr));
253 return 0; 253 return (0);
254} 254}
255 255
256static int 256static int
@@ -438,8 +438,8 @@ getentropy_fallback(void *buf, size_t len)
438 explicit_bzero(results, sizeof results); 438 explicit_bzero(results, sizeof results);
439 if (gotdata(buf, len) == 0) { 439 if (gotdata(buf, len) == 0) {
440 errno = save_errno; 440 errno = save_errno;
441 return 0; /* satisfied */ 441 return (0); /* satisfied */
442 } 442 }
443 errno = EIO; 443 errno = EIO;
444 return -1; 444 return (-1);
445} 445}