1. 31 Oct, 2013 1 commit
    • ap@apple.com's avatar
      Enable WebCrypto on Mac · 13a73330
      ap@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=123587
      
      Reviewed by Anders Carlsson.
      
      Source/JavaScriptCore:
      
      * Configurations/FeatureDefines.xcconfig: Do it.
      
      Source/WebCore:
      
      * Configurations/FeatureDefines.xcconfig: Enable it.
      
      * bindings/js/JSCryptoAlgorithmDictionary.cpp: Build fix.
      
      * crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::getIdentifierForName):
      Special case empty keys to avoid upsetting HashMap.
      
      * crypto/algorithms/CryptoAlgorithmSHA1.cpp: (WebCore::CryptoAlgorithmSHA1::create):
      Build fix. Can't use make_unique, because constructor is private.
      
      Source/WebKit/mac:
      
      * Configurations/FeatureDefines.xcconfig: Do it.
      
      Source/WebKit2:
      
      * Configurations/FeatureDefines.xcconfig: Do it.
      
      LayoutTests:
      
      * TestExpectations:
      * platform/efl/TestExpectations:
      * platform/gtk/TestExpectations:
      * platform/win/TestExpectations:
      * platform/wincairo/TestExpectations:
      Only skipping on specific platforms now.
      
      * crypto: Added.
      * crypto/crypto-gc-expected.txt: Copied from LayoutTests/security/crypto-gc-expected.txt.
      * crypto/crypto-gc.html: Copied from LayoutTests/security/crypto-gc.html.
      * crypto/crypto-random-values-expected.txt: Copied from LayoutTests/security/crypto-random-values-expected.txt.
      * crypto/crypto-random-values-limits-expected.txt: Copied from LayoutTests/security/crypto-random-values-limits-expected.txt.
      * crypto/crypto-random-values-limits.html: Copied from LayoutTests/security/crypto-random-values-limits.html.
      * crypto/crypto-random-values-types-expected.txt: Copied from LayoutTests/security/crypto-random-values-types-expected.txt.
      * crypto/crypto-random-values-types.html: Copied from LayoutTests/security/crypto-random-values-types.html.
      * crypto/crypto-random-values.html: Copied from LayoutTests/security/crypto-random-values.html.
      * crypto/subtle: Added.
      * crypto/subtle/argument-conversion-expected.txt: Copied from LayoutTests/security/crypto-subtle-arguments-expected.txt.
      * crypto/subtle/argument-conversion.html: Copied from LayoutTests/security/crypto-subtle-arguments.html.
      * crypto/subtle/gc-2-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-2-expected.txt.
      * crypto/subtle/gc-2.html: Copied from LayoutTests/security/crypto-subtle-gc-2.html.
      * crypto/subtle/gc-3-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-3-expected.txt.
      * crypto/subtle/gc-3.html: Copied from LayoutTests/security/crypto-subtle-gc-3.html.
      * crypto/subtle/gc-expected.txt: Copied from LayoutTests/security/crypto-subtle-gc-expected.txt.
      * crypto/subtle/gc.html: Copied from LayoutTests/security/crypto-subtle-gc.html.
      * crypto/subtle/resources: Added.
      * crypto/subtle/resources/common.js: Copied from LayoutTests/security/resources/common.js.
      * crypto/subtle/sha-1-expected.txt: Copied from LayoutTests/security/crypto-subtle-sha1-expected.txt.
      * crypto/subtle/sha-1.html: Copied from LayoutTests/security/crypto-subtle-sha1.html.
      * security/crypto-gc-expected.txt: Removed.
      * security/crypto-gc.html: Removed.
      * security/crypto-random-values-expected.txt: Removed.
      * security/crypto-random-values-limits-expected.txt: Removed.
      * security/crypto-random-values-limits.html: Removed.
      * security/crypto-random-values-types-expected.txt: Removed.
      * security/crypto-random-values-types.html: Removed.
      * security/crypto-random-values.html: Removed.
      * security/crypto-subtle-arguments-expected.txt: Removed.
      * security/crypto-subtle-arguments.html: Removed.
      * security/crypto-subtle-gc-2-expected.txt: Removed.
      * security/crypto-subtle-gc-2.html: Removed.
      * security/crypto-subtle-gc-3-expected.txt: Removed.
      * security/crypto-subtle-gc-3.html: Removed.
      * security/crypto-subtle-gc-expected.txt: Removed.
      * security/crypto-subtle-gc.html: Removed.
      * security/crypto-subtle-sha1-expected.txt: Removed.
      * security/crypto-subtle-sha1.html: Removed.
      * security/resources/common.js: Removed.
      Moved tests from security/ to crypto/.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      13a73330
  2. 20 Dec, 2012 1 commit
    • commit-queue@webkit.org's avatar
      window.crypto.getRandomValues should return the input ArrayBufferView · 1bf9c41f
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=104845
      
      Source/WebCore:
      
      The W3C Web Crypto API FPWD, as well as the WHATWG February 2012 draft,
      define crypto.getRandomValues() as returning the input ArrayBufferView,
      to allow function call chaining. Update the implementation to match
      the current spec, rather than the old spec of void/undefined.
      
      Patch by Ryan Sleevi <rsleevi@chromium.org> on 2012-12-20
      Reviewed by Kentaro Hara.
      
      Test: security/crypto-random-values-types.html
      
      * GNUmakefile.list.am:
      * Target.pri:
      * UseJSC.cmake:
      * WebCore.gypi:
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/JSBindingsAllInOne.cpp:
      * bindings/js/JSCryptoCustom.cpp: Added.
      (WebCore):
      (WebCore::JSCrypto::getRandomValues):
      Added custom getRandomValues implementation so that the input wrapped
      ArrayBufferView can be returned directly to the caller. This is to
      preserve the underlying type and indexing accessor for the TypedArray
      subclass.
      * bindings/v8/custom/V8CryptoCustom.cpp: Added.
      (WebCore):
      (WebCore::V8Crypto::getRandomValuesCallback):
      Added custom getRandomValues implementation so that the input wrapped
      ArrayBufferView can be returned directly to the caller. This is to
      preserve the underlying type and indexing accessor for the TypedArray
      subclass.
      * page/Crypto.idl:
      
      LayoutTests:
      
      Patch by Ryan Sleevi <rsleevi@chromium.org> on 2012-12-20
      Reviewed by Kentaro Hara.
      
      * fast/js/resources/js-test-pre.js:
      (shouldBeType):
      Added helper to assert that an expression returns an object of the
      correct type.
      * security/crypto-random-values-types-expected.txt:
      * security/crypto-random-values-types.html:
      Test all possible TypedArray integer types and ensure that both the
      correct TypedArray type is returned and that it is equal to the input
      type; that is, that the input type is modified in place, rather then
      copied.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1bf9c41f
  3. 16 Nov, 2012 1 commit
    • arv@chromium.org's avatar
      Update DOMException name: TypeMismatchError · 6fcb819d
      arv@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=102418
      
      Reviewed by Kentaro Hara.
      
      Source/WebCore:
      
      Patch 17 of 25 to update DOMException name to match the spec and Firefox.
      
      Updated existing tests.
      
      * dom/DOMCoreException.cpp:
      (WebCore):
      * dom/ExceptionCode.h:
      
      LayoutTests:
      
      Updated tests and expectations.
      
      * editing/selection/extend-expected.txt:
      * fast/dom/Element/attr-param-typechecking-expected.txt:
      * fast/dom/Geolocation/argument-types-expected.txt:
      * fast/dom/Geolocation/not-enough-arguments-expected.txt:
      * fast/dom/Geolocation/script-tests/argument-types.js:
      (test):
      * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
      * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
      * fast/js/select-options-add-expected.txt:
      * fast/mediastream/RTCIceCandidate-expected.txt:
      * fast/mediastream/RTCPeerConnection-expected.txt:
      * fast/mediastream/RTCSessionDescription-expected.txt:
      * platform/chromium/fast/dynamic/insertAdjacentElement-expected.txt:
      * platform/efl/fast/dynamic/insertAdjacentElement-expected.txt:
      * platform/gtk/fast/dynamic/insertAdjacentElement-expected.txt:
      * platform/mac/fast/dynamic/insertAdjacentElement-expected.txt:
      * platform/qt/fast/dynamic/insertAdjacentElement-expected.txt:
      * security/crypto-random-values-types-expected.txt:
      * svg/dom/SVGTransformList-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6fcb819d
  4. 13 Nov, 2012 2 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r134345. · a5d24144
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/134345
      https://bugs.webkit.org/show_bug.cgi?id=102106
      
      Incomplete support for NATIVE_TYPE_ERR in objc and other
      bindings (Requested by jsbell on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-11-13
      
      Source/WebCore:
      
      * Modules/mediastream/MediaConstraintsImpl.cpp:
      (WebCore::MediaConstraintsImpl::create):
      * Modules/mediastream/MediaStreamTrackList.cpp:
      (WebCore::MediaStreamTrackList::add):
      (WebCore::MediaStreamTrackList::remove):
      * Modules/mediastream/RTCDataChannel.cpp:
      (WebCore::RTCDataChannel::setBinaryType):
      * Modules/mediastream/RTCIceCandidate.cpp:
      (WebCore::RTCIceCandidate::create):
      * Modules/mediastream/RTCPeerConnection.cpp:
      (WebCore::RTCPeerConnection::parseConfiguration):
      (WebCore::RTCPeerConnection::createOffer):
      (WebCore::RTCPeerConnection::createAnswer):
      (WebCore::RTCPeerConnection::setLocalDescription):
      (WebCore::RTCPeerConnection::setRemoteDescription):
      (WebCore::RTCPeerConnection::addIceCandidate):
      (WebCore::RTCPeerConnection::addStream):
      (WebCore::RTCPeerConnection::removeStream):
      * Modules/mediastream/RTCSessionDescription.cpp:
      (WebCore::RTCSessionDescription::create):
      (WebCore::RTCSessionDescription::setType):
      * bindings/js/CallbackFunction.cpp:
      (WebCore::checkFunctionOnlyCallback):
      * bindings/js/JSCustomXPathNSResolver.cpp:
      (WebCore::JSCustomXPathNSResolver::create):
      * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
      (WebCore::JSHTMLOptionsCollection::add):
      * bindings/js/JSHTMLSelectElementCustom.cpp:
      (WebCore::selectIndexSetter):
      * bindings/js/JSMutationObserverCustom.cpp:
      (WebCore::JSMutationObserverConstructor::constructJSMutationObserver):
      * bindings/js/JSSQLResultSetRowListCustom.cpp:
      (WebCore::JSSQLResultSetRowList::item):
      * bindings/js/JSSQLTransactionCustom.cpp:
      (WebCore::JSSQLTransaction::executeSql):
      * bindings/js/JSSQLTransactionSyncCustom.cpp:
      (WebCore::JSSQLTransactionSync::executeSql):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateParametersCheck):
      * bindings/scripts/CodeGeneratorObjC.pm:
      (GenerateImplementation):
      * bindings/scripts/CodeGeneratorV8.pm:
      (GenerateFunctionCallString):
      * bindings/v8/V8Callback.h:
      (WebCore::createFunctionOnlyCallback):
      * bindings/v8/V8Collection.cpp:
      (WebCore::toOptionsCollectionSetter):
      * bindings/v8/custom/V8DocumentCustom.cpp:
      (WebCore::V8Document::evaluateCallback):
      * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
      (WebCore::V8HTMLOptionsCollection::addCallback):
      * bindings/v8/custom/V8MutationObserverCustom.cpp:
      (WebCore::V8MutationObserver::constructorCallback):
      * bindings/v8/custom/V8SQLTransactionCustom.cpp:
      (WebCore::V8SQLTransaction::executeSqlCallback):
      * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
      (WebCore::V8SQLTransactionSync::executeSqlCallback):
      * dom/DOMCoreException.idl:
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::insertAdjacentElement):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::webkitAddKey):
      * html/HTMLOptionsCollection.cpp:
      (WebCore::HTMLOptionsCollection::add):
      * html/canvas/CanvasRenderingContext2D.cpp:
      (WebCore::CanvasRenderingContext2D::drawImage):
      (WebCore::CanvasRenderingContext2D::createPattern):
      (WebCore::CanvasRenderingContext2D::putImageData):
      (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD):
      * page/Crypto.cpp:
      (WebCore::Crypto::getRandomValues):
      * page/DOMSelection.cpp:
      (WebCore::DOMSelection::extend):
      * svg/properties/SVGTransformListPropertyTearOff.h:
      (WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix):
      
      LayoutTests:
      
      * canvas/philip/tests/2d.drawImage.null.html:
      * canvas/philip/tests/2d.imageData.put.null.html:
      * canvas/philip/tests/2d.pattern.image.null.html:
      * editing/selection/extend-expected.txt:
      * fast/dom/Geolocation/argument-types-expected.txt:
      * fast/dom/Geolocation/not-enough-arguments-expected.txt:
      * fast/dom/Geolocation/script-tests/argument-types.js:
      (test):
      * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
      * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
      * fast/js/select-options-add-expected.txt:
      * fast/mediastream/RTCIceCandidate-expected.txt:
      * fast/mediastream/RTCPeerConnection-expected.txt:
      * fast/mediastream/RTCSessionDescription-expected.txt:
      * media/encrypted-media/encrypted-media-syntax-expected.txt:
      * media/encrypted-media/encrypted-media-syntax.html:
      * media/video-test.js:
      * platform/chromium/fast/dynamic/insertAdjacentElement-expected.txt:
      * security/crypto-random-values-types-expected.txt:
      * svg/dom/SVGTransformList-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a5d24144
    • arv@chromium.org's avatar
      Replace DOMException TYPE_MISMATCH_ERR with TypeError · 04fc7b0e
      arv@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=101604
      
      Reviewed by Adam Barth.
      
      Source/WebCore:
      
      DOMException.TYPE_MISMATCH_ERR is deprecated in favor of using TypeError.
      
      We have historically used TYPE_MISMATCH_ERR as a blanket DOMException code when
      the spec mandates TypeError being thrown.
      
      Updated existing tests.
      
      * Modules/mediastream/MediaConstraintsImpl.cpp:
      * Modules/mediastream/MediaStreamTrackList.cpp:
      * Modules/mediastream/PeerConnection00.cpp:
      * Modules/mediastream/RTCDataChannel.cpp:
      * Modules/mediastream/RTCIceCandidate.cpp:
      * Modules/mediastream/RTCPeerConnection.cpp:
      * Modules/mediastream/RTCSessionDescription.cpp:
      * Modules/mediastream/SessionDescription.cpp:
      * bindings/js/CallbackFunction.cpp:
      * bindings/js/JSCustomXPathNSResolver.cpp:
      * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
      * bindings/js/JSHTMLSelectElementCustom.cpp:
      * bindings/js/JSMutationObserverCustom.cpp:
      * bindings/js/JSSQLResultSetRowListCustom.cpp:
      * bindings/js/JSSQLTransactionCustom.cpp:
      * bindings/js/JSSQLTransactionSyncCustom.cpp:
      * bindings/scripts/CodeGeneratorJS.pm:
      * bindings/scripts/CodeGeneratorObjC.pm:
      * bindings/scripts/CodeGeneratorV8.pm:
      * bindings/v8/V8Callback.h:
      * bindings/v8/V8Collection.cpp:
      * bindings/v8/custom/V8DocumentCustom.cpp:
      * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
      * bindings/v8/custom/V8MutationObserverCustom.cpp:
      * bindings/v8/custom/V8SQLTransactionCustom.cpp:
      * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
      * dom/DOMCoreException.idl:
      * html/HTMLElement.cpp:
      * html/HTMLMediaElement.cpp:
      * html/HTMLOptionsCollection.cpp:
      * html/canvas/CanvasRenderingContext2D.cpp:
      * page/Crypto.cpp:
      * page/DOMSelection.cpp:
      * svg/properties/SVGTransformListPropertyTearOff.h:
      
      LayoutTests:
      
      Update the tests to test for TypeError instead of DOMException with the TYPE_MISMATCH_ERR code.
      
      * canvas/philip/tests/2d.drawImage.null.html:
      * canvas/philip/tests/2d.imageData.put.null.html:
      * canvas/philip/tests/2d.pattern.image.null.html:
      * editing/selection/extend-expected.txt:
      * fast/dom/Geolocation/argument-types-expected.txt:
      * fast/dom/Geolocation/not-enough-arguments-expected.txt:
      * fast/dom/Geolocation/script-tests/argument-types.js:
      * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
      * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
      * fast/js/select-options-add-expected.txt:
      * fast/mediastream/RTCIceCandidate-expected.txt:
      * fast/mediastream/RTCPeerConnection-expected.txt:
      * fast/mediastream/RTCSessionDescription-expected.txt:
      * fast/mediastream/SessionDescription-expected.txt:
      * fast/mediastream/peerconnection-addstream-expected.txt:
      * fast/mediastream/peerconnection-iceoptions-expected.txt:
      * fast/mediastream/peerconnection-iceoptions.html:
      * fast/mediastream/peerconnection-removestream-expected.txt:
      * media/encrypted-media/encrypted-media-syntax.html:
      * media/video-test.js:
      * platform/chromium/fast/dynamic/insertAdjacentElement-expected.txt:
      * security/crypto-random-values-types-expected.txt:
      * svg/dom/SVGTransformList-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      04fc7b0e
  5. 13 Feb, 2011 1 commit
  6. 12 Feb, 2011 1 commit