Bug 156553
Summary: | Setting navigationDelegate breaks WebCrypto API | ||
---|---|---|---|
Product: | WebKit | Reporter: | Trygve <trygve.hardersen> |
Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | andersca, beidson, bfulgham, sam, trygve.hardersen, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 9 | ||
Hardware: | iPhone / iPad | ||
OS: | iOS 9.3 |
Trygve
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/25766400>
Brady Eidson
*** This bug has been marked as a duplicate of bug 162554 ***