Changeset 269094 in webkit
- Timestamp:
- Oct 27, 2020 8:03:28 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r269084 r269094 1 2020-10-27 Alex Christensen <achristensen@webkit.org> 2 3 Use _CFURLConnectionSetFrameworkStubs for SecItemShim instead of DYLD_INTERPOSE on Apple Silicon Macs 4 https://bugs.webkit.org/show_bug.cgi?id=218269 5 <rdar://problem/70491533> 6 7 Reviewed by Darin Adler. 8 9 r171066 introduced the use of _CFURLConnectionSetFrameworkStubs on iOS for CFNetwork to be able 10 to get and set credentials as the UI process. This is also needed on Apple Silicon Macs. 11 We should eventually replace it with an even cleaner per-NSURLSession solution, but this is a step 12 in the right direction, and I verified manually that it fixes the radar. 13 14 Covered by an API test that used to fail on Apple Silicon Macs. 15 16 * Shared/mac/SecItemShim.cpp: 17 (WebKit::initializeSecItemShim): 18 1 19 2020-10-27 Said Abou-Hallawa <said@apple.com> 2 20 -
trunk/Source/WebKit/Shared/mac/SecItemShim.cpp
r248014 r269094 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, -
trunk/Tools/ChangeLog
r269080 r269094 1 2020-10-27 Alex Christensen <achristensen@webkit.org> 2 3 Use _CFURLConnectionSetFrameworkStubs for SecItemShim instead of DYLD_INTERPOSE on Apple Silicon Macs 4 https://bugs.webkit.org/show_bug.cgi?id=218269 5 <rdar://problem/70491533> 6 7 Reviewed by Darin Adler. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm: 10 (TEST): 11 1 12 2020-10-27 Sam Weinig <weinig@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm
r268796 r269094 365 365 // Clear persistent credentials created by this test. 366 366 [[webView configuration].processPool _clearPermanentCredentialsForProtectionSpace:protectionSpace]; 367 } 368 369 TEST(Challenge, BasicPersistentCredential) 370 { 371 using namespace TestWebKitAPI; 372 HTTPServer server(HTTPServer::respondWithChallengeThenOK); 373 auto delegate = [[TestNavigationDelegate new] autorelease]; 374 __block RetainPtr<NSURLProtectionSpace> protectionSpace; 375 auto credentialStorage = [NSURLCredentialStorage sharedCredentialStorage]; 376 delegate.didReceiveAuthenticationChallenge = ^(WKWebView *, NSURLAuthenticationChallenge *challenge, void (^completionHandler)(NSURLSessionAuthChallengeDisposition, NSURLCredential *)) { 377 protectionSpace = challenge.protectionSpace; 378 NSURLCredential *existingCredential = [credentialStorage defaultCredentialForProtectionSpace:protectionSpace.get()]; 379 EXPECT_NULL(existingCredential); 380 EXPECT_WK_STREQ(protectionSpace.get().authenticationMethod, NSURLAuthenticationMethodHTTPBasic); 381 completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialWithUser:@"testuser" password:@"testpassword" persistence:NSURLCredentialPersistencePermanent]); 382 }; 383 auto webView = [[WKWebView new] autorelease]; 384 webView.navigationDelegate = delegate; 385 [webView loadRequest:server.request()]; 386 [delegate waitForDidFinishNavigation]; 387 388 NSURLCredential *storedCredential = nil; 389 while (!storedCredential) { 390 storedCredential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace.get()]; 391 Util::spinRunLoop(); 392 } 393 EXPECT_NOT_NULL(storedCredential); 394 EXPECT_WK_STREQ(storedCredential.user, "testuser"); 395 EXPECT_WK_STREQ(storedCredential.password, "testpassword"); 396 EXPECT_EQ(storedCredential.persistence, NSURLCredentialPersistencePermanent); 397 398 [credentialStorage removeCredential:storedCredential forProtectionSpace:protectionSpace.get()]; 399 NSURLCredential *removedCredential = [credentialStorage defaultCredentialForProtectionSpace:protectionSpace.get()]; 400 EXPECT_NULL(removedCredential); 367 401 } 368 402
Note: See TracChangeset
for help on using the changeset viewer.