diff options
author | bcook <> | 2014-07-20 20:51:13 +0000 |
---|---|---|
committer | bcook <> | 2014-07-20 20:51:13 +0000 |
commit | f34324d947b29b5a35a325bbd3901294355b4f39 (patch) | |
tree | 3cffc18607d7ee2f36193cbc2c6420f39f8d8d9f /src/lib/libc/crypt/arc4random.h | |
parent | 6f021fc4705d719c57993c7f3e916ed71f4480eb (diff) | |
download | openbsd-f34324d947b29b5a35a325bbd3901294355b4f39.tar.gz openbsd-f34324d947b29b5a35a325bbd3901294355b4f39.tar.bz2 openbsd-f34324d947b29b5a35a325bbd3901294355b4f39.zip |
Move more OS-specific functionality to arc4random.h headers.
Move <sys/mman.h> and raise(SIGKILL) calls to OS-specific headers.
On OpenBSD, move thread_private.h as well to arc4random.h.
On Windows, use TerminateProcess on getentropy failure.
ok deraadt@
Diffstat (limited to 'src/lib/libc/crypt/arc4random.h')
-rw-r--r-- | src/lib/libc/crypt/arc4random.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libc/crypt/arc4random.h b/src/lib/libc/crypt/arc4random.h index d867687226..d29873cca4 100644 --- a/src/lib/libc/crypt/arc4random.h +++ b/src/lib/libc/crypt/arc4random.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random.h,v 1.2 2014/07/19 00:08:41 deraadt Exp $ */ | 1 | /* $OpenBSD: arc4random.h,v 1.3 2014/07/20 20:51:13 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> |
@@ -21,6 +21,17 @@ | |||
21 | /* | 21 | /* |
22 | * Stub functions for portability. | 22 | * Stub functions for portability. |
23 | */ | 23 | */ |
24 | #include <sys/mman.h> | ||
25 | |||
26 | #include <signal.h> | ||
27 | |||
28 | #include "thread_private.h" | ||
29 | |||
30 | static inline void | ||
31 | _getentropy_fail(void) | ||
32 | { | ||
33 | raise(SIGKILL); | ||
34 | } | ||
24 | 35 | ||
25 | static inline int | 36 | static inline int |
26 | _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) | 37 | _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) |