Index: external/mit/libICE/dist/src/iceauth.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/libICE/dist/src/iceauth.c,v retrieving revision 1.1.1.3 diff -p -u -u -r1.1.1.3 iceauth.c --- external/mit/libICE/dist/src/iceauth.c 21 Nov 2010 05:47:12 -0000 1.1.1.3 +++ external/mit/libICE/dist/src/iceauth.c 7 Mar 2017 07:06:46 -0000 @@ -36,6 +36,10 @@ Author: Ralph Mor, X Consortium #include #define Time_t time_t +#ifdef HAVE_LIBBSD +#include /* for arc4random_buf() */ +#endif + static int was_called_state; /* @@ -50,14 +54,19 @@ IceGenerateMagicCookie ( ) { char *auth; +#ifndef HAVE_ARC4RANDOM_BUF long ldata[2]; int seed; int value; int i; +#endif if ((auth = (char *) malloc (len + 1)) == NULL) return (NULL); +#ifdef HAVE_ARC4RANDOM_BUF + arc4random_buf(auth, len); +#else #ifdef ITIMER_REAL { struct timeval now; @@ -81,8 +90,8 @@ IceGenerateMagicCookie ( value = rand (); auth[i] = value & 0xff; } +#endif auth[len] = '\0'; - return (auth); } Index: xfree/xc/lib/ICE/iceauth.c =================================================================== RCS file: /cvsroot/xsrc/xfree/xc/lib/ICE/Attic/iceauth.c,v retrieving revision 1.1.1.5 diff -p -u -u -r1.1.1.5 iceauth.c --- xfree/xc/lib/ICE/iceauth.c 28 Feb 2003 13:18:45 -0000 1.1.1.5 +++ xfree/xc/lib/ICE/iceauth.c 7 Mar 2017 07:06:46 -0000 @@ -37,6 +37,10 @@ Author: Ralph Mor, X Consortium static int binaryEqual (); +#ifdef HAVE_LIBBSD +#include /* for arc4random_buf() */ +#endif + static int was_called_state; /* @@ -52,14 +56,19 @@ int len; { char *auth; +#ifndef HAVE_ARC4RANDOM_BUF long ldata[2]; int seed; int value; int i; +#endif if ((auth = (char *) malloc (len + 1)) == NULL) return (NULL); +#ifdef HAVE_ARC4RANDOM_BUF + arc4random_buf(auth, len); +#else #ifdef ITIMER_REAL { struct timeval now; @@ -83,8 +92,8 @@ int len; value = rand (); auth[i] = value & 0xff; } +#endif auth[len] = '\0'; - return (auth); }