From: stephentoub Date: Sat, 14 Nov 2015 14:16:04 +0000 (-0500) Subject: Use uuid_generate_random instead of uuid_generate in CoCreateGuid X-Git-Tag: accepted/tizen/base/20180629.140029~6151^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a69cb6bda747a4cf55acbfcc4f87b933d9027e36;p=platform%2Fupstream%2Fcoreclr.git Use uuid_generate_random instead of uuid_generate in CoCreateGuid The PAL implementation of CoCreateGuid is currently using uuid_generate. This will be based on high-quality randomness if available, otherwise it falls back to an algorithm that incorporates the local ethernet MAC address along with the current time and a pseudo-random generator. To avoid potential privacy issues, this commit switches to using uuid_generate_random, which instead falls back purely to a pseudo-random generator. --- diff --git a/src/pal/src/misc/miscpalapi.cpp b/src/pal/src/misc/miscpalapi.cpp index d225071..15cb741 100644 --- a/src/pal/src/misc/miscpalapi.cpp +++ b/src/pal/src/misc/miscpalapi.cpp @@ -353,10 +353,10 @@ PALAPI CoCreateGuid(OUT GUID * pguid) { #if HAVE_LIBUUID_H - uuid_generate(*(uuid_t*)pguid); + uuid_generate_random(*(uuid_t*)pguid); - // Change the byte order of the Data1, 2 and 3, since the uuid_generate generates them - // with big endian while GUIDS need to have them in little endian. + // Change the byte order of the Data1, 2 and 3, since the uuid_generate_random + // generates them with big endian while GUIDS need to have them in little endian. pguid->Data1 = SWAP32(pguid->Data1); pguid->Data2 = SWAP16(pguid->Data2); pguid->Data3 = SWAP16(pguid->Data3);