[Curl] Embed certificate information into ResourceResponse.
authorBasuke.Suzuki@sony.com <Basuke.Suzuki@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2018 21:38:22 +0000 (21:38 +0000)
committerBasuke.Suzuki@sony.com <Basuke.Suzuki@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jul 2018 21:38:22 +0000 (21:38 +0000)
commitd0c52c933cf9df6ec60bbdd2ad500823aa9f4110
tree50314a20664a090ab5b05a1ffa69da1b6a6887bb
parent882587c91952fd46109065714d967f091c6d36c9
[Curl] Embed certificate information into ResourceResponse.
https://bugs.webkit.org/show_bug.cgi?id=187102

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests but tested internally.

Collect certificate information from the communication and put them into
ResourceResponse for the sake of advanced security checking and information
providing to the user.

* platform/Curl.cmake:
* platform/network/curl/CertificateInfo.cpp: Copied from Source/WebCore/platform/network/curl/CertificateInfo.h.
(WebCore::CertificateInfo::CertificateInfo):
(WebCore::CertificateInfo::isolatedCopy const):
(WebCore::CertificateInfo::makeCertificate):
* platform/network/curl/CertificateInfo.h:
(WebCore::CertificateInfo::verificationError const):
(WebCore::CertificateInfo::certificateChain const):
(WebCore::operator==):
(WebCore::CertificateInfo::CertificateInfo): Deleted.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didCompleteTransfer):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::getCertificateInfo const):
(WebCore::CurlRequest::getNetworkLoadMetrics const):
(WebCore::CurlRequest::getNetworkLoadMetrics): Deleted.
* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
(WebCore::CurlResourceHandleDelegate::curlDidComplete):
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
(WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
(WebCore::CurlSSLVerifier::verifyCallback):
(WebCore::StackOfX509::StackOfX509): For RAII. Used in pemDataFromCtx().
(WebCore::StackOfX509::~StackOfX509): Ditto.
(WebCore::StackOfX509::count): Ditto.
(WebCore::StackOfX509::item): Ditto.
(WebCore::BIOHolder::BIOHolder): Ditto.
(WebCore::BIOHolder::~BIOHolder): Ditto.
(WebCore::BIOHolder::write): Ditto.
(WebCore::BIOHolder::asCertificate): Ditto.
(WebCore::pemDataFromCtx): Become simple static function.
(WebCore::convertToSSLCertificateFlags): Ditto.
(WebCore::CurlSSLVerifier::certVerifyCallback): Deleted.
(WebCore::CurlSSLVerifier::getPemDataFromCtx): Deleted.
(WebCore::CurlSSLVerifier::convertToSSLCertificateFlags): Deleted.
* platform/network/curl/CurlSSLVerifier.h:
(WebCore::CurlSSLVerifier::verificationError):
(WebCore::CurlSSLVerifier::certificateChain const):
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceErrorCurl.cpp:
(WebCore::ResourceError::isSSLConnectError const):
(WebCore::ResourceError::isSSLCertVerificationError const):
(WebCore::ResourceError::hasSSLConnectError const): Deleted.
* platform/network/curl/ResourceResponse.h:
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::setCertificateInfo):
(WebCore::ResourceResponse::setDeprecatedNetworkLoadMetrics):

Source/WebKit:

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::curlDidComplete):.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/Curl.cmake
Source/WebCore/platform/network/curl/CertificateInfo.cpp [new file with mode: 0644]
Source/WebCore/platform/network/curl/CertificateInfo.h
Source/WebCore/platform/network/curl/CurlRequest.cpp
Source/WebCore/platform/network/curl/CurlRequest.h
Source/WebCore/platform/network/curl/CurlResourceHandleDelegate.cpp
Source/WebCore/platform/network/curl/CurlSSLHandle.cpp
Source/WebCore/platform/network/curl/CurlSSLHandle.h
Source/WebCore/platform/network/curl/CurlSSLVerifier.cpp
Source/WebCore/platform/network/curl/CurlSSLVerifier.h
Source/WebCore/platform/network/curl/ResourceError.h
Source/WebCore/platform/network/curl/ResourceErrorCurl.cpp
Source/WebCore/platform/network/curl/ResourceResponse.h
Source/WebCore/platform/network/curl/ResourceResponseCurl.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp