Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_CERT_MULTI_LOG_CT_VERIFIER_H_ | |
| 6 #define NET_CERT_MULTI_LOG_CT_VERIFIER_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/memory/linked_ptr.h" | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "net/base/net_export.h" | |
| 14 #include "net/cert/ct_verifier.h" | |
| 15 #include "net/cert/signed_certificate_timestamp.h" | |
| 16 | |
| 17 namespace net { | |
| 18 | |
| 19 namespace ct { | |
| 20 struct LogEntry; | |
| 21 } // namespace ct | |
| 22 | |
| 23 class CTLogVerifier; | |
| 24 | |
| 25 // A Certificate Transparency verifier that can verifies Signed Certificate | |
|
wtc
2013/11/21 02:05:02
Nit: can verifies => can verify
Eran M. (Google)
2013/11/21 20:06:02
Done.
| |
| 26 // Timestamps from multiple logs. | |
| 27 // There should be a global instance of this class and for all known logs, | |
| 28 // AddLog should be called with a CTLogVerifier (which is created from the | |
| 29 // Log's public key). | |
|
wtc
2013/11/21 02:05:02
Nit: "Log's" doesn't need to be capitalized
Eran M. (Google)
2013/11/21 20:06:02
Done.
| |
| 30 class NET_EXPORT MultiLogCTVerifier : public CTVerifier { | |
| 31 public: | |
| 32 explicit MultiLogCTVerifier(); | |
|
wtc
2013/11/21 02:05:02
Remove "explicit". It's only necessary for constru
Eran M. (Google)
2013/11/21 20:06:02
Done.
| |
| 33 virtual ~MultiLogCTVerifier(); | |
| 34 | |
| 35 void AddLog(scoped_ptr<CTLogVerifier> log_verifier); | |
| 36 | |
| 37 // CTVerifier implementation: | |
| 38 virtual int Verify(X509Certificate* verified_cert, | |
|
wtc
2013/11/21 02:05:02
Nit: we should simply name this parameter |cert|.
Eran M. (Google)
2013/11/21 20:06:02
Done.
| |
| 39 const std::string& sct_list_from_ocsp, | |
| 40 const std::string& sct_list_from_tls_handshake, | |
|
wtc
2013/11/21 02:05:02
Nit: change "from_tls_handshake" to "from_tls_exte
Eran M. (Google)
2013/11/21 20:06:02
Done.
| |
| 41 ct::CTVerifyResult* result) OVERRIDE; | |
| 42 | |
| 43 private: | |
| 44 // Verify a list of SCTs from |encoded_sct_list|, placing the verification | |
| 45 // results in |result|. Fills in the origin field of each SCT from | |
| 46 // |origin|. | |
|
wtc
2013/11/21 02:05:02
1. Nit: "Fills in the origin field of each SCT fro
Eran M. (Google)
2013/11/21 20:06:02
Done.
| |
| 47 bool VerifySCTs(const std::string& encoded_sct_list, | |
| 48 const ct::LogEntry& expected_entry, | |
| 49 ct::SignedCertificateTimestamp::Origin origin, | |
| 50 ct::CTVerifyResult* result); | |
| 51 | |
| 52 // Verifies a single, parsed SCT against all logs. | |
| 53 bool VerifySingleSCT( | |
| 54 const ct::SignedCertificateTimestamp& sct, | |
| 55 const ct::LogEntry& expected_entry, | |
| 56 ct::CTVerifyResult* result); | |
| 57 | |
| 58 typedef std::map<std::string, linked_ptr<CTLogVerifier> > IDToLogMap; | |
|
wtc
2013/11/21 02:05:02
1. Nit: typedef should be listed at the beginning
Eran M. (Google)
2013/11/21 20:06:02
1. Done
2. You're right - the ID is a hash of the
| |
| 59 IDToLogMap logs_; | |
| 60 | |
| 61 DISALLOW_COPY_AND_ASSIGN(MultiLogCTVerifier); | |
| 62 }; | |
| 63 | |
| 64 } // namespace net | |
| 65 | |
| 66 #endif // NET_CERT_MULTI_LOG_CT_VERIFIER_H_ | |
| OLD | NEW |