Changeset 269162 in webkit
- Timestamp:
- Oct 29, 2020, 1:20:28 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/cocoa/NetworkSessionCocoa.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r269159 r269162 1 2020-10-29 Alex Christensen <achristensen@webkit.org> 2 3 Don't look in the keychain for a preferred client certificate in the network process 4 https://bugs.webkit.org/show_bug.cgi?id=218322 5 <rdar://problem/64931374> 6 7 Reviewed by Geoffrey Garen. 8 9 Often, based on a race condition of preconnecting to a server we have just been told to load and 10 the use of Safari's BackgroundLoad class when navigating to a page we have not received any data from yet, 11 and with an installed client certificate and an identity preference in the keychain, the user will be asked 12 if com.apple.WebKit.Networking can access a private key in the keychain instead of if Safari can access a 13 private key in the keychain. If the user types in the password and clicks "Always Allow" this does not make 14 it always allowed, but it would have if Safari had asked instead of com.apple.WebKit.Networking. 15 This is because Safari is responding to WKNavigationDelegate's didReceiveAuthenticationChallenge with 16 NSURLSessionAuthChallengeUseCredential and nil, which would cause CFNetwork to search in the keychain as the network 17 process for the preferred client certificate. What we want Safari's network process to do is not search in the keychain 18 for this preconnect request's challenge but wait until the actual request, at which time Safari will use its proper logic 19 to find the correct client certificate and AuthenticationManager::initializeConnection will create a SecKeyProxy 20 to do the signing in the UI process. Third party applications will not be affected because the SecKeyProxy path is the 21 only one that works for applications lacking Safari's entitlements. I used the steps in the radar to verify that this 22 is fixed. Unfortunately, it is not practical to make a unit test that installs a system client certificate and an 23 identity preference because doing so would require the entry of the login keychain password while running the unit test. 24 25 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 26 (WebKit::configurationForSessionID): 27 (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 28 1 29 2020-10-29 Said Abou-Hallawa <said@apple.com> 2 30 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r268261 r269162 1047 1047 if (session.isEphemeral()) { 1048 1048 configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration]; 1049 configuration._shouldSkipPreferredClientCertificateLookup = YES;1050 1049 #if HAVE(LOGGING_PRIVACY_LEVEL) && defined(NW_CONTEXT_HAS_PRIVACY_LEVEL_SILENT) 1051 1050 loggingPrivacyLevel = nw_context_privacy_level_silent; … … 1053 1052 } else 1054 1053 configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; 1054 configuration._shouldSkipPreferredClientCertificateLookup = YES; 1055 1055 1056 1056 #if HAVE(LOGGING_PRIVACY_LEVEL) … … 1298 1298 1299 1299 configuration.URLCredentialStorage = nil; 1300 configuration._shouldSkipPreferredClientCertificateLookup = YES;1301 1300 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=177394 1302 1301 // configuration.HTTPCookieStorage = nil;
Note:
See TracChangeset
for help on using the changeset viewer.