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

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

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, 7 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
« no previous file with comments | « net/cert/cert_verify_proc_win.cc ('k') | net/cert/mock_cert_verifier.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_CERT_MOCK_CERT_VERIFIER_H_ 5 #ifndef NET_CERT_MOCK_CERT_VERIFIER_H_
6 #define NET_CERT_MOCK_CERT_VERIFIER_H_ 6 #define NET_CERT_MOCK_CERT_VERIFIER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "net/cert/cert_verifier.h" 10 #include "net/cert/cert_verifier.h"
11 #include "net/cert/cert_verify_result.h" 11 #include "net/cert/cert_verify_result.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 class MockCertVerifier : public CertVerifier { 15 class MockCertVerifier : public CertVerifier {
16 public: 16 public:
17 // Creates a new MockCertVerifier. By default, any call to Verify() will 17 // Creates a new MockCertVerifier. By default, any call to Verify() will
18 // result in the cert status being flagged as CERT_STATUS_INVALID and return 18 // result in the cert status being flagged as CERT_STATUS_INVALID and return
19 // an ERR_CERT_INVALID network error code. This behaviour can be overridden 19 // an ERR_CERT_INVALID network error code. This behaviour can be overridden
20 // by calling set_default_result() to change the default return value for 20 // by calling set_default_result() to change the default return value for
21 // Verify() or by calling one of the AddResult*() methods to specifically 21 // Verify() or by calling one of the AddResult*() methods to specifically
22 // handle a certificate or certificate and host. 22 // handle a certificate or certificate and host.
23 MockCertVerifier(); 23 MockCertVerifier();
24 24
25 ~MockCertVerifier() override; 25 ~MockCertVerifier() override;
26 26
27 // CertVerifier implementation 27 // CertVerifier implementation
28 int Verify(X509Certificate* cert, 28 int Verify(X509Certificate* cert,
29 const std::string& hostname, 29 const std::string& hostname,
30 const std::string& ocsp_response,
30 int flags, 31 int flags,
31 CRLSet* crl_set, 32 CRLSet* crl_set,
32 CertVerifyResult* verify_result, 33 CertVerifyResult* verify_result,
33 const CompletionCallback& callback, 34 const CompletionCallback& callback,
34 RequestHandle* out_req, 35 RequestHandle* out_req,
35 const BoundNetLog& net_log) override; 36 const BoundNetLog& net_log) override;
36 void CancelRequest(RequestHandle req) override; 37 void CancelRequest(RequestHandle req) override;
37 38
38 // Sets the default return value for Verify() for certificates/hosts that do 39 // Sets the default return value for Verify() for certificates/hosts that do
39 // not have explicit results added via the AddResult*() methods. 40 // not have explicit results added via the AddResult*() methods.
(...skipping 20 matching lines...) Expand all
60 struct Rule; 61 struct Rule;
61 typedef std::list<Rule> RuleList; 62 typedef std::list<Rule> RuleList;
62 63
63 int default_result_; 64 int default_result_;
64 RuleList rules_; 65 RuleList rules_;
65 }; 66 };
66 67
67 } // namespace net 68 } // namespace net
68 69
69 #endif // NET_CERT_MOCK_CERT_VERIFIER_H_ 70 #endif // NET_CERT_MOCK_CERT_VERIFIER_H_
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc_win.cc ('k') | net/cert/mock_cert_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698