| Index: net/cert/caching_cert_verifier.cc
|
| diff --git a/net/cert/caching_cert_verifier.cc b/net/cert/caching_cert_verifier.cc
|
| index 764c2ab6f02bbe0ac77c218fd420f19e78a055be..1b053853e620ead2fa36553d05eb4aa4ca10e540 100644
|
| --- a/net/cert/caching_cert_verifier.cc
|
| +++ b/net/cert/caching_cert_verifier.cc
|
| @@ -6,7 +6,6 @@
|
|
|
| #include "base/time/time.h"
|
| #include "net/base/net_errors.h"
|
| -#include "net/cert/cert_trust_anchor_provider.h"
|
|
|
| namespace net {
|
|
|
| @@ -22,7 +21,6 @@ const unsigned kTTLSecs = 1800; // 30 minutes.
|
|
|
| CachingCertVerifier::CachingCertVerifier(std::unique_ptr<CertVerifier> verifier)
|
| : verifier_(std::move(verifier)),
|
| - trust_anchor_provider_(nullptr),
|
| cache_(kMaxCacheEntries),
|
| requests_(0u),
|
| cache_hits_(0u) {
|
| @@ -33,12 +31,6 @@ CachingCertVerifier::~CachingCertVerifier() {
|
| CertDatabase::GetInstance()->RemoveObserver(this);
|
| }
|
|
|
| -void CachingCertVerifier::SetCertTrustAnchorProvider(
|
| - CertTrustAnchorProvider* trust_anchor_provider) {
|
| - DCHECK(!trust_anchor_provider_);
|
| - trust_anchor_provider_ = trust_anchor_provider;
|
| -}
|
| -
|
| int CachingCertVerifier::Verify(const CertVerifier::RequestParams& params,
|
| CRLSet* crl_set,
|
| CertVerifyResult* verify_result,
|
| @@ -49,19 +41,8 @@ int CachingCertVerifier::Verify(const CertVerifier::RequestParams& params,
|
|
|
| requests_++;
|
|
|
| - CertificateList additional_trust_anchors(params.additional_trust_anchors());
|
| - if (trust_anchor_provider_) {
|
| - const CertificateList& trust_anchors =
|
| - trust_anchor_provider_->GetAdditionalTrustAnchors();
|
| - additional_trust_anchors.insert(additional_trust_anchors.begin(),
|
| - trust_anchors.begin(), trust_anchors.end());
|
| - }
|
| -
|
| - const CertVerifier::RequestParams new_params(
|
| - params.certificate(), params.hostname(), params.flags(),
|
| - params.ocsp_response(), additional_trust_anchors);
|
| const CertVerificationCache::value_type* cached_entry =
|
| - cache_.Get(new_params, CacheValidityPeriod(base::Time::Now()));
|
| + cache_.Get(params, CacheValidityPeriod(base::Time::Now()));
|
| if (cached_entry) {
|
| ++cache_hits_;
|
| *verify_result = cached_entry->result;
|
| @@ -70,13 +51,13 @@ int CachingCertVerifier::Verify(const CertVerifier::RequestParams& params,
|
|
|
| base::Time start_time = base::Time::Now();
|
| CompletionCallback caching_callback = base::Bind(
|
| - &CachingCertVerifier::OnRequestFinished, base::Unretained(this),
|
| - new_params, start_time, callback, verify_result);
|
| - int result = verifier_->Verify(new_params, crl_set, verify_result,
|
| + &CachingCertVerifier::OnRequestFinished, base::Unretained(this), params,
|
| + start_time, callback, verify_result);
|
| + int result = verifier_->Verify(params, crl_set, verify_result,
|
| caching_callback, out_req, net_log);
|
| if (result != ERR_IO_PENDING) {
|
| // Synchronous completion; add directly to cache.
|
| - AddResultToCache(new_params, start_time, *verify_result, result);
|
| + AddResultToCache(params, start_time, *verify_result, result);
|
| }
|
|
|
| return result;
|
|
|