Changeset 78149 in webkit
- Timestamp:
- Feb 9, 2011 3:11:56 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/Android.mk
r77391 r78149 162 162 wtf/Assertions.cpp \ 163 163 wtf/ByteArray.cpp \ 164 wtf/CryptographicallyRandomNumber.cpp \ 164 165 wtf/CurrentTime.cpp \ 165 166 wtf/DateMath.cpp \ … … 168 169 wtf/HashTable.cpp \ 169 170 wtf/MainThread.cpp \ 171 wtf/OSRandomSource.cpp \ 170 172 wtf/PageAllocationAligned.cpp\ 171 173 wtf/PageBlock.cpp\ 172 174 wtf/RandomNumber.cpp \ 173 175 wtf/RefCountedLeakCounter.cpp \ 174 176 wtf/StackBounds.cpp \ 175 177 wtf/TCSystemAlloc.cpp \ 176 178 wtf/ThreadIdentifierDataPthreads.cpp \ -
trunk/Source/JavaScriptCore/Android.v8.wtf.mk
r74360 r78149 35 35 wtf/Assertions.cpp \ 36 36 wtf/ByteArray.cpp \ 37 wtf/CryptographicallyRandomNumber.cpp \ 37 38 wtf/CurrentTime.cpp \ 38 39 wtf/DateMath.cpp \ … … 41 42 wtf/HashTable.cpp \ 42 43 wtf/MainThread.cpp \ 44 wtf/OSRandomSource.cpp \ 43 45 wtf/RandomNumber.cpp \ 44 46 wtf/RefCountedLeakCounter.cpp \ 45 47 wtf/StackBounds.cpp \ 46 48 wtf/TCSystemAlloc.cpp \ 47 49 wtf/ThreadIdentifierDataPthreads.cpp \ -
trunk/Source/JavaScriptCore/ChangeLog
r78108 r78149 1 2011-02-09 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Add WTF::cryptographicallyRandomNumber 6 https://bugs.webkit.org/show_bug.cgi?id=54083 7 8 Introduce a cryptographically strong random number generator to WTF. 9 The random number generator is based on arc4random as found in: 10 11 http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/crypt/arc4random.c?rev=1.22 12 13 I've changed to source to WebKit style and abstracted the operating 14 system interaction to OSRandomSource. We'll use this functionality to 15 expose a cryptographically strong random number generator to 16 JavaScript. 17 18 * Android.mk: 19 * Android.v8.wtf.mk: 20 * GNUmakefile.am: 21 * JavaScriptCore.gypi: 22 * JavaScriptCore.vcproj/WTF/WTF.vcproj: 23 * JavaScriptCore.xcodeproj/project.pbxproj: 24 * config.h: 25 * wtf/CMakeLists.txt: 26 * wtf/CryptographicallyRandomNumber.cpp: Added. 27 (WTF::initMutexIfNeeded): 28 (WTF::init): 29 (WTF::addRandomData): 30 (WTF::stir): 31 (WTF::stirIfNeeded): 32 (WTF::getByte): 33 (WTF::getWord): 34 (WTF::cryptographicallyRandomNumber): 35 (WTF::cryptographicallyRandomValues): 36 * wtf/CryptographicallyRandomNumber.h: Added. 37 * wtf/OSRandomSource.cpp: Added. 38 (WTF::randomValuesFromOS): 39 * wtf/OSRandomSource.h: Added. 40 * wtf/wtf.pri: 41 1 42 2011-02-09 Geoffrey Garen <ggaren@apple.com> 2 43 -
trunk/Source/JavaScriptCore/GNUmakefile.am
r77785 r78149 444 444 Source/JavaScriptCore/wtf/ByteArray.h \ 445 445 Source/JavaScriptCore/wtf/CrossThreadRefCounted.h \ 446 Source/JavaScriptCore/wtf/CryptographicallyRandomNumber.cpp \ 447 Source/JavaScriptCore/wtf/CryptographicallyRandomNumber.h \ 446 448 Source/JavaScriptCore/wtf/CurrentTime.cpp \ 447 449 Source/JavaScriptCore/wtf/CurrentTime.h \ … … 492 494 Source/JavaScriptCore/wtf/NullPtr.h \ 493 495 Source/JavaScriptCore/wtf/OSAllocator.h \ 496 Source/JavaScriptCore/wtf/OSRandomSource.cpp \ 497 Source/JavaScriptCore/wtf/OSRandomSource.h \ 494 498 Source/JavaScriptCore/wtf/OwnArrayPtr.h \ 495 499 Source/JavaScriptCore/wtf/OwnFastMallocPtr.h \ -
trunk/Source/JavaScriptCore/JavaScriptCore.gypi
r78042 r78149 375 375 'wtf/chromium/MainThreadChromium.cpp', 376 376 'wtf/CrossThreadRefCounted.h', 377 'wtf/CryptographicallyRandomNumber.cpp', 378 'wtf/CryptographicallyRandomNumber.h', 377 379 'wtf/CurrentTime.cpp', 378 380 'wtf/CurrentTime.h', … … 417 419 'wtf/OSAllocatorWin.cpp', 418 420 'wtf/OSAllocator.h', 421 'wtf/OSRandomSource.cpp', 422 'wtf/OSRandomSource.h', 419 423 'wtf/OwnArrayPtr.h', 420 424 'wtf/OwnFastMallocPtr.h', -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
r77785 r78149 562 562 </File> 563 563 <File 564 RelativePath="..\..\wtf\CryptographicallyRandomNumber.cpp" 565 > 566 </File> 567 <File 568 RelativePath="..\..\wtf\CryptographicallyRandomNumber.h" 569 > 570 </File> 571 <File 564 572 RelativePath="..\..\wtf\CurrentTime.cpp" 565 573 > … … 754 762 </File> 755 763 <File 764 RelativePath="..\..\wtf\OSRandomSource.cpp" 765 > 766 </File> 767 <File 768 RelativePath="..\..\wtf\OSRandomSource.h" 769 > 770 </File> 771 <File 756 772 RelativePath="..\..\wtf\OwnArrayPtr.h" 757 773 > -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r78042 r78149 339 339 972A485F12661E0800F4514F /* URLCharacterTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 972A485D12661E0800F4514F /* URLCharacterTypes.cpp */; }; 340 340 972A48771266256F00F4514F /* URLEscape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 972A48741266256F00F4514F /* URLEscape.cpp */; }; 341 97941A5713029AAB004A3447 /* OSRandomSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97941A3F130299DB004A3447 /* OSRandomSource.cpp */; }; 342 97941A5A13029ACC004A3447 /* OSRandomSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 97941A40130299DB004A3447 /* OSRandomSource.h */; }; 343 97941A7E1302A098004A3447 /* CryptographicallyRandomNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97941A7C1302A098004A3447 /* CryptographicallyRandomNumber.cpp */; }; 344 97941A7F1302A098004A3447 /* CryptographicallyRandomNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 97941A7D1302A098004A3447 /* CryptographicallyRandomNumber.h */; }; 341 345 A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; }; 342 346 A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1007 1011 972A48751266256F00F4514F /* URLEscape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URLEscape.h; path = url/src/URLEscape.h; sourceTree = "<group>"; }; 1008 1012 972A48761266256F00F4514F /* URLQueryCanonicalizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URLQueryCanonicalizer.h; path = url/src/URLQueryCanonicalizer.h; sourceTree = "<group>"; }; 1013 97941A3F130299DB004A3447 /* OSRandomSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OSRandomSource.cpp; sourceTree = "<group>"; }; 1014 97941A40130299DB004A3447 /* OSRandomSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OSRandomSource.h; sourceTree = "<group>"; }; 1015 97941A7C1302A098004A3447 /* CryptographicallyRandomNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptographicallyRandomNumber.cpp; sourceTree = "<group>"; }; 1016 97941A7D1302A098004A3447 /* CryptographicallyRandomNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptographicallyRandomNumber.h; sourceTree = "<group>"; }; 1009 1017 97F6903A1169DF7F00A6BB46 /* Terminator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminator.h; sourceTree = "<group>"; }; 1010 1018 A1712B3A11C7B212007A5315 /* RegExpCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCache.cpp; sourceTree = "<group>"; }; … … 1538 1546 FDA15C1612B03028003A583A /* Complex.h */, 1539 1547 0BDFFAD40FC6171000D69EF4 /* CrossThreadRefCounted.h */, 1548 97941A7C1302A098004A3447 /* CryptographicallyRandomNumber.cpp */, 1549 97941A7D1302A098004A3447 /* CryptographicallyRandomNumber.h */, 1540 1550 180B9AEF0F16C569009BDBC5 /* CurrentTime.cpp */, 1541 1551 180B9AF00F16C569009BDBC5 /* CurrentTime.h */, … … 1580 1590 1400067612A6F7830064D123 /* OSAllocator.h */, 1581 1591 1400069212A6F9E10064D123 /* OSAllocatorPosix.cpp */, 1592 97941A3F130299DB004A3447 /* OSRandomSource.cpp */, 1593 97941A40130299DB004A3447 /* OSRandomSource.h */, 1582 1594 9303F5A409911A5800AD71B8 /* OwnArrayPtr.h */, 1583 1595 0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */, … … 2445 2457 14C824AD12F7C785008F35E0 /* MarkedBlock.h in Headers */, 2446 2458 E4D8CEFB12FC439600BC9F5A /* BloomFilter.h in Headers */, 2459 97941A5A13029ACC004A3447 /* OSRandomSource.h in Headers */, 2460 97941A7F1302A098004A3447 /* CryptographicallyRandomNumber.h in Headers */, 2447 2461 ); 2448 2462 runOnlyForDeploymentPostprocessing = 0; … … 2914 2928 E49DC16B12EF293E00184A1F /* SourceProviderCache.cpp in Sources */, 2915 2929 14C824AB12F7C77E008F35E0 /* MarkedBlock.cpp in Sources */, 2930 97941A5713029AAB004A3447 /* OSRandomSource.cpp in Sources */, 2931 97941A7E1302A098004A3447 /* CryptographicallyRandomNumber.cpp in Sources */, 2916 2932 ); 2917 2933 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/JavaScriptCore/config.h
r59537 r78149 53 53 #ifndef _CRT_RAND_S 54 54 #define _CRT_RAND_S 55 #define WTF_USE_OS_RANDOMNESS 1 55 56 #endif 56 57 #endif 57 58 59 #endif 60 61 #if OS(DARWIN) || OS(UNIX) 62 #define WTF_USE_OS_RANDOMNESS 1 58 63 #endif 59 64 -
trunk/Source/JavaScriptCore/wtf/CMakeLists.txt
r77785 r78149 10 10 Complex.h 11 11 CrossThreadRefCounted.h 12 CryptographicallyRandomNumber.h 12 13 CurrentTime.h 13 14 DateMath.h … … 42 43 NullPtr.h 43 44 OSAllocator.h 45 OSRandomSource.h 44 46 OwnArrayPtr.h 45 47 OwnFastMallocPtr.h … … 104 106 Assertions.cpp 105 107 ByteArray.cpp 108 CryptographicallyRandomNumber.cpp 106 109 CurrentTime.cpp 107 110 DecimalNumber.cpp … … 110 113 MainThread.cpp 111 114 MD5.cpp 115 OSRandomSource.cpp 112 116 RandomNumber.cpp 113 117 RefCountedLeakCounter.cpp -
trunk/Source/JavaScriptCore/wtf/wtf.pri
r76716 r78149 4 4 wtf/Assertions.cpp \ 5 5 wtf/ByteArray.cpp \ 6 wtf/CryptographicallyRandomNumber.cpp \ 6 7 wtf/CurrentTime.cpp \ 7 8 wtf/DateMath.cpp \ … … 15 16 wtf/MainThread.cpp \ 16 17 wtf/NullPtr.cpp \ 18 wtf/OSRandomSource.cpp \ 17 19 wtf/qt/MainThreadQt.cpp \ 18 20 wtf/qt/StringQt.cpp \
Note: See TracChangeset
for help on using the changeset viewer.