From e1e31280b22a03036aa16e7c3814eedfa8ce1be4 Mon Sep 17 00:00:00 2001 From: bcook <> Date: Sun, 20 Jul 2014 20:51:13 +0000 Subject: Move more OS-specific functionality to arc4random.h headers. Move 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@ --- src/lib/libcrypto/crypto/arc4random_osx.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/crypto/arc4random_osx.h') diff --git a/src/lib/libcrypto/crypto/arc4random_osx.h b/src/lib/libcrypto/crypto/arc4random_osx.h index aacbef9aae..c14e044fe2 100644 --- a/src/lib/libcrypto/crypto/arc4random_osx.h +++ b/src/lib/libcrypto/crypto/arc4random_osx.h @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random_osx.h,v 1.6 2014/07/19 15:29:25 bcook Exp $ */ +/* $OpenBSD: arc4random_osx.h,v 1.7 2014/07/20 20:51:13 bcook Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -22,7 +22,10 @@ * Stub functions for portability. */ +#include + #include +#include static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) @@ -30,6 +33,12 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; #define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f)) +static inline void +_getentropy_fail(void) +{ + raise(SIGKILL); +} + static volatile sig_atomic_t _rs_forked; static inline void -- cgit v1.2.3-55-g6feb