This patch removes calls to getentropy() and BCryptGetRandom() because they aren't implemented or supported on certain platforms based on the trybot results I saw. I will try upstreaming a configure script flag soon to replace this patch file. This patch is safe because it reverts the random number generation behavior before a recent libxml upstream patch. diff --git a/dict.c b/dict.c index ccd8b542..6273437e 100644 --- a/dict.c +++ b/dict.c @@ -928,13 +928,8 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) { #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include - #include -#elif HAVE_DECL_GETENTROPY - #include - #include -#else - #include #endif +#include static xmlMutex xmlRngMutex; @@ -951,25 +946,6 @@ xmlInitRandom(void) { xmlInitMutex(&xmlRngMutex); { -#ifdef _WIN32 - NTSTATUS status; - - status = BCryptGenRandom(NULL, (unsigned char *) globalRngState, - sizeof(globalRngState), - BCRYPT_USE_SYSTEM_PREFERRED_RNG); - if (!BCRYPT_SUCCESS(status)) - xmlAbort("libxml2: BCryptGenRandom failed with error code %lu\n", - GetLastError()); -#elif HAVE_DECL_GETENTROPY - while (1) { - if (getentropy(globalRngState, sizeof(globalRngState)) == 0) - break; - - if (errno != EINTR) - xmlAbort("libxml2: getentropy failed with error code %d\n", - errno); - } -#else int var; globalRngState[0] = @@ -978,7 +954,6 @@ xmlInitRandom(void) { globalRngState[1] = HASH_ROL((unsigned) ((size_t) &xmlRngMutex & 0xFFFFFFFF), 16) ^ HASH_ROL((unsigned) ((size_t) &var & 0xFFFFFFFF), 24); -#endif } }