Web Inspector: Network: add button to show system certificate dialog
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 18:27:42 +0000 (18:27 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 18:27:42 +0000 (18:27 +0000)
commitad6ef76e6eca475a0794c43abcb225f0e9875ad3
tree9a7d4ec360f046a45e84785136b84cdf19dac826
parent8294da9d3a0991b99323e229aeac31fcbf4a6137
Web Inspector: Network: add button to show system certificate dialog
https://bugs.webkit.org/show_bug.cgi?id=191458
<rdar://problem/45977019>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Add `getSerializedCertificate` command.

Source/WebCore:

Test: http/tests/inspector/network/getSerializedCertificate.html

* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.

* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
(WebCore::InspectorFrontendHost::showCertificate): Added.
* inspector/InspectorFrontendClient.h:
(InspectorFrontendClient::showCertificate): Added.
* testing/Internals.cpp:
(InspectorStubFrontend::showCertificate): Added.

* platform/network/cf/CertificateInfo.h:
(WTF::Persistence::encodeCFData): Added.
(WTF::Persistence::decodeCFData): Added.
(WTF::Persistence::encodeSecTrustRef): Added.
(WTF::Persistence::decodeSecTrustRef): Added.
(WTF::Persistence::encodeCertificateChain): Added.
(WTF::Persistence::decodeCertificateChain): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
* platform/network/cf/CertificateInfoCFNet.cpp:
* platform/network/cocoa/CertificateInfoCocoa.mm:

* platform/network/curl/CertificateInfo.h:
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.

* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
(WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
(WTF::Persistence::certificateFromCertificatesDataList): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.

Source/WebInspectorUI:

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.supportsShowCertificate): Added.

* UserInterface/Models/Resource.js:
(WI.Resource.prototype.showCertificate): Added.

* UserInterface/Views/ResourceSecurityContentView.js:
(WI.ResourceSecurityContentView.prototype._refreshCetificateSection):
* UserInterface/Views/ResourceSecurityContentView.css:
(.resource-security .details > .show-certificate > .key): Added.
(.resource-security .details > .show-certificate > .key > .error): Added.

* Localizations/en.lproj/localizedStrings.js:

Source/WebKit:

* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::showCertificate): Added.
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyWPE.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformShowCertificate): Added.
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::showCertificate): Added.

* UIProcess/RemoteWebInspectorProxy.messages.in:
* UIProcess/RemoteWebInspectorProxy.h:
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::showCertificate): Added.
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(WebKit::RemoteWebInspectorProxy::platformShowCertificate): Added.
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::showCertificate): Added.

* NetworkProcess/cache/NetworkCacheCoders.h:
* NetworkProcess/cache/NetworkCacheCodersCocoa.cpp: Removed.
* NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Removed.
* NetworkProcess/cache/NetworkCacheCodersSoup.cpp: Removed.
Moved `WebCore::CertificateInfo` code for `WTF::Encoder` and `WTF::Decoder` into their
respective platform's CertificateInfo.h file.

* UIProcess/Authentication/mac/WebCredentialMac.mm:

* Configurations/WebKit.xcconfig:
* PlatformMac.cmake:
* PlatformWin.cmake:
* SourcesCocoa.txt:
* SourcesGTK.txt:
* SourcesWPE.txt:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::showCertificate): Added.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::showCertificate): Added.

* Configurations/WebKitLegacy.xcconfig:

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::showCertificate): Added.

LayoutTests:

* http/tests/inspector/network/getSerializedCertificate-expected.txt: Added.
* http/tests/inspector/network/getSerializedCertificate.html: Added.

* platform/gtk/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wpe/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
65 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/getSerializedCertificate-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/getSerializedCertificate.html [new file with mode: 0644]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
LayoutTests/platform/wpe/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Network.json
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorFrontendClient.h
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/inspector/InspectorFrontendHost.h
Source/WebCore/inspector/InspectorFrontendHost.idl
Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
Source/WebCore/inspector/agents/InspectorNetworkAgent.h
Source/WebCore/platform/network/cf/CertificateInfo.h
Source/WebCore/platform/network/cf/CertificateInfoCFNet.cpp
Source/WebCore/platform/network/cocoa/CertificateInfoCocoa.mm
Source/WebCore/platform/network/curl/CertificateInfo.h
Source/WebCore/platform/network/soup/CertificateInfo.h
Source/WebCore/testing/Internals.cpp
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
Source/WebInspectorUI/UserInterface/Models/Resource.js
Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.css
Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.js
Source/WebKit/ChangeLog
Source/WebKit/Configurations/WebKit.xcconfig
Source/WebKit/NetworkProcess/cache/NetworkCacheCoders.h
Source/WebKit/NetworkProcess/cache/NetworkCacheCodersCocoa.cpp [deleted file]
Source/WebKit/NetworkProcess/cache/NetworkCacheCodersCurl.cpp [deleted file]
Source/WebKit/NetworkProcess/cache/NetworkCacheCodersSoup.cpp [deleted file]
Source/WebKit/PlatformMac.cmake
Source/WebKit/PlatformWin.cmake
Source/WebKit/SourcesCocoa.txt
Source/WebKit/SourcesGTK.txt
Source/WebKit/SourcesWPE.txt
Source/WebKit/UIProcess/Authentication/mac/WebCredentialMac.mm
Source/WebKit/UIProcess/RemoteWebInspectorProxy.cpp
Source/WebKit/UIProcess/RemoteWebInspectorProxy.h
Source/WebKit/UIProcess/RemoteWebInspectorProxy.messages.in
Source/WebKit/UIProcess/WebInspectorProxy.cpp
Source/WebKit/UIProcess/WebInspectorProxy.h
Source/WebKit/UIProcess/WebInspectorProxy.messages.in
Source/WebKit/UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp
Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp
Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm
Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm
Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp
Source/WebKit/UIProcess/wpe/WebInspectorProxyWPE.cpp
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.cpp
Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.h
Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp
Source/WebKit/WebProcess/WebPage/WebInspectorUI.h
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/ios/WebCoreSupport/WebInspectorClientIOS.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig
Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.h
Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.h