From f34324d947b29b5a35a325bbd3901294355b4f39 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/libc/crypt/arc4random.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lib/libc/crypt/arc4random.c') diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c index 3c80beb3b9..e4b6369bf1 100644 --- a/src/lib/libc/crypt/arc4random.c +++ b/src/lib/libc/crypt/arc4random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.48 2014/07/19 00:08:41 deraadt Exp $ */ +/* $OpenBSD: arc4random.c,v 1.49 2014/07/20 20:51:13 bcook Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -32,9 +32,6 @@ #include #include #include -#include - -#include "thread_private.h" #define KEYSTREAM_ONLY #include "chacha_private.h" @@ -90,7 +87,7 @@ _rs_stir(void) u_char rnd[KEYSZ + IVSZ]; if (getentropy(rnd, sizeof rnd) == -1) - raise(SIGKILL); + _getentropy_fail(); if (!rs) _rs_init(rnd, sizeof(rnd)); -- cgit v1.2.3-55-g6feb