Changeset 126953 in webkit


Ignore:
Timestamp:
Aug 28, 2012 8:53:53 PM (12 years ago)
Author:
abarth@webkit.org
Message:

crypto.getRandomValues should throw an exception when given a big array
https://bugs.webkit.org/show_bug.cgi?id=95269

Reviewed by Eric Seidel.

Source/WebCore:

The W3C Web Cryptography Working Group has taken up specifying
window.crypto. The latest draft calls for getRandomValues to throw an
exception when given an array that's large.

Test: security/crypto-random-values-limits.html

  • page/Crypto.cpp:

(WebCore::Crypto::getRandomValues):

LayoutTests:

  • security/crypto-random-values-limits-expected.txt: Added.
  • security/crypto-random-values-limits.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r126947 r126953  
     12012-08-28  Adam Barth  <abarth@webkit.org>
     2
     3        crypto.getRandomValues should throw an exception when given a big array
     4        https://bugs.webkit.org/show_bug.cgi?id=95269
     5
     6        Reviewed by Eric Seidel.
     7
     8        * security/crypto-random-values-limits-expected.txt: Added.
     9        * security/crypto-random-values-limits.html: Added.
     10
    1112012-08-28  Tom Sepez  <tsepez@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r126947 r126953  
     12012-08-28  Adam Barth  <abarth@webkit.org>
     2
     3        crypto.getRandomValues should throw an exception when given a big array
     4        https://bugs.webkit.org/show_bug.cgi?id=95269
     5
     6        Reviewed by Eric Seidel.
     7
     8        The W3C Web Cryptography Working Group has taken up specifying
     9        window.crypto. The latest draft calls for getRandomValues to throw an
     10        exception when given an array that's large.
     11
     12        Test: security/crypto-random-values-limits.html
     13
     14        * page/Crypto.cpp:
     15        (WebCore::Crypto::getRandomValues):
     16
    1172012-08-28  Tom Sepez  <tsepez@chromium.org>
    218
  • trunk/Source/WebCore/page/Crypto.cpp

    r123819 r126953  
    6464        return;
    6565    }
     66    if (array->byteLength() > 65536) {
     67        ec = QUOTA_EXCEEDED_ERR;
     68        return;
     69    }
    6670    cryptographicallyRandomValues(array->baseAddress(), array->byteLength());
    6771#else
Note: See TracChangeset for help on using the changeset viewer.