View | Details | Raw Unified | Return to bug 1025084
Collapse All | Expand All

(-)xorg-server-1.19.3.old/configure.ac (-1 / +1 lines)
Lines 226-232 Link Here
226
AM_CONDITIONAL(POLL, [test "x$ac_cv_func_poll" = "xyes"])
226
AM_CONDITIONAL(POLL, [test "x$ac_cv_func_poll" = "xyes"])
227
227
228
AC_CHECK_LIB([bsd], [arc4random_buf])
228
AC_CHECK_LIB([bsd], [arc4random_buf])
229
AC_CHECK_FUNCS([arc4random_buf])
229
AC_CHECK_FUNCS([arc4random_buf getentropy])
230
230
231
AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
231
AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
232
232
(-)xorg-server-1.19.3.old/include/dix-config.h.in (+3 lines)
Lines 167-172 Link Here
167
/* Define to 1 if you have the `arc4random_buf' function. */
167
/* Define to 1 if you have the `arc4random_buf' function. */
168
#undef HAVE_ARC4RANDOM_BUF
168
#undef HAVE_ARC4RANDOM_BUF
169
169
170
/* Define to 1 if you have the `getentropy' function. */
171
#undef HAVE_GETENTROPY
172
170
/* Define to use libc SHA1 functions */
173
/* Define to use libc SHA1 functions */
171
#undef HAVE_SHA1_IN_LIBC
174
#undef HAVE_SHA1_IN_LIBC
172
175
(-)xorg-server-1.19.3.old/os/auth.c (-6 / +32 lines)
Lines 302-319 Link Here
302
    return -1;
302
    return -1;
303
}
303
}
304
304
305
void
305
#ifndef HAVE_ARC4RANDOM_BUF
306
GenerateRandomData(int len, char *buf)
306
307
static void
308
emulate_getrandom_buf (
309
	char *auth,
310
	int len
311
)
307
{
312
{
308
#ifdef HAVE_ARC4RANDOM_BUF
309
    arc4random_buf(buf, len);
310
#else
311
    int fd;
313
    int fd;
312
314
313
    fd = open("/dev/urandom", O_RDONLY);
315
    fd = open("/dev/urandom", O_RDONLY);
314
    read(fd, buf, len);
316
    read(fd, buf, len);
315
    close(fd);
317
    close(fd);
316
#endif
318
}
319
320
static void
321
arc4random_buf (
322
	char *auth,
323
	int len
324
)
325
{
326
    int            ret;
327
328
#if HAVE_GETENTROPY
329
    /* weak emulation of arc4random through the entropy libc */
330
    ret = getentropy (auth, len);
331
    if (ret == 0)
332
	return;
333
#endif /* HAVE_GETENTROPY */
334
335
    emulate_getrandom_buf (auth, len);
336
}
337
#endif /* !defined(HAVE_ARC4RANDOM_BUF) */
338
339
void
340
GenerateRandomData(int len, char *buf)
341
{
342
    arc4random_buf(buf, len);
317
}
343
}
318
344
319
#endif                          /* XCSECURITY */
345
#endif                          /* XCSECURITY */

Return to bug 1025084