summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-11-07 13:28:16 +1100
committerDamien Miller <djm@mindrot.org>2013-11-07 13:28:16 +1100
commitdf8b030b15fcec7baf38ec7944f309f9ca8cc9a7 (patch)
tree70ae8223d81ef4a7692be0eb295ad5cf1b98aee7
parenta6fd1d3c38a562709374a70fa76423859160aa90 (diff)
downloadopenssh-git-df8b030b15fcec7baf38ec7944f309f9ca8cc9a7.tar.gz
- (djm) [configure.ac defines.h] Skip arc4random_stir() calls on platforms
that lack it but have arc4random_uniform()
-rw-r--r--ChangeLog2
-rw-r--r--configure.ac5
-rw-r--r--defines.h11
3 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2864e162..be1c1909 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 0611b71b..e545730d 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 f4b262c8..b014f349 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 */