diff --git a/configure.ac b/configure.ac index 85cfff1c7..eb51c7119 100644 --- a/configure.ac +++ b/configure.ac @@ -176,19 +176,6 @@ dnl has it in libc), or if libdl is needed to get it. AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) -case $host_os in - linux*|darwin*) - AC_DEFINE(HAVE_URANDOM, 1, [Has /dev/urandom]) ;; - freebsd*|netbsd*|openbsd*|dragonfly*) - AC_DEFINE(HAVE_URANDOM, 1, [Has /dev/urandom]) ;; - solaris*) - # Solaris 8 with patches, or Solaris 9 or later have /dev/urandom - if test -r /dev/urandom ; then - AC_DEFINE(HAVE_URANDOM, 1, [Has /dev/urandom]) - fi ;; - *) ;; -esac - dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \ diff --git a/os/auth.c b/os/auth.c index dab4f60bd..a852e1c3b 100644 --- a/os/auth.c +++ b/os/auth.c @@ -314,8 +314,6 @@ GenerateAuthorization( return -1; } -#ifdef HAVE_URANDOM - void GenerateRandomData (int len, char *buf) { @@ -326,45 +324,4 @@ GenerateRandomData (int len, char *buf) close(fd); } -#else /* !HAVE_URANDOM */ - -/* A random number generator that is more unpredictable - than that shipped with some systems. - This code is taken from the C standard. */ - -static unsigned long int next = 1; - -static int -xdm_rand(void) -{ - next = next * 1103515245 + 12345; - return (unsigned int)(next/65536) % 32768; -} - -static void -xdm_srand(unsigned int seed) -{ - next = seed; -} - -void -GenerateRandomData (int len, char *buf) -{ - static int seed; - int value; - int i; - - seed += GetTimeInMillis(); - xdm_srand (seed); - for (i = 0; i < len; i++) - { - value = xdm_rand (); - buf[i] ^= (value & 0xff00) >> 8; - } - - /* XXX add getrusage, popen("ps -ale") */ -} - -#endif /* HAVE_URANDOM */ - #endif /* XCSECURITY */