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

Side by Side Diff: net/cert/mock_cert_verifier.cc

Issue 1081913003: Route OCSP stapling through CertVerifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@boringnss
Patch Set: split remoting fix out separately 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/cert/mock_cert_verifier.h" 5 #include "net/cert/mock_cert_verifier.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/cert/cert_status_flags.h" 10 #include "net/cert/cert_status_flags.h"
(...skipping 20 matching lines...) Expand all
31 CertVerifyResult result; 31 CertVerifyResult result;
32 int rv; 32 int rv;
33 }; 33 };
34 34
35 MockCertVerifier::MockCertVerifier() : default_result_(ERR_CERT_INVALID) {} 35 MockCertVerifier::MockCertVerifier() : default_result_(ERR_CERT_INVALID) {}
36 36
37 MockCertVerifier::~MockCertVerifier() {} 37 MockCertVerifier::~MockCertVerifier() {}
38 38
39 int MockCertVerifier::Verify(X509Certificate* cert, 39 int MockCertVerifier::Verify(X509Certificate* cert,
40 const std::string& hostname, 40 const std::string& hostname,
41 const std::string& ocsp_response,
41 int flags, 42 int flags,
42 CRLSet* crl_set, 43 CRLSet* crl_set,
43 CertVerifyResult* verify_result, 44 CertVerifyResult* verify_result,
44 const CompletionCallback& callback, 45 const CompletionCallback& callback,
45 RequestHandle* out_req, 46 RequestHandle* out_req,
46 const BoundNetLog& net_log) { 47 const BoundNetLog& net_log) {
47 RuleList::const_iterator it; 48 RuleList::const_iterator it;
48 for (it = rules_.begin(); it != rules_.end(); ++it) { 49 for (it = rules_.begin(); it != rules_.end(); ++it) {
49 // Check just the server cert. Intermediates will be ignored. 50 // Check just the server cert. Intermediates will be ignored.
50 if (!it->cert->Equals(cert)) 51 if (!it->cert->Equals(cert))
(...skipping 23 matching lines...) Expand all
74 void MockCertVerifier::AddResultForCertAndHost( 75 void MockCertVerifier::AddResultForCertAndHost(
75 X509Certificate* cert, 76 X509Certificate* cert,
76 const std::string& host_pattern, 77 const std::string& host_pattern,
77 const CertVerifyResult& verify_result, 78 const CertVerifyResult& verify_result,
78 int rv) { 79 int rv) {
79 Rule rule(cert, host_pattern, verify_result, rv); 80 Rule rule(cert, host_pattern, verify_result, rv);
80 rules_.push_back(rule); 81 rules_.push_back(rule);
81 } 82 }
82 83
83 } // namespace net 84 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698