Changeset 189633 in webkit
- Timestamp:
- Sep 11, 2015 2:34:15 PM (9 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r189586 r189633 1 2 2015-09-11 Keith Miller <keith_miller@apple.com> 3 4 cryptographicallyRandomValuesFromOS should use CCRandomCopyBytes when available. 5 https://bugs.webkit.org/show_bug.cgi?id=148439 6 7 Reviewed by Alexey Proskuryakov. 8 9 Recently, we switched to using arc4random_buf on Darwin but further research indicates that 10 arc4random_buf has the same behavior we had before and thus we were just pushing the problem 11 further down the stack. CCRandomCopyBytes, however, appears to be more advanced and has much 12 better error handling than we had before. 13 14 * WTF.xcodeproj/project.pbxproj: 15 * wtf/OSRandomSource.cpp: 16 (WTF::cryptographicallyRandomValuesFromOS): 17 * wtf/spi/darwin/CommonCryptoSPI.h: Added. 18 1 19 2015-09-08 Filip Pizlo <fpizlo@apple.com> 2 20 -
trunk/Source/WTF/WTF.xcodeproj/project.pbxproj
r188677 r189633 279 279 CE46516E19DB1FB4003ECA05 /* NSMapTableSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */; }; 280 280 CE73E02519DCB7AB00580D5C /* XPCSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE73E02419DCB7AB00580D5C /* XPCSPI.h */; }; 281 DE5A09FC1BA36992003D4424 /* CommonCryptoSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */; }; 281 282 E15556F518A0CC18006F48FB /* CryptographicUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */; }; 282 283 E15556F618A0CC18006F48FB /* CryptographicUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = E15556F418A0CC18006F48FB /* CryptographicUtilities.h */; }; … … 576 577 CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSMapTableSPI.h; sourceTree = "<group>"; }; 577 578 CE73E02419DCB7AB00580D5C /* XPCSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCSPI.h; sourceTree = "<group>"; }; 579 DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; }; 578 580 E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptographicUtilities.cpp; sourceTree = "<group>"; }; 579 581 E15556F418A0CC18006F48FB /* CryptographicUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptographicUtilities.h; sourceTree = "<group>"; }; … … 1022 1024 isa = PBXGroup; 1023 1025 children = ( 1026 DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */, 1024 1027 CE73E02419DCB7AB00580D5C /* XPCSPI.h */, 1025 1028 ); … … 1191 1194 A8A47428151A825B004123FF /* StackBounds.h in Headers */, 1192 1195 FEDACD3E1630F83F00C69634 /* StackStats.h in Headers */, 1196 DE5A09FC1BA36992003D4424 /* CommonCryptoSPI.h in Headers */, 1193 1197 A8A47429151A825B004123FF /* StaticConstructors.h in Headers */, 1194 1198 A8A4742A151A825B004123FF /* StdLibExtras.h in Headers */, -
trunk/Source/WTF/wtf/OSRandomSource.cpp
r188489 r189633 41 41 #endif 42 42 43 #if OS(DARWIN) 44 #include "CommonCryptoSPI.h" 45 #endif 46 43 47 namespace WTF { 44 48 … … 58 62 { 59 63 #if OS(DARWIN) 60 return arc4random_buf(buffer, length);64 RELEASE_ASSERT(!CCRandomCopyBytes(kCCRandomDefault, buffer, length)); 61 65 #elif OS(UNIX) 62 66 int fd = open("/dev/urandom", O_RDONLY, 0);
Note: See TracChangeset
for help on using the changeset viewer.