Changeset 269140 in webkit
- Timestamp:
- Oct 28, 2020, 11:31:36 PM (6 years ago)
- Location:
- branches/safari-610-branch
- Files:
-
- 4 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/mac/SecItemShim.cpp (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-610-branch/Source/WebKit/ChangeLog
r269087 r269140 1 2020-10-28 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r269094. rdar://problem/70795299 4 5 Use _CFURLConnectionSetFrameworkStubs for SecItemShim instead of DYLD_INTERPOSE on Apple Silicon Macs 6 https://bugs.webkit.org/show_bug.cgi?id=218269 7 <rdar://problem/70491533> 8 9 Reviewed by Darin Adler. 10 11 Source/WebKit: 12 13 r171066 introduced the use of _CFURLConnectionSetFrameworkStubs on iOS for CFNetwork to be able 14 to get and set credentials as the UI process. This is also needed on Apple Silicon Macs. 15 We should eventually replace it with an even cleaner per-NSURLSession solution, but this is a step 16 in the right direction, and I verified manually that it fixes the radar. 17 18 Covered by an API test that used to fail on Apple Silicon Macs. 19 20 * Shared/mac/SecItemShim.cpp: 21 (WebKit::initializeSecItemShim): 22 23 Tools: 24 25 * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: 26 (TEST): 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269094 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2020-10-27 Alex Christensen <achristensen@webkit.org> 31 32 Use _CFURLConnectionSetFrameworkStubs for SecItemShim instead of DYLD_INTERPOSE on Apple Silicon Macs 33 https://bugs.webkit.org/show_bug.cgi?id=218269 34 <rdar://problem/70491533> 35 36 Reviewed by Darin Adler. 37 38 r171066 introduced the use of _CFURLConnectionSetFrameworkStubs on iOS for CFNetwork to be able 39 to get and set credentials as the UI process. This is also needed on Apple Silicon Macs. 40 We should eventually replace it with an even cleaner per-NSURLSession solution, but this is a step 41 in the right direction, and I verified manually that it fixes the radar. 42 43 Covered by an API test that used to fail on Apple Silicon Macs. 44 45 * Shared/mac/SecItemShim.cpp: 46 (WebKit::initializeSecItemShim): 47 1 48 2020-10-27 Russell Epstein <repstein@apple.com> 2 49 -
branches/safari-610-branch/Source/WebKit/Shared/mac/SecItemShim.cpp
r248014 r269140 144 144 globalNetworkProcess() = makeWeakPtr(process); 145 145 146 #if PLATFORM(IOS_FAMILY) 146 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && !CPU(X86_64)) 147 147 struct _CFNFrameworksStubs stubs = { 148 148 .version = 0, … … 156 156 #endif 157 157 158 #if PLATFORM(MAC) 158 #if PLATFORM(MAC) && CPU(X86_64) 159 159 const SecItemShimCallbacks callbacks = { 160 160 webSecItemCopyMatching, -
branches/safari-610-branch/Tools/ChangeLog
r269087 r269140 1 2020-10-28 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r269094. rdar://problem/70795299 4 5 Use _CFURLConnectionSetFrameworkStubs for SecItemShim instead of DYLD_INTERPOSE on Apple Silicon Macs 6 https://bugs.webkit.org/show_bug.cgi?id=218269 7 <rdar://problem/70491533> 8 9 Reviewed by Darin Adler. 10 11 Source/WebKit: 12 13 r171066 introduced the use of _CFURLConnectionSetFrameworkStubs on iOS for CFNetwork to be able 14 to get and set credentials as the UI process. This is also needed on Apple Silicon Macs. 15 We should eventually replace it with an even cleaner per-NSURLSession solution, but this is a step 16 in the right direction, and I verified manually that it fixes the radar. 17 18 Covered by an API test that used to fail on Apple Silicon Macs. 19 20 * Shared/mac/SecItemShim.cpp: 21 (WebKit::initializeSecItemShim): 22 23 Tools: 24 25 * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: 26 (TEST): 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269094 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2020-10-27 Alex Christensen <achristensen@webkit.org> 31 32 Use _CFURLConnectionSetFrameworkStubs for SecItemShim instead of DYLD_INTERPOSE on Apple Silicon Macs 33 https://bugs.webkit.org/show_bug.cgi?id=218269 34 <rdar://problem/70491533> 35 36 Reviewed by Darin Adler. 37 38 * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: 39 (TEST): 40 1 41 2020-10-27 Russell Epstein <repstein@apple.com> 2 42 -
branches/safari-610-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm
r265150 r269140 344 344 // Clear persistent credentials created by this test. 345 345 [[webView configuration].processPool _clearPermanentCredentialsForProtectionSpace:protectionSpace]; 346 } 347 348 TEST(Challenge, BasicPersistentCredential) 349 { 350 using namespace TestWebKitAPI; 351 HTTPServer server(HTTPServer::respondWithChallengeThenOK); 352 auto delegate = [[TestNavigationDelegate new] autorelease]; 353 __block RetainPtr<NSURLProtectionSpace> protectionSpace; 354 auto credentialStorage = [NSURLCredentialStorage sharedCredentialStorage]; 355 delegate.didReceiveAuthenticationChallenge = ^(WKWebView *, NSURLAuthenticationChallenge *challenge, void (^completionHandler)(NSURLSessionAuthChallengeDisposition, NSURLCredential *)) { 356 protectionSpace = challenge.protectionSpace; 357 NSURLCredential *existingCredential = [credentialStorage defaultCredentialForProtectionSpace:protectionSpace.get()]; 358 EXPECT_NULL(existingCredential); 359 EXPECT_WK_STREQ(protectionSpace.get().authenticationMethod, NSURLAuthenticationMethodHTTPBasic); 360 completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialWithUser:@"testuser" password:@"testpassword" persistence:NSURLCredentialPersistencePermanent]); 361 }; 362 auto webView = [[WKWebView new] autorelease]; 363 webView.navigationDelegate = delegate; 364 [webView loadRequest:server.request()]; 365 [delegate waitForDidFinishNavigation]; 366 367 NSURLCredential *storedCredential = nil; 368 while (!storedCredential) { 369 storedCredential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace.get()]; 370 Util::spinRunLoop(); 371 } 372 EXPECT_NOT_NULL(storedCredential); 373 EXPECT_WK_STREQ(storedCredential.user, "testuser"); 374 EXPECT_WK_STREQ(storedCredential.password, "testpassword"); 375 EXPECT_EQ(storedCredential.persistence, NSURLCredentialPersistencePermanent); 376 377 [credentialStorage removeCredential:storedCredential forProtectionSpace:protectionSpace.get()]; 378 NSURLCredential *removedCredential = [credentialStorage defaultCredentialForProtectionSpace:protectionSpace.get()]; 379 EXPECT_NULL(removedCredential); 346 380 } 347 381
Note:
See TracChangeset
for help on using the changeset viewer.