Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: chrome/browser/chromeos/policy/policy_cert_verifier.cc

Issue 1081913003: Route OCSP stapling through CertVerifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@boringnss
Patch Set: yet another CrOS-only Verify call Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698