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/libcrypto/crypto/arc4random_win.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/libcrypto/crypto/arc4random_win.h')
-rw-r--r-- | src/lib/libcrypto/crypto/arc4random_win.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libcrypto/crypto/arc4random_win.h b/src/lib/libcrypto/crypto/arc4random_win.h index 1e044de109..b7a5a36013 100644 --- a/src/lib/libcrypto/crypto/arc4random_win.h +++ b/src/lib/libcrypto/crypto/arc4random_win.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: arc4random_win.h,v 1.3 2014/07/20 16:59:31 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_win.h,v 1.4 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> |
@@ -42,6 +42,12 @@ static volatile HANDLE arc4random_mtx = NULL; | |||
42 | 42 | ||
43 | #define _ARC4_UNLOCK() ReleaseMutex(arc4random_mtx) | 43 | #define _ARC4_UNLOCK() ReleaseMutex(arc4random_mtx) |
44 | 44 | ||
45 | static inline void | ||
46 | _getentropy_fail(void) | ||
47 | { | ||
48 | TerminateProcess(GetCurrentProcess(), 0); | ||
49 | } | ||
50 | |||
45 | static inline int | 51 | static inline int |
46 | _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) | 52 | _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) |
47 | { | 53 | { |