[webkit-changes] [WebKit/WebKit] 51ae1a: Adding wrap/unwrapCryptoKey to ServiceWorker

Commit Queue noreply at github.com
Thu Mar 14 06:28:09 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 51ae1a6d501e745cb0af429b3323372ce9aaae62
      https://github.com/WebKit/WebKit/commit/51ae1a6d501e745cb0af429b3323372ce9aaae62
  Author: nmahendru <nitinmahendru at apple.com>
  Date:   2024-03-14 (Thu, 14 Mar 2024)

  Changed paths:
    A LayoutTests/http/tests/workers/service/indexeddb-cryptokey-put-get.https-expected.txt
    A LayoutTests/http/tests/workers/service/indexeddb-cryptokey-put-get.https.html
    A LayoutTests/http/tests/workers/service/resources/indexeddb-cryptokey-put-get-worker.js
    A LayoutTests/http/tests/workers/service/resources/indexeddb-cryptokey-put-get.js
    M Source/WebCore/Headers.cmake
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/bindings/js/SerializedScriptValue.cpp
    M Source/WebCore/crypto/cocoa/SerializedCryptoKeyWrapMac.mm
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/dom/EmptyScriptExecutionContext.h
    M Source/WebCore/dom/ScriptExecutionContext.h
    M Source/WebCore/loader/EmptyClients.cpp
    M Source/WebCore/loader/EmptyClients.h
    M Source/WebCore/page/ChromeClient.h
    A Source/WebCore/page/CryptoClient.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M Source/WebCore/page/PageConfiguration.cpp
    M Source/WebCore/page/PageConfiguration.h
    M Source/WebCore/workers/WorkerGlobalScope.cpp
    M Source/WebCore/workers/WorkerGlobalScope.h
    M Source/WebCore/worklets/WorkletGlobalScope.h
    M Source/WebKit/Sources.txt
    M Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
    M Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Source/WebKit/UIProcess/WebProcessProxy.messages.in
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
    A Source/WebKit/WebProcess/WebCoreSupport/WebCryptoClient.cpp
    A Source/WebKit/WebProcess/WebCoreSupport/WebCryptoClient.h
    M Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/cocoa/RemoteRealtimeVideoSource.cpp
    A Source/WebKitLegacy/WebCoreSupport/WebCryptoClient.h
    A Source/WebKitLegacy/WebCoreSupport/WebCryptoClient.mm
    M Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj
    M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm
    M Source/WebKitLegacy/mac/WebView/WebView.mm
    M Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h
    M Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm

  Log Message:
  -----------
  Adding wrap/unwrapCryptoKey to ServiceWorker
https://bugs.webkit.org/show_bug.cgi?id=183167
rdar://88339459

Reviewed by Sihui Liu.

At the moment the ServiceWorker flow does not have the wrap and unwrap
functionality so any attempt to write a CryptoKey from ServiceWorker to indexDB
is failing.

This introduces the bridge from SW all the way to UIProcess so that it can call the
key wrapping APIs and serialize keys for IndexedDB.

* LayoutTests/http/tests/workers/service/indexeddb-cryptokey-put-get.https-expected.txt: Added.
* LayoutTests/http/tests/workers/service/indexeddb-cryptokey-put-get.https.html: Added.
* LayoutTests/http/tests/workers/service/resources/indexeddb-cryptokey-put-get-worker.js: Added.
(async createKeys):
(async addValue):
(async getValue.):
(async getValue):
(async testFetchedKeys):
(async runTest):
(async cleanupDatabase.):
(async cleanupDatabase):
(async self):
* LayoutTests/http/tests/workers/service/resources/indexeddb-cryptokey-put-get.js: Added.
(async test):
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/SerializedScriptValue.cpp:
(WebCore::wrapCryptoKey):
(WebCore::unwrapCryptoKey):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readTerminal):
* Source/WebCore/crypto/cocoa/SerializedCryptoKeyWrapMac.mm:
(WebCore::wrapSerializedCryptoKey):
(WebCore::unwrapSerializedCryptoKey):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::wrapCryptoKey):
(WebCore::std::optional<Vector<uint8_t>>Document::unwrapCryptoKey):
(WebCore::Document::unwrapCryptoKey): Deleted.
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/EmptyScriptExecutionContext.h:
* Source/WebCore/dom/ScriptExecutionContext.h:
* Source/WebCore/loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
* Source/WebCore/loader/EmptyClients.h:
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::wrapCryptoKey const): Deleted.
(WebCore::ChromeClient::unwrapCryptoKey const): Deleted.
* Source/WebCore/page/Page.cpp:
(WebCore::Page::Page):
* Source/WebCore/page/Page.h:
(WebCore::Page::webCryptoClient):
(WebCore::Page::webCryptoClient const):
* Source/WebCore/page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* Source/WebCore/page/PageConfiguration.h:
* Source/WebCore/page/WebCryptoClient.cpp: Added.
* Source/WebCore/page/WebCryptoClient.h: Added.
(WebCore::WebCryptoClient::wrapCryptoKey const):
(WebCore::WebCryptoClient::unwrapCryptoKey const):
* Source/WebCore/workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::wrapCryptoKey):
(WebCore::WorkerGlobalScope::unwrapCryptoKey):
* Source/WebCore/workers/WorkerGlobalScope.h:
* Source/WebCore/worklets/WorkletGlobalScope.h:
* Source/WebKit/Sources.txt:
* Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
* Source/WebKit/UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::wrapCryptoKey):
(WebKit::WebPageProxy::unwrapCryptoKey):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::wrapCryptoKey):
(WebKit::WebProcessProxy::unwrapCryptoKey):
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Source/WebKit/UIProcess/WebProcessProxy.messages.in:
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreClient.h:
(WebKit::WebsiteDataStoreClient::_webCryptoMasterKeyForWebProcess):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::installServiceWorker):
* Source/WebKit/WebProcess/WebCoreSupport/SWWebCryptoClient.cpp: Added.
(WebKit::SWWebCryptoClient::wrapCryptoKey const):
(WebKit::SWWebCryptoClient::unwrapCryptoKey const):
* Source/WebKit/WebProcess/WebCoreSupport/SWWebCryptoClient.h: Added.
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::wrapCryptoKey const): Deleted.
(WebKit::WebChromeClient::unwrapCryptoKey const): Deleted.
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebPageWebCryptoClient.cpp: Added.
(WebKit::WebPageWebCryptoClient::wrapCryptoKey const):
(WebKit::WebPageWebCryptoClient::unwrapCryptoKey const):
(WebKit::WebPageWebCryptoClient::WebPageWebCryptoClient):
* Source/WebKit/WebProcess/WebCoreSupport/WebPageWebCryptoClient.h: Added.
* Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::m_unifiedTextReplacementController):
* Source/WebKit/WebProcess/cocoa/RemoteRealtimeVideoSource.cpp:
* Source/WebKitLegacy/WebCoreSupport/WebViewWebCryptoClient.h: Added.
* Source/WebKitLegacy/WebCoreSupport/WebViewWebCryptoClient.mm: Added.
(WebViewWebCryptoClient::wrapCryptoKey const):
(WebViewWebCryptoClient::unwrapCryptoKey const):
(WebViewWebCryptoClient::WebViewWebCryptoClient):
* Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::wrapCryptoKey const): Deleted.
(WebChromeClient::unwrapCryptoKey const): Deleted.
* Source/WebKitLegacy/mac/WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/IndexedDBPersistence.mm:
(TEST):
* Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h:
* Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.mm:
(-[TestWebsiteDataStoreDelegate webCryptoMasterKeyForWebProcess]):

Canonical link: https://commits.webkit.org/276088@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list