| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 int PolicyCertVerifier::Verify( | 71 int PolicyCertVerifier::Verify( |
| 72 net::X509Certificate* cert, | 72 net::X509Certificate* cert, |
| 73 const std::string& hostname, | 73 const std::string& hostname, |
| 74 const std::string& ocsp_response, | 74 const std::string& ocsp_response, |
| 75 int flags, | 75 int flags, |
| 76 net::CRLSet* crl_set, | 76 net::CRLSet* crl_set, |
| 77 net::CertVerifyResult* verify_result, | 77 net::CertVerifyResult* verify_result, |
| 78 const net::CompletionCallback& completion_callback, | 78 const net::CompletionCallback& completion_callback, |
| 79 RequestHandle* out_req, | 79 scoped_ptr<Request>* out_req, |
| 80 const net::BoundNetLog& net_log) { | 80 const net::BoundNetLog& net_log) { |
| 81 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 81 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| 82 DCHECK(delegate_); | 82 DCHECK(delegate_); |
| 83 net::CompletionCallback wrapped_callback = | 83 net::CompletionCallback wrapped_callback = |
| 84 base::Bind(&CompleteAndSignalAnchorUse, | 84 base::Bind(&CompleteAndSignalAnchorUse, |
| 85 anchor_used_callback_, | 85 anchor_used_callback_, |
| 86 completion_callback, | 86 completion_callback, |
| 87 verify_result); | 87 verify_result); |
| 88 int error = | 88 int error = |
| 89 delegate_->Verify(cert, hostname, ocsp_response, flags, crl_set, | 89 delegate_->Verify(cert, hostname, ocsp_response, flags, crl_set, |
| 90 verify_result, wrapped_callback, out_req, net_log); | 90 verify_result, wrapped_callback, out_req, net_log); |
| 91 MaybeSignalAnchorUse(error, anchor_used_callback_, *verify_result); | 91 MaybeSignalAnchorUse(error, anchor_used_callback_, *verify_result); |
| 92 return error; | 92 return error; |
| 93 } | 93 } |
| 94 | 94 |
| 95 void PolicyCertVerifier::CancelRequest(RequestHandle req) { | |
| 96 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | |
| 97 delegate_->CancelRequest(req); | |
| 98 } | |
| 99 | |
| 100 bool PolicyCertVerifier::SupportsOCSPStapling() { | 95 bool PolicyCertVerifier::SupportsOCSPStapling() { |
| 101 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 96 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| 102 return delegate_->SupportsOCSPStapling(); | 97 return delegate_->SupportsOCSPStapling(); |
| 103 } | 98 } |
| 104 | 99 |
| 105 const net::CertificateList& PolicyCertVerifier::GetAdditionalTrustAnchors() { | 100 const net::CertificateList& PolicyCertVerifier::GetAdditionalTrustAnchors() { |
| 106 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 101 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| 107 return trust_anchors_; | 102 return trust_anchors_; |
| 108 } | 103 } |
| 109 | 104 |
| 110 } // namespace policy | 105 } // namespace policy |
| OLD | NEW |