Bug 128852

Summary: [Mac] All WebKit clients should encrypt WebCrypto keys automatically
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebCore Misc.Assignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, mitz, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch
none
with less 10.8 build breakage mitz: review+

Description Alexey Proskuryakov 2014-02-14 16:09:12 PST
We have a client call to get a WebCrypto master key, but most client won't implement it. WebKit should provide encryption by default.

<rdar://problem/15921734>
Comment 1 Alexey Proskuryakov 2014-02-14 16:18:36 PST
Created attachment 224262 [details]
proposed patch
Comment 2 Alexey Proskuryakov 2014-02-14 17:33:21 PST
Created attachment 224267 [details]
with less 10.8 build breakage
Comment 3 mitz 2014-02-15 14:52:21 PST
Comment on attachment 224267 [details]
with less 10.8 build breakage

View in context: https://bugs.webkit.org/attachment.cgi?id=224267&action=review

> Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm:60
> +static NSString* masterKeyAccountNameForCurrentApplication()
> +{
> +    return [NSString stringWithFormat:@"com.apple.WebKit.WebCrypto.master+%@", [[NSRunningApplication currentApplication] bundleIdentifier]];
> +}

When building for iOS, won’t this cause an unused function warning?

> Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm:100
> +    status = SecACLSetContents(acl, (CFArrayRef)@[(id)trustedApp.get()], (CFStringRef)localizedItemName, kSecKeychainPromptRequirePassphase);

Please add spaces inside the @[].
Comment 4 mitz 2014-02-15 14:52:48 PST
Comment on attachment 224267 [details]
with less 10.8 build breakage

Sorry, I didn’t mean to reset the review flag. This is still r=oliver.
Comment 5 mitz 2014-02-15 14:54:03 PST
Comment on attachment 224267 [details]
with less 10.8 build breakage

View in context: https://bugs.webkit.org/attachment.cgi?id=224267&action=review

> Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm:1008
> +        NSData* keyData = CallUIDelegate(m_webView, selector);

Space on the wrong side of the star.

> Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm:1021
> +        NSData* keyData = CallUIDelegate(m_webView, selector);

Here too.
Comment 6 Alexey Proskuryakov 2014-02-15 15:21:30 PST
Committed with suggested fixes in <http://trac.webkit.org/r164181>.