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

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

Issue 422063004: Certificate Transparency: Require SCTs for EV certificates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refining policy based on discussion with rsleevi Created 6 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef NET_CERT_MULTI_LOG_CT_VERIFIER_H_ 5 #ifndef NET_CERT_MULTI_LOG_CT_VERIFIER_H_
6 #define NET_CERT_MULTI_LOG_CT_VERIFIER_H_ 6 #define NET_CERT_MULTI_LOG_CT_VERIFIER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 18 matching lines...) Expand all
29 // AddLog should be called with a CTLogVerifier (which is created from the 29 // AddLog should be called with a CTLogVerifier (which is created from the
30 // log's public key). 30 // log's public key).
31 class NET_EXPORT MultiLogCTVerifier : public CTVerifier { 31 class NET_EXPORT MultiLogCTVerifier : public CTVerifier {
32 public: 32 public:
33 MultiLogCTVerifier(); 33 MultiLogCTVerifier();
34 virtual ~MultiLogCTVerifier(); 34 virtual ~MultiLogCTVerifier();
35 35
36 void AddLog(scoped_ptr<CTLogVerifier> log_verifier); 36 void AddLog(scoped_ptr<CTLogVerifier> log_verifier);
37 void AddLogs(ScopedVector<CTLogVerifier> log_verifiers); 37 void AddLogs(ScopedVector<CTLogVerifier> log_verifiers);
38 38
39 void SetEnforceCTEVPolicy(bool enforce_policy);
40
39 // CTVerifier implementation: 41 // CTVerifier implementation:
40 virtual int Verify(X509Certificate* cert, 42 virtual int Verify(X509Certificate* cert,
41 const std::string& stapled_ocsp_response, 43 const std::string& stapled_ocsp_response,
42 const std::string& sct_list_from_tls_extension, 44 const std::string& sct_list_from_tls_extension,
43 ct::CTVerifyResult* result, 45 ct::CTVerifyResult* result,
44 const BoundNetLog& net_log) OVERRIDE; 46 const BoundNetLog& net_log) OVERRIDE;
45 47
48 virtual bool DoesConformToCTEVPolicy(
49 X509Certificate* cert,
50 const ct::CTVerifyResult& ct_result) OVERRIDE;
Ryan Sleevi 2014/08/05 22:19:10 I see nothing that requires this to hang off the C
Eran Messeri 2014/10/20 17:26:30 The number of logs is necessary - but I can make t
51
46 private: 52 private:
47 // Mapping from a log's ID to the verifier for this log. 53 // Mapping from a log's ID to the verifier for this log.
48 // A log's ID is the SHA-256 of the log's key, as defined in section 3.2. 54 // A log's ID is the SHA-256 of the log's key, as defined in section 3.2.
49 // of RFC6962. 55 // of RFC6962.
50 typedef std::map<std::string, linked_ptr<CTLogVerifier> > IDToLogMap; 56 typedef std::map<std::string, linked_ptr<CTLogVerifier> > IDToLogMap;
51 57
52 // Verify a list of SCTs from |encoded_sct_list| over |expected_entry|, 58 // Verify a list of SCTs from |encoded_sct_list| over |expected_entry|,
53 // placing the verification results in |result|. The SCTs in the list 59 // placing the verification results in |result|. The SCTs in the list
54 // come from |origin| (as will be indicated in the origin field of each SCT). 60 // come from |origin| (as will be indicated in the origin field of each SCT).
55 bool VerifySCTs(const std::string& encoded_sct_list, 61 bool VerifySCTs(const std::string& encoded_sct_list,
56 const ct::LogEntry& expected_entry, 62 const ct::LogEntry& expected_entry,
57 ct::SignedCertificateTimestamp::Origin origin, 63 ct::SignedCertificateTimestamp::Origin origin,
58 ct::CTVerifyResult* result); 64 ct::CTVerifyResult* result);
59 65
60 // Verifies a single, parsed SCT against all logs. 66 // Verifies a single, parsed SCT against all logs.
61 bool VerifySingleSCT( 67 bool VerifySingleSCT(
62 scoped_refptr<ct::SignedCertificateTimestamp> sct, 68 scoped_refptr<ct::SignedCertificateTimestamp> sct,
63 const ct::LogEntry& expected_entry, 69 const ct::LogEntry& expected_entry,
64 ct::CTVerifyResult* result); 70 ct::CTVerifyResult* result);
65 71
66 IDToLogMap logs_; 72 IDToLogMap logs_;
73 bool enforce_ct_ev_policy_;
67 74
68 DISALLOW_COPY_AND_ASSIGN(MultiLogCTVerifier); 75 DISALLOW_COPY_AND_ASSIGN(MultiLogCTVerifier);
69 }; 76 };
70 77
71 } // namespace net 78 } // namespace net
72 79
73 #endif // NET_CERT_MULTI_LOG_CT_VERIFIER_H_ 80 #endif // NET_CERT_MULTI_LOG_CT_VERIFIER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698