Bug 128938

Summary: [iOS] 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
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch
none
added fallback to _NSGetProgname mitz: review+

Description Alexey Proskuryakov 2014-02-17 15:29:40 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/16075932>
Comment 1 Alexey Proskuryakov 2014-02-17 15:32:51 PST
Created attachment 224434 [details]
proposed patch
Comment 2 Alexey Proskuryakov 2014-02-17 15:58:37 PST
Created attachment 224443 [details]
added fallback to _NSGetProgname
Comment 3 mitz 2014-02-18 13:43:26 PST
Comment on attachment 224443 [details]
added fallback to _NSGetProgname

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

> Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm:78
> +    NSString *applicationName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];

Shouldn’t we try to get this from -localizedInfoDictionary first?

Let’s use a local variable for [NSBundle mainBundle].
Comment 4 Tim Horton 2014-02-18 13:45:35 PST
Comment on attachment 224443 [details]
added fallback to _NSGetProgname

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

> Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm:81
> +    NSString *applicationName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
> +    if (!applicationName)
> +        applicationName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
> +    if (!applicationName)

plz use constants!
Comment 5 mitz 2014-02-18 13:47:36 PST
(In reply to comment #3)
> (From update of attachment 224443 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=224443&action=review
> 
> > Source/WebCore/crypto/mac/SerializedCryptoKeyWrapMac.mm:78
> > +    NSString *applicationName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
> 
> Shouldn’t we try to get this from -localizedInfoDictionary first?

Ignore this. -objectForInfoDictionaryKey: returns a localized version.
Comment 6 Alexey Proskuryakov 2014-02-18 14:18:38 PST
Committed <http://trac.webkit.org/r164317>.