Skip to content

Commit 9706121

Browse files
REGRESSION: LayoutTest http/tests/security/credentials-iframes.html is failing on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=167967 Reviewed by Brady Eidson. Source/WebCore: XHR credentials have a persistence of CredentialPersistenceNone because we keep them in the WebCore::CredentialStorage. We were storing them to CFNetwork's NSURLCredentialStorage on iOS and then they were being given as the proposedCredential in NetworkDataTaskCocoa::tryPasswordBasedAuthentication even though we set CredentialPersistenceNone. This fixes http/tests/security/credentials-iframes.html * platform/network/CredentialStorage.cpp: (WebCore::CredentialStorage::set): * platform/network/CredentialStorage.h: * platform/network/cf/CredentialStorageCFNet.cpp: (WebCore::CredentialStorage::saveToPersistentStorage): Deleted. * platform/network/mac/CredentialStorageMac.mm: (WebCore::CredentialStorage::saveToPersistentStorage): Deleted. LayoutTests: * platform/ios-simulator/TestExpectations: Canonical link: https://commits.webkit.org/185956@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 24716d7 commit 9706121

7 files changed

Lines changed: 31 additions & 35 deletions

File tree

LayoutTests/ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2017-02-28 Alex Christensen <achristensen@webkit.org>
2+
3+
REGRESSION: LayoutTest http/tests/security/credentials-iframes.html is failing on ios-simulator
4+
https://bugs.webkit.org/show_bug.cgi?id=167967
5+
6+
Reviewed by Brady Eidson.
7+
8+
* platform/ios-simulator/TestExpectations:
9+
110
2017-02-27 Antoine Quint <graouts@apple.com>
211

312
[Modern Media Controls] Use compact mode by default on macOS

LayoutTests/platform/ios-simulator/TestExpectations

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,8 +2869,6 @@ webkit.org/b/167211 imported/w3c/web-platform-tests/html/browsers/history/the-lo
28692869

28702870
webkit.org/b/167619 css3/filters/backdrop/dynamic-with-clip-path.html [ ImageOnlyFailure ]
28712871

2872-
webkit.org/b/167967 http/tests/security/credentials-iframes.html [ Failure ]
2873-
28742872
webkit.org/b/168054 compositing/masks/solid-color-masked.html [ ImageOnlyFailure ]
28752873

28762874
webkit.org/b/168215 imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click.html [ Skip ]

Source/WebCore/ChangeLog

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
2017-02-28 Alex Christensen <achristensen@webkit.org>
2+
3+
REGRESSION: LayoutTest http/tests/security/credentials-iframes.html is failing on ios-simulator
4+
https://bugs.webkit.org/show_bug.cgi?id=167967
5+
6+
Reviewed by Brady Eidson.
7+
8+
XHR credentials have a persistence of CredentialPersistenceNone because we keep
9+
them in the WebCore::CredentialStorage. We were storing them to CFNetwork's NSURLCredentialStorage
10+
on iOS and then they were being given as the proposedCredential in
11+
NetworkDataTaskCocoa::tryPasswordBasedAuthentication even though we set CredentialPersistenceNone.
12+
13+
This fixes http/tests/security/credentials-iframes.html
14+
15+
* platform/network/CredentialStorage.cpp:
16+
(WebCore::CredentialStorage::set):
17+
* platform/network/CredentialStorage.h:
18+
* platform/network/cf/CredentialStorageCFNet.cpp:
19+
(WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
20+
* platform/network/mac/CredentialStorageMac.mm:
21+
(WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
22+
123
2017-02-27 Alex Christensen <achristensen@webkit.org>
224

325
Fix WinCairo build.

Source/WebCore/platform/network/CredentialStorage.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ void CredentialStorage::set(const String& partitionName, const Credential& crede
7070

7171
m_protectionSpaceToCredentialMap.set(std::make_pair(partitionName, protectionSpace), credential);
7272

73-
#if PLATFORM(IOS)
74-
if (protectionSpace.authenticationScheme() != ProtectionSpaceAuthenticationSchemeClientCertificateRequested)
75-
saveToPersistentStorage(protectionSpace, credential);
76-
#endif
77-
7873
if (!protectionSpace.isProxy() && protectionSpace.authenticationScheme() != ProtectionSpaceAuthenticationSchemeClientCertificateRequested) {
7974
m_originsWithCredentials.add(originStringFromURL(url));
8075

Source/WebCore/platform/network/CredentialStorage.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ class CredentialStorage {
5252

5353
WEBCORE_EXPORT void clearCredentials();
5454

55-
#if PLATFORM(IOS)
56-
void saveToPersistentStorage(const ProtectionSpace&, const Credential&);
57-
#endif
58-
5955
// These methods work for authentication schemes that support sending credentials without waiting for a request. E.g., for HTTP Basic authentication scheme
6056
// a client should assume that all paths at or deeper than the depth of a known protected resource share are within the same protection space.
6157
WEBCORE_EXPORT bool set(const String&, const Credential&, const URL&); // Returns true if the URL corresponds to a known protection space, so credentials could be updated.

Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,6 @@ Credential CredentialStorage::getFromPersistentStorage(const ProtectionSpace& pr
6464
#endif
6565
}
6666

67-
#if PLATFORM(IOS)
68-
void CredentialStorage::saveToPersistentStorage(const ProtectionSpace& protectionSpace, const Credential& credential)
69-
{
70-
RetainPtr<CFURLCredentialStorageRef> storageCF = adoptCF(CFURLCredentialStorageCreate(0));
71-
72-
if (credential.persistence() == CredentialPersistenceNone) {
73-
Credential sessionCredential(credential, CredentialPersistenceForSession);
74-
CFURLCredentialStorageSetDefaultCredentialForProtectionSpace(storageCF.get(), sessionCredential.cfCredential(), protectionSpace.cfSpace());
75-
} else
76-
CFURLCredentialStorageSetDefaultCredentialForProtectionSpace(storageCF.get(), credential.cfCredential(), protectionSpace.cfSpace());
77-
}
78-
#endif
79-
8067
} // namespace WebCore
8168

8269
#endif // USE(CFURLCONNECTION)

Source/WebCore/platform/network/mac/CredentialStorageMac.mm

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@
4040
return credential ? Credential(credential) : Credential();
4141
}
4242

43-
#if PLATFORM(IOS)
44-
void CredentialStorage::saveToPersistentStorage(const ProtectionSpace& protectionSpace, const Credential& credential)
45-
{
46-
if (credential.persistence() == CredentialPersistenceNone) {
47-
Credential sessionCredential(credential, CredentialPersistenceForSession);
48-
[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:sessionCredential.nsCredential() forProtectionSpace:protectionSpace.nsSpace()];
49-
} else
50-
[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential.nsCredential() forProtectionSpace:protectionSpace.nsSpace()];
51-
}
52-
#endif
53-
5443
} // namespace WebCore
5544

5645
#endif // !USE(CFURLCONNECTION)

0 commit comments

Comments
 (0)