| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 5 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 delegate_.reset(verifier); | 62 delegate_.reset(verifier); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void PolicyCertVerifier::SetTrustAnchors( | 65 void PolicyCertVerifier::SetTrustAnchors( |
| 66 const net::CertificateList& trust_anchors) { | 66 const net::CertificateList& trust_anchors) { |
| 67 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 67 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 68 trust_anchors_ = trust_anchors; | 68 trust_anchors_ = trust_anchors; |
| 69 } | 69 } |
| 70 | 70 |
| 71 int PolicyCertVerifier::Verify( | 71 int PolicyCertVerifier::Verify( |
| 72 net::X509Certificate* cert, | 72 const net::CertVerifier::RequestParams& params, |
| 73 const std::string& hostname, | |
| 74 const std::string& ocsp_response, | |
| 75 int flags, | |
| 76 net::CRLSet* crl_set, | 73 net::CRLSet* crl_set, |
| 77 net::CertVerifyResult* verify_result, | 74 net::CertVerifyResult* verify_result, |
| 78 const net::CompletionCallback& completion_callback, | 75 const net::CompletionCallback& completion_callback, |
| 79 std::unique_ptr<Request>* out_req, | 76 std::unique_ptr<Request>* out_req, |
| 80 const net::BoundNetLog& net_log) { | 77 const net::BoundNetLog& net_log) { |
| 81 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 78 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 82 DCHECK(delegate_); | 79 DCHECK(delegate_); |
| 83 net::CompletionCallback wrapped_callback = | 80 net::CompletionCallback wrapped_callback = |
| 84 base::Bind(&CompleteAndSignalAnchorUse, | 81 base::Bind(&CompleteAndSignalAnchorUse, |
| 85 anchor_used_callback_, | 82 anchor_used_callback_, |
| 86 completion_callback, | 83 completion_callback, |
| 87 verify_result); | 84 verify_result); |
| 88 int error = | 85 int error = delegate_->Verify(params, crl_set, verify_result, |
| 89 delegate_->Verify(cert, hostname, ocsp_response, flags, crl_set, | 86 wrapped_callback, out_req, net_log); |
| 90 verify_result, wrapped_callback, out_req, net_log); | |
| 91 MaybeSignalAnchorUse(error, anchor_used_callback_, *verify_result); | 87 MaybeSignalAnchorUse(error, anchor_used_callback_, *verify_result); |
| 92 return error; | 88 return error; |
| 93 } | 89 } |
| 94 | 90 |
| 95 bool PolicyCertVerifier::SupportsOCSPStapling() { | 91 bool PolicyCertVerifier::SupportsOCSPStapling() { |
| 96 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 92 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 97 return delegate_->SupportsOCSPStapling(); | 93 return delegate_->SupportsOCSPStapling(); |
| 98 } | 94 } |
| 99 | 95 |
| 100 const net::CertificateList& PolicyCertVerifier::GetAdditionalTrustAnchors() { | 96 const net::CertificateList& PolicyCertVerifier::GetAdditionalTrustAnchors() { |
| 101 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 97 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 102 return trust_anchors_; | 98 return trust_anchors_; |
| 103 } | 99 } |
| 104 | 100 |
| 105 } // namespace policy | 101 } // namespace policy |
| OLD | NEW |