[Webkit-unassigned] [Bug 156553] New: Setting navigationDelegate breaks WebCrypto API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 13 13:38:08 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=156553

            Bug ID: 156553
           Summary: Setting navigationDelegate  breaks WebCrypto API
    Classification: Unclassified
           Product: WebKit
           Version: Safari 9
          Hardware: iOS
                OS: iOS 9.3
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: trygve.hardersen at gmail.com

I'm encountering strange behaviour in the WebCrypto API when setting the navigationDelegate of a WKWebView on iOS. After setting the delegate I can no longer store asymmetric keys from JavaScript as I'm getting a DataCloneError (25).

After looking through the source code I believe this is caused by this code in NavigationState.mm

m_navigationDelegateMethods.webCryptoMasterKeyForWebView = [delegate respondsToSelector:@selector(_webCryptoMasterKeyForWebView:)];

I can work around the issue by implementing this method in by navigationDelegate class:

- (NSData *)_webCryptoMasterKeyForWebView:(WKWebView *)sender {
    return [NSData dataWithBytes:"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" length:16];
}

I've provided a sample key above. Obviously I would not like to rely on this private API.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160413/29b9a825/attachment.html>


More information about the webkit-unassigned mailing list