From df8b030b15fcec7baf38ec7944f309f9ca8cc9a7 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 7 Nov 2013 13:28:16 +1100 Subject: [PATCH] - (djm) [configure.ac defines.h] Skip arc4random_stir() calls on platforms that lack it but have arc4random_uniform() --- ChangeLog | 2 ++ configure.ac | 5 +++-- defines.h | 11 ++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2864e1623..be1c19090 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ that got lost in recent merge. - (djm) [Makefile.in monitor.c] Missed chunks of curve25519 KEX diff - (djm) [regress/modpipe.c regress/rekey.sh] Never intended to commit these + - (djm) [configure.ac defines.h] Skip arc4random_stir() calls on platforms + that lack it but have arc4random_uniform() 20131104 - (djm) OpenBSD CVS Sync diff --git a/configure.ac b/configure.ac index 0611b71b9..e545730d7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.537 2013/11/03 07:43:55 dtucker Exp $ +# $Id: configure.ac,v 1.538 2013/11/07 02:28:16 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.537 $) +AC_REVISION($Revision: 1.538 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -1528,6 +1528,7 @@ dnl Checks for library functions. Please keep in alphabetical order AC_CHECK_FUNCS([ \ arc4random \ arc4random_buf \ + arc4random_stir \ arc4random_uniform \ asprintf \ b64_ntop \ diff --git a/defines.h b/defines.h index f4b262c82..b014f349b 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.173 2013/11/03 07:43:55 dtucker Exp $ */ +/* $Id: defines.h,v 1.174 2013/11/07 02:28:16 djm Exp $ */ /* Constants */ @@ -810,4 +810,13 @@ struct winsize { # endif #endif +/* + * Platforms that have arc4random_uniform() and not arc4random_stir() + * shouldn't need the latter. + */ +#if defined(HAVE_ARC4RANDOM) && defined(HAVE_ARC4RANDOM_UNIFORM) && \ + !defined(HAVE_ARC4RANDOM_STIR) +# define arc4random_stir() +#endif + #endif /* _DEFINES_H */