| OLD | NEW |
| 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 #include "net/cert/ct_known_logs.h" | 5 #include "net/cert/ct_known_logs.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 #if !defined(OS_NACL) | 32 #if !defined(OS_NACL) |
| 33 std::vector<scoped_refptr<const CTLogVerifier>> | 33 std::vector<scoped_refptr<const CTLogVerifier>> |
| 34 CreateLogVerifiersForKnownLogs() { | 34 CreateLogVerifiersForKnownLogs() { |
| 35 std::vector<scoped_refptr<const CTLogVerifier>> verifiers; | 35 std::vector<scoped_refptr<const CTLogVerifier>> verifiers; |
| 36 | 36 |
| 37 // Add all qualified logs. | 37 // Add all qualified logs. |
| 38 for (const auto& log : kCTLogList) { | 38 for (const auto& log : kCTLogList) { |
| 39 base::StringPiece key(log.log_key, log.log_key_length); | 39 base::StringPiece key(log.log_key, log.log_key_length); |
| 40 verifiers.push_back(CTLogVerifier::Create(key, log.log_name, log.log_url)); | 40 verifiers.push_back(CTLogVerifier::Create(key, log.log_name, log.log_url, |
| 41 log.log_dns_domain)); |
| 41 // Make sure no null logs enter verifiers. Parsing of all known logs should | 42 // Make sure no null logs enter verifiers. Parsing of all known logs should |
| 42 // succeed. | 43 // succeed. |
| 43 CHECK(verifiers.back().get()); | 44 CHECK(verifiers.back().get()); |
| 44 } | 45 } |
| 45 | 46 |
| 46 // Add all disqualified logs. Callers are expected to filter verified SCTs | 47 // Add all disqualified logs. Callers are expected to filter verified SCTs |
| 47 // via IsLogQualified(). | 48 // via IsLogQualified(). |
| 48 for (const auto& disqualified_log : kDisqualifiedCTLogList) { | 49 for (const auto& disqualified_log : kDisqualifiedCTLogList) { |
| 49 const CTLogInfo& log = disqualified_log.log_info; | 50 const CTLogInfo& log = disqualified_log.log_info; |
| 50 base::StringPiece key(log.log_key, log.log_key_length); | 51 base::StringPiece key(log.log_key, log.log_key_length); |
| 51 verifiers.push_back(CTLogVerifier::Create(key, log.log_name, log.log_url)); | 52 verifiers.push_back(CTLogVerifier::Create(key, log.log_name, log.log_url, |
| 53 log.log_dns_domain)); |
| 52 // Make sure no null logs enter verifiers. Parsing of all known logs should | 54 // Make sure no null logs enter verifiers. Parsing of all known logs should |
| 53 // succeed. | 55 // succeed. |
| 54 CHECK(verifiers.back().get()); | 56 CHECK(verifiers.back().get()); |
| 55 } | 57 } |
| 56 | 58 |
| 57 return verifiers; | 59 return verifiers; |
| 58 } | 60 } |
| 59 #endif | 61 #endif |
| 60 | 62 |
| 61 bool IsLogOperatedByGoogle(base::StringPiece log_id) { | 63 bool IsLogOperatedByGoogle(base::StringPiece log_id) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 } | 86 } |
| 85 | 87 |
| 86 *disqualification_date = base::Time::UnixEpoch() + p->disqualification_date; | 88 *disqualification_date = base::Time::UnixEpoch() + p->disqualification_date; |
| 87 return true; | 89 return true; |
| 88 } | 90 } |
| 89 | 91 |
| 90 } // namespace ct | 92 } // namespace ct |
| 91 | 93 |
| 92 } // namespace net | 94 } // namespace net |
| 93 | 95 |
| OLD | NEW |