Bug 128852 - [Mac] All WebKit clients should encrypt WebCrypto keys automatically
Summary: [Mac] All WebKit clients should encrypt WebCrypto keys automatically
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-02-14 16:09 PST by Alexey Proskuryakov
Modified: 2014-02-15 15:21 PST (History)
3 users (show)

See Also:


Attachments
proposed patch (15.35 KB, patch)
2014-02-14 16:18 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
with less 10.8 build breakage (15.15 KB, patch)
2014-02-14 17:33 PST, Alexey Proskuryakov
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.