summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/arc4random/arc4random_freebsd.h8
-rw-r--r--src/lib/libcrypto/arc4random/arc4random_netbsd.h8
-rw-r--r--src/lib/libcrypto/arc4random/arc4random_osx.h8
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_aix.c16
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_hpux.c16
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_linux.c20
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_netbsd.c8
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_osx.c16
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_solaris.c18
-rw-r--r--src/lib/libcrypto/arc4random/getentropy_win.c4
-rw-r--r--src/lib/libcrypto/crypto/arc4random_freebsd.h8
-rw-r--r--src/lib/libcrypto/crypto/arc4random_netbsd.h8
-rw-r--r--src/lib/libcrypto/crypto/arc4random_osx.h8
-rw-r--r--src/lib/libcrypto/crypto/getentropy_aix.c16
-rw-r--r--src/lib/libcrypto/crypto/getentropy_hpux.c16
-rw-r--r--src/lib/libcrypto/crypto/getentropy_linux.c20
-rw-r--r--src/lib/libcrypto/crypto/getentropy_netbsd.c8
-rw-r--r--src/lib/libcrypto/crypto/getentropy_osx.c16
-rw-r--r--src/lib/libcrypto/crypto/getentropy_solaris.c18
-rw-r--r--src/lib/libcrypto/crypto/getentropy_win.c4
20 files changed, 122 insertions, 122 deletions
diff --git a/src/lib/libcrypto/arc4random/arc4random_freebsd.h b/src/lib/libcrypto/arc4random/arc4random_freebsd.h
index b97bad86ca..b54f400c54 100644
--- a/src/lib/libcrypto/arc4random/arc4random_freebsd.h
+++ b/src/lib/libcrypto/arc4random/arc4random_freebsd.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_freebsd.h,v 1.2 2015/01/15 06:57:18 deraadt Exp $ */ 1/* $OpenBSD: arc4random_freebsd.h,v 1.3 2015/09/11 11:52:55 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -73,14 +73,14 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
73{ 73{
74 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE, 74 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
75 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) 75 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
76 return -1; 76 return (-1);
77 77
78 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE, 78 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
79 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) { 79 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
80 munmap(*rsp, sizeof(**rsp)); 80 munmap(*rsp, sizeof(**rsp));
81 return -1; 81 return (-1);
82 } 82 }
83 83
84 _ARC4_ATFORK(_rs_forkhandler); 84 _ARC4_ATFORK(_rs_forkhandler);
85 return 0; 85 return (0);
86} 86}
diff --git a/src/lib/libcrypto/arc4random/arc4random_netbsd.h b/src/lib/libcrypto/arc4random/arc4random_netbsd.h
index 489e73a078..7092baf77d 100644
--- a/src/lib/libcrypto/arc4random/arc4random_netbsd.h
+++ b/src/lib/libcrypto/arc4random/arc4random_netbsd.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_netbsd.h,v 1.1 2015/01/19 20:21:40 bcook Exp $ */ 1/* $OpenBSD: arc4random_netbsd.h,v 1.2 2015/09/11 11:52:55 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -73,14 +73,14 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
73{ 73{
74 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE, 74 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
75 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) 75 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
76 return -1; 76 return (-1);
77 77
78 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE, 78 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
79 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) { 79 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
80 munmap(*rsp, sizeof(**rsp)); 80 munmap(*rsp, sizeof(**rsp));
81 return -1; 81 return (-1);
82 } 82 }
83 83
84 _ARC4_ATFORK(_rs_forkhandler); 84 _ARC4_ATFORK(_rs_forkhandler);
85 return 0; 85 return (0);
86} 86}
diff --git a/src/lib/libcrypto/arc4random/arc4random_osx.h b/src/lib/libcrypto/arc4random/arc4random_osx.h
index 3bb14e03ab..19233ab58c 100644
--- a/src/lib/libcrypto/arc4random/arc4random_osx.h
+++ b/src/lib/libcrypto/arc4random/arc4random_osx.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_osx.h,v 1.9 2015/01/15 06:57:18 deraadt Exp $ */ 1/* $OpenBSD: arc4random_osx.h,v 1.10 2015/09/11 11:52:55 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -67,14 +67,14 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
67{ 67{
68 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE, 68 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
69 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) 69 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
70 return -1; 70 return (-1);
71 71
72 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE, 72 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
73 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) { 73 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
74 munmap(*rsp, sizeof(**rsp)); 74 munmap(*rsp, sizeof(**rsp));
75 return -1; 75 return (-1);
76 } 76 }
77 77
78 _ARC4_ATFORK(_rs_forkhandler); 78 _ARC4_ATFORK(_rs_forkhandler);
79 return 0; 79 return (0);
80} 80}
diff --git a/src/lib/libcrypto/arc4random/getentropy_aix.c b/src/lib/libcrypto/arc4random/getentropy_aix.c
index 56096e7c4a..0616bfde56 100644
--- a/src/lib/libcrypto/arc4random/getentropy_aix.c
+++ b/src/lib/libcrypto/arc4random/getentropy_aix.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_aix.c,v 1.3 2015/08/25 17:26:43 deraadt Exp $ */ 1/* $OpenBSD: getentropy_aix.c,v 1.4 2015/09/11 11:52:55 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2015 Michael Felt <aixtools@gmail.com> 4 * Copyright (c) 2015 Michael Felt <aixtools@gmail.com>
@@ -72,7 +72,7 @@ getentropy(void *buf, size_t len)
72 72
73 if (len > 256) { 73 if (len > 256) {
74 errno = EIO; 74 errno = EIO;
75 return -1; 75 return (-1);
76 } 76 }
77 77
78 /* 78 /*
@@ -130,8 +130,8 @@ gotdata(char *buf, size_t len)
130 for (i = 0; i < len; ++i) 130 for (i = 0; i < len; ++i)
131 any_set |= buf[i]; 131 any_set |= buf[i];
132 if (any_set == 0) 132 if (any_set == 0)
133 return -1; 133 return (-1);
134 return 0; 134 return (0);
135} 135}
136 136
137static int 137static int
@@ -181,11 +181,11 @@ start:
181 close(fd); 181 close(fd);
182 if (gotdata(buf, len) == 0) { 182 if (gotdata(buf, len) == 0) {
183 errno = save_errno; 183 errno = save_errno;
184 return 0; /* satisfied */ 184 return (0); /* satisfied */
185 } 185 }
186nodevrandom: 186nodevrandom:
187 errno = EIO; 187 errno = EIO;
188 return -1; 188 return (-1);
189} 189}
190 190
191static const int cl[] = { 191static const int cl[] = {
@@ -418,8 +418,8 @@ getentropy_fallback(void *buf, size_t len)
418 explicit_bzero(results, sizeof results); 418 explicit_bzero(results, sizeof results);
419 if (gotdata(buf, len) == 0) { 419 if (gotdata(buf, len) == 0) {
420 errno = save_errno; 420 errno = save_errno;
421 return 0; /* satisfied */ 421 return (0); /* satisfied */
422 } 422 }
423 errno = EIO; 423 errno = EIO;
424 return -1; 424 return (-1);
425} 425}
diff --git a/src/lib/libcrypto/arc4random/getentropy_hpux.c b/src/lib/libcrypto/arc4random/getentropy_hpux.c
index 2c4abfc96d..bdac6e16de 100644
--- a/src/lib/libcrypto/arc4random/getentropy_hpux.c
+++ b/src/lib/libcrypto/arc4random/getentropy_hpux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_hpux.c,v 1.3 2015/08/25 17:26:43 deraadt Exp $ */ 1/* $OpenBSD: getentropy_hpux.c,v 1.4 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>
@@ -76,7 +76,7 @@ getentropy(void *buf, size_t len)
76 76
77 if (len > 256) { 77 if (len > 256) {
78 errno = EIO; 78 errno = EIO;
79 return -1; 79 return (-1);
80 } 80 }
81 81
82 /* 82 /*
@@ -134,8 +134,8 @@ gotdata(char *buf, size_t len)
134 for (i = 0; i < len; ++i) 134 for (i = 0; i < len; ++i)
135 any_set |= buf[i]; 135 any_set |= buf[i];
136 if (any_set == 0) 136 if (any_set == 0)
137 return -1; 137 return (-1);
138 return 0; 138 return (0);
139} 139}
140 140
141static int 141static int
@@ -185,11 +185,11 @@ start:
185 close(fd); 185 close(fd);
186 if (gotdata(buf, len) == 0) { 186 if (gotdata(buf, len) == 0) {
187 errno = save_errno; 187 errno = save_errno;
188 return 0; /* satisfied */ 188 return (0); /* satisfied */
189 } 189 }
190nodevrandom: 190nodevrandom:
191 errno = EIO; 191 errno = EIO;
192 return -1; 192 return (-1);
193} 193}
194 194
195static const int cl[] = { 195static const int cl[] = {
@@ -412,8 +412,8 @@ getentropy_fallback(void *buf, size_t len)
412 explicit_bzero(results, sizeof results); 412 explicit_bzero(results, sizeof results);
413 if (gotdata(buf, len) == 0) { 413 if (gotdata(buf, len) == 0) {
414 errno = save_errno; 414 errno = save_errno;
415 return 0; /* satisfied */ 415 return (0); /* satisfied */
416 } 416 }
417 errno = EIO; 417 errno = EIO;
418 return -1; 418 return (-1);
419} 419}
diff --git a/src/lib/libcrypto/arc4random/getentropy_linux.c b/src/lib/libcrypto/arc4random/getentropy_linux.c
index fb218feefa..2a0a6875e4 100644
--- a/src/lib/libcrypto/arc4random/getentropy_linux.c
+++ b/src/lib/libcrypto/arc4random/getentropy_linux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_linux.c,v 1.40 2015/08/25 17:26:43 deraadt Exp $ */ 1/* $OpenBSD: getentropy_linux.c,v 1.41 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>
@@ -91,7 +91,7 @@ getentropy(void *buf, size_t len)
91 91
92 if (len > 256) { 92 if (len > 256) {
93 errno = EIO; 93 errno = EIO;
94 return -1; 94 return (-1);
95 } 95 }
96 96
97#ifdef SYS_getrandom 97#ifdef SYS_getrandom
@@ -186,8 +186,8 @@ gotdata(char *buf, size_t len)
186 for (i = 0; i < len; ++i) 186 for (i = 0; i < len; ++i)
187 any_set |= buf[i]; 187 any_set |= buf[i];
188 if (any_set == 0) 188 if (any_set == 0)
189 return -1; 189 return (-1);
190 return 0; 190 return (0);
191} 191}
192 192
193#ifdef SYS_getrandom 193#ifdef SYS_getrandom
@@ -260,11 +260,11 @@ start:
260 close(fd); 260 close(fd);
261 if (gotdata(buf, len) == 0) { 261 if (gotdata(buf, len) == 0) {
262 errno = save_errno; 262 errno = save_errno;
263 return 0; /* satisfied */ 263 return (0); /* satisfied */
264 } 264 }
265nodevrandom: 265nodevrandom:
266 errno = EIO; 266 errno = EIO;
267 return -1; 267 return (-1);
268} 268}
269 269
270#ifdef SYS__sysctl 270#ifdef SYS__sysctl
@@ -295,7 +295,7 @@ getentropy_sysctl(void *buf, size_t len)
295 } 295 }
296sysctlfailed: 296sysctlfailed:
297 errno = EIO; 297 errno = EIO;
298 return -1; 298 return (-1);
299} 299}
300#endif /* SYS__sysctl */ 300#endif /* SYS__sysctl */
301 301
@@ -330,7 +330,7 @@ getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data)
330 SHA512_CTX *ctx = data; 330 SHA512_CTX *ctx = data;
331 331
332 SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr)); 332 SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr));
333 return 0; 333 return (0);
334} 334}
335 335
336static int 336static int
@@ -540,8 +540,8 @@ getentropy_fallback(void *buf, size_t len)
540 explicit_bzero(results, sizeof results); 540 explicit_bzero(results, sizeof results);
541 if (gotdata(buf, len) == 0) { 541 if (gotdata(buf, len) == 0) {
542 errno = save_errno; 542 errno = save_errno;
543 return 0; /* satisfied */ 543 return (0); /* satisfied */
544 } 544 }
545 errno = EIO; 545 errno = EIO;
546 return -1; 546 return (-1);
547} 547}
diff --git a/src/lib/libcrypto/arc4random/getentropy_netbsd.c b/src/lib/libcrypto/arc4random/getentropy_netbsd.c
index a9710ef923..2a73591f6e 100644
--- a/src/lib/libcrypto/arc4random/getentropy_netbsd.c
+++ b/src/lib/libcrypto/arc4random/getentropy_netbsd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_netbsd.c,v 1.1 2015/01/19 20:21:40 bcook Exp $ */ 1/* $OpenBSD: getentropy_netbsd.c,v 1.2 2015/09/11 11:52:55 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>
@@ -55,10 +55,10 @@ int
55getentropy(void *buf, size_t len) 55getentropy(void *buf, size_t len)
56{ 56{
57 if (len <= 256 && 57 if (len <= 256 &&
58 getentropy_sysctl(buf, len) == len) { 58 getentropy_sysctl(buf, len) == len) {
59 return 0; 59 return (0);
60 } 60 }
61 61
62 errno = EIO; 62 errno = EIO;
63 return -1; 63 return (-1);
64} 64}
diff --git a/src/lib/libcrypto/arc4random/getentropy_osx.c b/src/lib/libcrypto/arc4random/getentropy_osx.c
index ac5c748f6a..e2dc916474 100644
--- a/src/lib/libcrypto/arc4random/getentropy_osx.c
+++ b/src/lib/libcrypto/arc4random/getentropy_osx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_osx.c,v 1.8 2014/07/21 20:19:47 guenther Exp $ */ 1/* $OpenBSD: getentropy_osx.c,v 1.9 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>
@@ -88,7 +88,7 @@ getentropy(void *buf, size_t len)
88 88
89 if (len > 256) { 89 if (len > 256) {
90 errno = EIO; 90 errno = EIO;
91 return -1; 91 return (-1);
92 } 92 }
93 93
94 /* 94 /*
@@ -149,8 +149,8 @@ gotdata(char *buf, size_t len)
149 for (i = 0; i < len; ++i) 149 for (i = 0; i < len; ++i)
150 any_set |= buf[i]; 150 any_set |= buf[i];
151 if (any_set == 0) 151 if (any_set == 0)
152 return -1; 152 return (-1);
153 return 0; 153 return (0);
154} 154}
155 155
156static int 156static int
@@ -200,11 +200,11 @@ start:
200 close(fd); 200 close(fd);
201 if (gotdata(buf, len) == 0) { 201 if (gotdata(buf, len) == 0) {
202 errno = save_errno; 202 errno = save_errno;
203 return 0; /* satisfied */ 203 return (0); /* satisfied */
204 } 204 }
205nodevrandom: 205nodevrandom:
206 errno = EIO; 206 errno = EIO;
207 return -1; 207 return (-1);
208} 208}
209 209
210static int tcpmib[] = { CTL_NET, AF_INET, IPPROTO_TCP, TCPCTL_STATS }; 210static int tcpmib[] = { CTL_NET, AF_INET, IPPROTO_TCP, TCPCTL_STATS };
@@ -422,8 +422,8 @@ getentropy_fallback(void *buf, size_t len)
422 explicit_bzero(results, sizeof results); 422 explicit_bzero(results, sizeof results);
423 if (gotdata(buf, len) == 0) { 423 if (gotdata(buf, len) == 0) {
424 errno = save_errno; 424 errno = save_errno;
425 return 0; /* satisfied */ 425 return (0); /* satisfied */
426 } 426 }
427 errno = EIO; 427 errno = EIO;
428 return -1; 428 return (-1);
429} 429}
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}
diff --git a/src/lib/libcrypto/arc4random/getentropy_win.c b/src/lib/libcrypto/arc4random/getentropy_win.c
index da048ae157..2e89b12205 100644
--- a/src/lib/libcrypto/arc4random/getentropy_win.c
+++ b/src/lib/libcrypto/arc4random/getentropy_win.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_win.c,v 1.3 2014/11/11 13:54:33 bcook Exp $ */ 1/* $OpenBSD: getentropy_win.c,v 1.4 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>
@@ -40,7 +40,7 @@ getentropy(void *buf, size_t len)
40 40
41 if (len > 256) { 41 if (len > 256) {
42 errno = EIO; 42 errno = EIO;
43 return -1; 43 return (-1);
44 } 44 }
45 45
46 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, 46 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
diff --git a/src/lib/libcrypto/crypto/arc4random_freebsd.h b/src/lib/libcrypto/crypto/arc4random_freebsd.h
index b97bad86ca..b54f400c54 100644
--- a/src/lib/libcrypto/crypto/arc4random_freebsd.h
+++ b/src/lib/libcrypto/crypto/arc4random_freebsd.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_freebsd.h,v 1.2 2015/01/15 06:57:18 deraadt Exp $ */ 1/* $OpenBSD: arc4random_freebsd.h,v 1.3 2015/09/11 11:52:55 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -73,14 +73,14 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
73{ 73{
74 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE, 74 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
75 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) 75 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
76 return -1; 76 return (-1);
77 77
78 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE, 78 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
79 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) { 79 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
80 munmap(*rsp, sizeof(**rsp)); 80 munmap(*rsp, sizeof(**rsp));
81 return -1; 81 return (-1);
82 } 82 }
83 83
84 _ARC4_ATFORK(_rs_forkhandler); 84 _ARC4_ATFORK(_rs_forkhandler);
85 return 0; 85 return (0);
86} 86}
diff --git a/src/lib/libcrypto/crypto/arc4random_netbsd.h b/src/lib/libcrypto/crypto/arc4random_netbsd.h
index 489e73a078..7092baf77d 100644
--- a/src/lib/libcrypto/crypto/arc4random_netbsd.h
+++ b/src/lib/libcrypto/crypto/arc4random_netbsd.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_netbsd.h,v 1.1 2015/01/19 20:21:40 bcook Exp $ */ 1/* $OpenBSD: arc4random_netbsd.h,v 1.2 2015/09/11 11:52:55 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -73,14 +73,14 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
73{ 73{
74 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE, 74 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
75 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) 75 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
76 return -1; 76 return (-1);
77 77
78 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE, 78 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
79 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) { 79 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
80 munmap(*rsp, sizeof(**rsp)); 80 munmap(*rsp, sizeof(**rsp));
81 return -1; 81 return (-1);
82 } 82 }
83 83
84 _ARC4_ATFORK(_rs_forkhandler); 84 _ARC4_ATFORK(_rs_forkhandler);
85 return 0; 85 return (0);
86} 86}
diff --git a/src/lib/libcrypto/crypto/arc4random_osx.h b/src/lib/libcrypto/crypto/arc4random_osx.h
index 3bb14e03ab..19233ab58c 100644
--- a/src/lib/libcrypto/crypto/arc4random_osx.h
+++ b/src/lib/libcrypto/crypto/arc4random_osx.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_osx.h,v 1.9 2015/01/15 06:57:18 deraadt Exp $ */ 1/* $OpenBSD: arc4random_osx.h,v 1.10 2015/09/11 11:52:55 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -67,14 +67,14 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
67{ 67{
68 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE, 68 if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
69 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) 69 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
70 return -1; 70 return (-1);
71 71
72 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE, 72 if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
73 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) { 73 MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
74 munmap(*rsp, sizeof(**rsp)); 74 munmap(*rsp, sizeof(**rsp));
75 return -1; 75 return (-1);
76 } 76 }
77 77
78 _ARC4_ATFORK(_rs_forkhandler); 78 _ARC4_ATFORK(_rs_forkhandler);
79 return 0; 79 return (0);
80} 80}
diff --git a/src/lib/libcrypto/crypto/getentropy_aix.c b/src/lib/libcrypto/crypto/getentropy_aix.c
index 56096e7c4a..0616bfde56 100644
--- a/src/lib/libcrypto/crypto/getentropy_aix.c
+++ b/src/lib/libcrypto/crypto/getentropy_aix.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_aix.c,v 1.3 2015/08/25 17:26:43 deraadt Exp $ */ 1/* $OpenBSD: getentropy_aix.c,v 1.4 2015/09/11 11:52:55 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2015 Michael Felt <aixtools@gmail.com> 4 * Copyright (c) 2015 Michael Felt <aixtools@gmail.com>
@@ -72,7 +72,7 @@ getentropy(void *buf, size_t len)
72 72
73 if (len > 256) { 73 if (len > 256) {
74 errno = EIO; 74 errno = EIO;
75 return -1; 75 return (-1);
76 } 76 }
77 77
78 /* 78 /*
@@ -130,8 +130,8 @@ gotdata(char *buf, size_t len)
130 for (i = 0; i < len; ++i) 130 for (i = 0; i < len; ++i)
131 any_set |= buf[i]; 131 any_set |= buf[i];
132 if (any_set == 0) 132 if (any_set == 0)
133 return -1; 133 return (-1);
134 return 0; 134 return (0);
135} 135}
136 136
137static int 137static int
@@ -181,11 +181,11 @@ start:
181 close(fd); 181 close(fd);
182 if (gotdata(buf, len) == 0) { 182 if (gotdata(buf, len) == 0) {
183 errno = save_errno; 183 errno = save_errno;
184 return 0; /* satisfied */ 184 return (0); /* satisfied */
185 } 185 }
186nodevrandom: 186nodevrandom:
187 errno = EIO; 187 errno = EIO;
188 return -1; 188 return (-1);
189} 189}
190 190
191static const int cl[] = { 191static const int cl[] = {
@@ -418,8 +418,8 @@ getentropy_fallback(void *buf, size_t len)
418 explicit_bzero(results, sizeof results); 418 explicit_bzero(results, sizeof results);
419 if (gotdata(buf, len) == 0) { 419 if (gotdata(buf, len) == 0) {
420 errno = save_errno; 420 errno = save_errno;
421 return 0; /* satisfied */ 421 return (0); /* satisfied */
422 } 422 }
423 errno = EIO; 423 errno = EIO;
424 return -1; 424 return (-1);
425} 425}
diff --git a/src/lib/libcrypto/crypto/getentropy_hpux.c b/src/lib/libcrypto/crypto/getentropy_hpux.c
index 2c4abfc96d..bdac6e16de 100644
--- a/src/lib/libcrypto/crypto/getentropy_hpux.c
+++ b/src/lib/libcrypto/crypto/getentropy_hpux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_hpux.c,v 1.3 2015/08/25 17:26:43 deraadt Exp $ */ 1/* $OpenBSD: getentropy_hpux.c,v 1.4 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>
@@ -76,7 +76,7 @@ getentropy(void *buf, size_t len)
76 76
77 if (len > 256) { 77 if (len > 256) {
78 errno = EIO; 78 errno = EIO;
79 return -1; 79 return (-1);
80 } 80 }
81 81
82 /* 82 /*
@@ -134,8 +134,8 @@ gotdata(char *buf, size_t len)
134 for (i = 0; i < len; ++i) 134 for (i = 0; i < len; ++i)
135 any_set |= buf[i]; 135 any_set |= buf[i];
136 if (any_set == 0) 136 if (any_set == 0)
137 return -1; 137 return (-1);
138 return 0; 138 return (0);
139} 139}
140 140
141static int 141static int
@@ -185,11 +185,11 @@ start:
185 close(fd); 185 close(fd);
186 if (gotdata(buf, len) == 0) { 186 if (gotdata(buf, len) == 0) {
187 errno = save_errno; 187 errno = save_errno;
188 return 0; /* satisfied */ 188 return (0); /* satisfied */
189 } 189 }
190nodevrandom: 190nodevrandom:
191 errno = EIO; 191 errno = EIO;
192 return -1; 192 return (-1);
193} 193}
194 194
195static const int cl[] = { 195static const int cl[] = {
@@ -412,8 +412,8 @@ getentropy_fallback(void *buf, size_t len)
412 explicit_bzero(results, sizeof results); 412 explicit_bzero(results, sizeof results);
413 if (gotdata(buf, len) == 0) { 413 if (gotdata(buf, len) == 0) {
414 errno = save_errno; 414 errno = save_errno;
415 return 0; /* satisfied */ 415 return (0); /* satisfied */
416 } 416 }
417 errno = EIO; 417 errno = EIO;
418 return -1; 418 return (-1);
419} 419}
diff --git a/src/lib/libcrypto/crypto/getentropy_linux.c b/src/lib/libcrypto/crypto/getentropy_linux.c
index fb218feefa..2a0a6875e4 100644
--- a/src/lib/libcrypto/crypto/getentropy_linux.c
+++ b/src/lib/libcrypto/crypto/getentropy_linux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_linux.c,v 1.40 2015/08/25 17:26:43 deraadt Exp $ */ 1/* $OpenBSD: getentropy_linux.c,v 1.41 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>
@@ -91,7 +91,7 @@ getentropy(void *buf, size_t len)
91 91
92 if (len > 256) { 92 if (len > 256) {
93 errno = EIO; 93 errno = EIO;
94 return -1; 94 return (-1);
95 } 95 }
96 96
97#ifdef SYS_getrandom 97#ifdef SYS_getrandom
@@ -186,8 +186,8 @@ gotdata(char *buf, size_t len)
186 for (i = 0; i < len; ++i) 186 for (i = 0; i < len; ++i)
187 any_set |= buf[i]; 187 any_set |= buf[i];
188 if (any_set == 0) 188 if (any_set == 0)
189 return -1; 189 return (-1);
190 return 0; 190 return (0);
191} 191}
192 192
193#ifdef SYS_getrandom 193#ifdef SYS_getrandom
@@ -260,11 +260,11 @@ start:
260 close(fd); 260 close(fd);
261 if (gotdata(buf, len) == 0) { 261 if (gotdata(buf, len) == 0) {
262 errno = save_errno; 262 errno = save_errno;
263 return 0; /* satisfied */ 263 return (0); /* satisfied */
264 } 264 }
265nodevrandom: 265nodevrandom:
266 errno = EIO; 266 errno = EIO;
267 return -1; 267 return (-1);
268} 268}
269 269
270#ifdef SYS__sysctl 270#ifdef SYS__sysctl
@@ -295,7 +295,7 @@ getentropy_sysctl(void *buf, size_t len)
295 } 295 }
296sysctlfailed: 296sysctlfailed:
297 errno = EIO; 297 errno = EIO;
298 return -1; 298 return (-1);
299} 299}
300#endif /* SYS__sysctl */ 300#endif /* SYS__sysctl */
301 301
@@ -330,7 +330,7 @@ getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data)
330 SHA512_CTX *ctx = data; 330 SHA512_CTX *ctx = data;
331 331
332 SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr)); 332 SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr));
333 return 0; 333 return (0);
334} 334}
335 335
336static int 336static int
@@ -540,8 +540,8 @@ getentropy_fallback(void *buf, size_t len)
540 explicit_bzero(results, sizeof results); 540 explicit_bzero(results, sizeof results);
541 if (gotdata(buf, len) == 0) { 541 if (gotdata(buf, len) == 0) {
542 errno = save_errno; 542 errno = save_errno;
543 return 0; /* satisfied */ 543 return (0); /* satisfied */
544 } 544 }
545 errno = EIO; 545 errno = EIO;
546 return -1; 546 return (-1);
547} 547}
diff --git a/src/lib/libcrypto/crypto/getentropy_netbsd.c b/src/lib/libcrypto/crypto/getentropy_netbsd.c
index a9710ef923..2a73591f6e 100644
--- a/src/lib/libcrypto/crypto/getentropy_netbsd.c
+++ b/src/lib/libcrypto/crypto/getentropy_netbsd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_netbsd.c,v 1.1 2015/01/19 20:21:40 bcook Exp $ */ 1/* $OpenBSD: getentropy_netbsd.c,v 1.2 2015/09/11 11:52:55 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>
@@ -55,10 +55,10 @@ int
55getentropy(void *buf, size_t len) 55getentropy(void *buf, size_t len)
56{ 56{
57 if (len <= 256 && 57 if (len <= 256 &&
58 getentropy_sysctl(buf, len) == len) { 58 getentropy_sysctl(buf, len) == len) {
59 return 0; 59 return (0);
60 } 60 }
61 61
62 errno = EIO; 62 errno = EIO;
63 return -1; 63 return (-1);
64} 64}
diff --git a/src/lib/libcrypto/crypto/getentropy_osx.c b/src/lib/libcrypto/crypto/getentropy_osx.c
index ac5c748f6a..e2dc916474 100644
--- a/src/lib/libcrypto/crypto/getentropy_osx.c
+++ b/src/lib/libcrypto/crypto/getentropy_osx.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_osx.c,v 1.8 2014/07/21 20:19:47 guenther Exp $ */ 1/* $OpenBSD: getentropy_osx.c,v 1.9 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>
@@ -88,7 +88,7 @@ getentropy(void *buf, size_t len)
88 88
89 if (len > 256) { 89 if (len > 256) {
90 errno = EIO; 90 errno = EIO;
91 return -1; 91 return (-1);
92 } 92 }
93 93
94 /* 94 /*
@@ -149,8 +149,8 @@ gotdata(char *buf, size_t len)
149 for (i = 0; i < len; ++i) 149 for (i = 0; i < len; ++i)
150 any_set |= buf[i]; 150 any_set |= buf[i];
151 if (any_set == 0) 151 if (any_set == 0)
152 return -1; 152 return (-1);
153 return 0; 153 return (0);
154} 154}
155 155
156static int 156static int
@@ -200,11 +200,11 @@ start:
200 close(fd); 200 close(fd);
201 if (gotdata(buf, len) == 0) { 201 if (gotdata(buf, len) == 0) {
202 errno = save_errno; 202 errno = save_errno;
203 return 0; /* satisfied */ 203 return (0); /* satisfied */
204 } 204 }
205nodevrandom: 205nodevrandom:
206 errno = EIO; 206 errno = EIO;
207 return -1; 207 return (-1);
208} 208}
209 209
210static int tcpmib[] = { CTL_NET, AF_INET, IPPROTO_TCP, TCPCTL_STATS }; 210static int tcpmib[] = { CTL_NET, AF_INET, IPPROTO_TCP, TCPCTL_STATS };
@@ -422,8 +422,8 @@ getentropy_fallback(void *buf, size_t len)
422 explicit_bzero(results, sizeof results); 422 explicit_bzero(results, sizeof results);
423 if (gotdata(buf, len) == 0) { 423 if (gotdata(buf, len) == 0) {
424 errno = save_errno; 424 errno = save_errno;
425 return 0; /* satisfied */ 425 return (0); /* satisfied */
426 } 426 }
427 errno = EIO; 427 errno = EIO;
428 return -1; 428 return (-1);
429} 429}
diff --git a/src/lib/libcrypto/crypto/getentropy_solaris.c b/src/lib/libcrypto/crypto/getentropy_solaris.c
index 4133d895fd..53ce742fac 100644
--- a/src/lib/libcrypto/crypto/getentropy_solaris.c
+++ b/src/lib/libcrypto/crypto/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}
diff --git a/src/lib/libcrypto/crypto/getentropy_win.c b/src/lib/libcrypto/crypto/getentropy_win.c
index da048ae157..2e89b12205 100644
--- a/src/lib/libcrypto/crypto/getentropy_win.c
+++ b/src/lib/libcrypto/crypto/getentropy_win.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: getentropy_win.c,v 1.3 2014/11/11 13:54:33 bcook Exp $ */ 1/* $OpenBSD: getentropy_win.c,v 1.4 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>
@@ -40,7 +40,7 @@ getentropy(void *buf, size_t len)
40 40
41 if (len > 256) { 41 if (len > 256) {
42 errno = EIO; 42 errno = EIO;
43 return -1; 43 return (-1);
44 } 44 }
45 45
46 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, 46 if (CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,