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