haikuwebkit/Source/WebKit/Shared/soup
Carlos Garcia Campos 1e5a979138 [GTK][WPE] Expose support for client certificate auth
https://bugs.webkit.org/show_bug.cgi?id=200805

Reviewed by Michael Catanzaro.

.:

Bump libsoup3 required version.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

* platform/Soup.cmake:
* platform/SourcesSoup.txt:
* platform/network/Credential.h:
* platform/network/ProtectionSpaceBase.cpp:
(WebCore::ProtectionSpaceBase::isPasswordBased const):
* platform/network/ProtectionSpaceBase.h:
* platform/network/soup/AuthenticationChallenge.h:
* platform/network/soup/AuthenticationChallengeSoup.cpp:
(WebCore::protectionSpaceForClientCertificate):
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::protectionSpaceForClientCertificatePassword):
(WebCore::AuthenticationChallenge::platformCompare):
* platform/network/soup/CertificateInfoSoup.cpp:
(WebCore::CertificateInfo::isolatedCopy const):
* platform/network/soup/CredentialSoup.cpp: Added.
(WebCore::Credential::Credential):
(WebCore::m_certificate):
(WebCore::Credential::isEmpty const):
(WebCore::Credential::platformCompare):
* platform/network/soup/CredentialSoup.h: Added.
(WebCore::Credential::Credential):
(WebCore::Credential::encodingRequiresPlatformData const):
(WebCore::Credential::certificate const):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::authTypeFromProtectionSpaceAuthenticationScheme):

Source/WebKit:

Add new API to handle certificate and pin certificate authentication requests.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest):
(WebKit::NetworkDataTaskSoup::completeAuthentication):
(WebKit::NetworkDataTaskSoup::cancelAuthentication):
(WebKit::NetworkDataTaskSoup::authenticate):
(WebKit::NetworkDataTaskSoup::continueAuthenticate):
(WebKit::NetworkDataTaskSoup::requestCertificateCallback):
(WebKit::NetworkDataTaskSoup::requestCertificatePasswordCallback):
* NetworkProcess/soup/NetworkDataTaskSoup.h:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<AuthenticationChallenge>::encode):
(IPC::ArgumentCoder<AuthenticationChallenge>::decode):
* Shared/glib/ArgumentCodersGLib.cpp:
(IPC::ArgumentCoder<GRefPtr<GTlsCertificate>>::encode):
(IPC::ArgumentCoder<GRefPtr<GTlsCertificate>>::decode):
* Shared/soup/WebCoreArgumentCodersSoup.cpp:
(IPC::ArgumentCoder<Credential>::encodePlatformData):
(IPC::ArgumentCoder<Credential>::decodePlatformData):
* UIProcess/API/glib/WebKitAuthenticationRequest.cpp:
(webkit_authentication_request_get_certificate_pin_flags):
* UIProcess/API/glib/WebKitCredential.cpp:
(webkit_credential_new_for_certificate_pin):
(webkit_credential_new_for_certificate):
(webkit_credential_get_certificate):
* UIProcess/API/gtk/WebKitAuthenticationRequest.h:
* UIProcess/API/gtk/WebKitCredential.h:
* UIProcess/API/gtk/WebKitWebViewGtk.cpp:
(webkitWebViewAuthenticate):
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitAuthenticationRequest.h:
* UIProcess/API/wpe/WebKitCredential.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

Tools:

Add a simple implementation in MiniBrowser using a file chooser to ask for the certificate from a file and unit
tests for the client certificate request. Unfortunately we can't easily test pin certificates.

* MiniBrowser/gtk/BrowserTab.c:
(certificateDialogResponse):
(webViewAuthenticate):
(browserTabConstructed):
* TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp:
(ClientSideCertificateTest::acceptCertificateCallback):
(ClientSideCertificateTest::requestStartedCallback):
(ClientSideCertificateTest::authenticateCallback):
(ClientSideCertificateTest::ClientSideCertificateTest):
(ClientSideCertificateTest::~ClientSideCertificateTest):
(ClientSideCertificateTest::authenticate):
(ClientSideCertificateTest::acceptCertificate):
(ClientSideCertificateTest::waitForAuthenticationRequest):
(testClientSideCertificate):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp:
* TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.h:
(WebKitTestServer::soupServer const):

Canonical link: https://commits.webkit.org/239625@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-13 14:19:38 +00:00
..
SoupCookiePersistentStorageType.h
WebCoreArgumentCodersSoup.cpp [GTK][WPE] Expose support for client certificate auth 2021-07-13 14:19:38 +00:00
WebErrorsSoup.cpp