Changeset 78422 in webkit
- Timestamp:
- Feb 12, 2011 2:13:15 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r78416 r78422 1 2011-02-12 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Sam Weinig. 4 5 crypto.getRandomValues should support all integer array types 6 https://bugs.webkit.org/show_bug.cgi?id=54342 7 8 Test which types of arrays work with crypto.getRandomValues. 9 10 * security/crypto-random-values-types-expected.txt: Added. 11 * security/crypto-random-values-types.html: Added. 12 1 13 2011-02-12 Jochen Eisinger <jochen@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r78421 r78422 1 2011-02-12 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Sam Weinig. 4 5 crypto.getRandomValues should support all integer array types 6 https://bugs.webkit.org/show_bug.cgi?id=54342 7 8 As discussed on whatwg, we should support all the integer array types. 9 10 Test: security/crypto-random-values-types.html 11 12 * page/Crypto.cpp: 13 (WebCore::Crypto::getRandomValues): 14 1 15 2011-02-12 Adam Barth <abarth@webkit.org> 2 16 -
trunk/Source/WebCore/page/Crypto.cpp
r78407 r78422 35 35 #include <wtf/CryptographicallyRandomNumber.h> 36 36 37 namespace WebCore { 37 38 38 namespace WebCore { 39 namespace { 40 41 bool isIntegerArray(ArrayBufferView* array) 42 { 43 return array->isByteArray() 44 || array->isUnsignedByteArray() 45 || array->isShortArray() 46 || array->isUnsignedShortArray() 47 || array->isIntArray() 48 || array->isUnsignedIntArray(); 49 } 50 51 } 39 52 40 53 Crypto::Crypto() … … 45 58 { 46 59 #if USE(OS_RANDOMNESS) 47 if (!array || ! array->isUnsignedByteArray()) {60 if (!array || !isIntegerArray(array)) { 48 61 ec = VALIDATION_ERR; 49 62 return;
Note: See TracChangeset
for help on using the changeset viewer.