Add a unit test for client certificate authentication
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 15:49:35 +0000 (15:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 15:49:35 +0000 (15:49 +0000)
commit146e6e35253c627ed9cbc2243adebcf7e5898420
treefed605d07b23c771863e4a66406e0f31a569d734
parent1ba6c9b8ca9145351ccb08a0147d843f0ac1ea0c
Add a unit test for client certificate authentication
https://bugs.webkit.org/show_bug.cgi?id=197800

Patch by Alex Christensen <achristensen@webkit.org> on 2019-05-14
Reviewed by Youenn Fablet.

Source/WebKit:

* Shared/cf/ArgumentCodersCF.cpp:
Move SPI declarations to SecuritySPI.h.

Source/WTF:

* wtf/spi/cocoa/SecuritySPI.h:
Move declarations from ArgumentCodersCF.cpp so they can be shared.

Tools:

Make better abstractions for reading and writing from/to TCPServer.
Add a unit test that causes a client certificate authentication challenge to happen.

* TestWebKitAPI/TCPServer.cpp:
(TestWebKitAPI::TCPServer::TCPServer):
(TestWebKitAPI::TCPServer::read):
(TestWebKitAPI::TCPServer::write):
(TestWebKitAPI::TCPServer::respondWithChallengeThenOK):
(TestWebKitAPI::TCPServer::respondWithOK):
* TestWebKitAPI/TCPServer.h:
* TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm:
(credentialWithIdentity):
(-[ChallengeDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(TEST):
(-[ClientCertificateDelegate webView:didFinishNavigation:]):
(-[ClientCertificateDelegate webView:didReceiveAuthenticationChallenge:completionHandler:]):
(-[ClientCertificateDelegate challengeCount]):
(TestWebKitAPI::TEST):
(respondWithChallengeThenOK): Deleted.
(credentialWithIdentityAndKeychainPath): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:
(TEST):
(readRequest): Deleted.
(writeResponse): Deleted.
* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):
(TestWebKitAPI::respondWithChallengeThenOK): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/spi/cocoa/SecuritySPI.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/cf/ArgumentCodersCF.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/TCPServer.cpp
Tools/TestWebKitAPI/TCPServer.h
Tools/TestWebKitAPI/Tests/WebKitCocoa/Challenge.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/PDFLinkReferrer.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/Proxy.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm