⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 207993 in webkit


Ignore:
Timestamp:
Oct 27, 2016, 11:16:22 AM (10 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r206684. rdar://problem/28545011

Location:
branches/safari-602-branch/Source/WebKit2
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-602-branch/Source/WebKit2/ChangeLog

    r207953 r207993  
     12016-10-27  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r206684. rdar://problem/28545011
     4
     5    2016-09-30  Brady Eidson  <beidson@apple.com>
     6
     7            REGRESSION (Safari 10 combined with WK changes): Unable to store WebCrypto keys in IndexedDB database.
     8            <rdar://problem/28334440> and https://bugs.webkit.org/show_bug.cgi?id=162554
     9
     10            Reviewed by Alexey Proskuryakov.
     11
     12            Safari 10 has a WKPageNavigation client but does not implement the "copyWebCryptoMasterKey" callback.
     13
     14            WebKit just fails in this case, instead of falling back to "getDefaultWebCryptoMasterKey".
     15            It should fall back.
     16
     17            Additionally there's a WKContextClient callback to get the crypto key, also, but it is completely unused.
     18            So it should be pulled.
     19
     20            * UIProcess/API/APILoaderClient.h:
     21            (API::LoaderClient::webCryptoMasterKey): Deleted.
     22            * UIProcess/API/C/WKContext.h:
     23
     24            * UIProcess/API/C/WKPage.cpp:
     25            (WKPageSetPageLoaderClient):
     26            (WKPageSetPageNavigationClient): If the client doesn't implement this method, fallback to getDefaultWebCryptoMasterKey.
     27
     28            * UIProcess/Cocoa/NavigationState.mm:
     29            (WebKit::NavigationState::NavigationClient::webCryptoMasterKey): If the client doesn't implement this method,
     30              fallback to getDefaultWebCryptoMasterKey.
     31
     32            * UIProcess/WebContextClient.cpp:
     33            (WebKit::WebContextClient::copyWebCryptoMasterKey): Deleted.
     34            * UIProcess/WebContextClient.h:
     35
     36            * UIProcess/WebPageProxy.cpp:
     37            (WebKit::WebPageProxy::wrapCryptoKey): Only ask the NavigationClient before falling back. Don't ask the loader client.
     38            (WebKit::WebPageProxy::unwrapCryptoKey): Ditto.
     39
    1402016-10-26  David Kilzer  <ddkilzer@apple.com>
    241
  • branches/safari-602-branch/Source/WebKit2/UIProcess/API/APILoaderClient.h

    r207607 r207993  
    9494    virtual void willGoToBackForwardListItem(WebKit::WebPageProxy&, WebKit::WebBackForwardListItem*, API::Object*) { }
    9595
    96     virtual RefPtr<Data> webCryptoMasterKey(WebKit::WebPageProxy&) { return nullptr; }
    97 
    9896    virtual void didNavigateWithNavigationData(WebKit::WebPageProxy&, const WebKit::WebNavigationDataStore&, WebKit::WebFrameProxy&) { }
    9997    virtual void didPerformClientRedirect(WebKit::WebPageProxy&, const WTF::String&, const WTF::String&, WebKit::WebFrameProxy&) { }
  • branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKContext.h

    r196942 r207993  
    7676
    7777    // Version 1.
    78     WKContextCopyWebCryptoMasterKeyCallback                             copyWebCryptoMasterKey;
     78    void                                                                (*copyWebCryptoMasterKey_unavailable)(void);
    7979} WKContextClientV1;
    8080
    … …  
    8888
    8989    // Version 1.
    90     WKContextCopyWebCryptoMasterKeyCallback                             copyWebCryptoMasterKey;
     90    void                                                                (*copyWebCryptoMasterKey_unavailable)(void);
    9191
    9292    // Version 2.
  • branches/safari-602-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r207607 r207993  
    7272#include <WebCore/Page.h>
    7373#include <WebCore/SecurityOriginData.h>
     74#include <WebCore/SerializedCryptoKeyWrap.h>
    7475#include <WebCore/WindowFeatures.h>
    7576
    … …  
    12131214            if (m_client.willGoToBackForwardListItem)
    12141215                m_client.willGoToBackForwardListItem(toAPI(&page), toAPI(item), toAPI(userData), m_client.base.clientInfo);
    1215         }
    1216 
    1217         RefPtr<API::Data> webCryptoMasterKey(WebPageProxy& page) override
    1218         {
    1219             return page.process().processPool().client().copyWebCryptoMasterKey(&page.process().processPool());
    12201216        }
    12211217
    … …  
    23272323        RefPtr<API::Data> webCryptoMasterKey(WebPageProxy& page) override
    23282324        {
    2329             if (!m_client.copyWebCryptoMasterKey)
     2325            if (m_client.copyWebCryptoMasterKey)
     2326                return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(&page), m_client.base.clientInfo)));
     2327
     2328            Vector<uint8_t> masterKey;
     2329            if (!getDefaultWebCryptoMasterKey(masterKey))
    23302330                return nullptr;
    2331             return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(&page), m_client.base.clientInfo)));
     2331
     2332            return API::Data::create(masterKey.data(), masterKey.size());
    23322333        }
    23332334
  • branches/safari-602-branch/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm

    r207801 r207993  
    6464#import <WebCore/Credential.h>
    6565#import <WebCore/SecurityOriginData.h>
     66#import <WebCore/SerializedCryptoKeyWrap.h>
    6667#import <WebCore/URL.h>
    6768#import <wtf/NeverDestroyed.h>
    … …  
    716717RefPtr<API::Data> NavigationState::NavigationClient::webCryptoMasterKey(WebKit::WebPageProxy&)
    717718{
    718     if (!m_navigationState.m_navigationDelegateMethods.webCryptoMasterKeyForWebView)
    719         return nullptr;
     719    if (!m_navigationState.m_navigationDelegateMethods.webCryptoMasterKeyForWebView) {
     720        Vector<uint8_t> masterKey;
     721        if (!getDefaultWebCryptoMasterKey(masterKey))
     722            return nullptr;
     723
     724        return API::Data::create(masterKey.data(), masterKey.size());
     725    }
    720726
    721727    auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
  • branches/safari-602-branch/Source/WebKit2/UIProcess/WebContextClient.cpp

    r196821 r207993  
    6666    m_client.plugInInformationBecameAvailable(toAPI(processPool), toAPI(plugInInfo), m_client.base.clientInfo);
    6767}
    68 
    69 PassRefPtr<API::Data> WebContextClient::copyWebCryptoMasterKey(WebProcessPool* processPool)
    70 {
    71     if (!m_client.copyWebCryptoMasterKey)
    72         return nullptr;
    73 
    74     return adoptRef(toImpl(m_client.copyWebCryptoMasterKey(toAPI(processPool), m_client.base.clientInfo)));
    75 }
    76 
     68   
    7769} // namespace WebKit
  • branches/safari-602-branch/Source/WebKit2/UIProcess/WebContextClient.h

    r196821 r207993  
    5050    void databaseProcessDidCrash(WebProcessPool*);
    5151    void plugInInformationBecameAvailable(WebProcessPool*, API::Array*);
    52     PassRefPtr<API::Data> copyWebCryptoMasterKey(WebProcessPool*);
    5352};
    5453
  • branches/safari-602-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r207801 r207993  
    60656065        if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this))
    60666066            masterKey = keyData->dataReference().vector();
    6067     } else if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this))
    6068         masterKey = keyData->dataReference().vector();
    6069     else if (!getDefaultWebCryptoMasterKey(masterKey)) {
     6067    } else if (!getDefaultWebCryptoMasterKey(masterKey)) {
    60706068        succeeded = false;
    60716069        return;
    … …  
    60846082        if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this))
    60856083            masterKey = keyData->dataReference().vector();
    6086     } else if (RefPtr<API::Data> keyData = m_loaderClient->webCryptoMasterKey(*this))
    6087         masterKey = keyData->dataReference().vector();
    6088     else if (!getDefaultWebCryptoMasterKey(masterKey)) {
     6084    } else if (!getDefaultWebCryptoMasterKey(masterKey)) {
    60896085        succeeded = false;
    60906086        return;
Note: See TracChangeset for help on using the changeset viewer.