From 64eebb5eeb9556dab6f16757f7e836e4846b15d6 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 23 Feb 2010 05:57:53 +0000 Subject: Enabled XCSECURITY --- include/dix-config.h | 2 +- xorg-server/os/auth.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/dix-config.h b/include/dix-config.h index 8f5aab905..53cbd31ba 100644 --- a/include/dix-config.h +++ b/include/dix-config.h @@ -357,7 +357,7 @@ #define XCMISC 1 /* Build Security extension */ -#undef XCSECURITY +#define XCSECURITY 1 /* Support Xdmcp */ #define XDMCP 1 diff --git a/xorg-server/os/auth.c b/xorg-server/os/auth.c index a852e1c3b..0514d1788 100644 --- a/xorg-server/os/auth.c +++ b/xorg-server/os/auth.c @@ -317,11 +317,23 @@ GenerateAuthorization( void GenerateRandomData (int len, char *buf) { +#ifdef _MSC_VER + static HANDLE hAdvApi32; + static BOOLEAN (_stdcall * RtlGenRandom)(void *,unsigned long); + + if (!hAdvApi32) + { + hAdvApi32=LoadLibrary("advapi32.dll"); + RtlGenRandom=(BOOLEAN (_stdcall *)(void*,unsigned long))GetProcAddress(hAdvApi32,"SystemFunction036"); + } + RtlGenRandom(buf, len); +#else int fd; fd = open("/dev/urandom", O_RDONLY); read(fd, buf, len); close(fd); +#endif } #endif /* XCSECURITY */ -- cgit v1.2.3