diff options
| author | bcook <> | 2014-07-20 20:51:13 +0000 |
|---|---|---|
| committer | bcook <> | 2014-07-20 20:51:13 +0000 |
| commit | e1e31280b22a03036aa16e7c3814eedfa8ce1be4 (patch) | |
| tree | 3cffc18607d7ee2f36193cbc2c6420f39f8d8d9f /src/lib/libcrypto/crypto/arc4random_win.h | |
| parent | 3aad488a05be3c0ef1e274428c9d2eb495714c70 (diff) | |
| download | openbsd-e1e31280b22a03036aa16e7c3814eedfa8ce1be4.tar.gz openbsd-e1e31280b22a03036aa16e7c3814eedfa8ce1be4.tar.bz2 openbsd-e1e31280b22a03036aa16e7c3814eedfa8ce1be4.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 | { |
