| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/tools/transport_security_state_generator/input_file_parsers.h" | 5 #include "net/tools/transport_security_state_generator/input_file_parsers.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 CertificateParserState current_state = CertificateParserState::PRE_NAME; | 171 CertificateParserState current_state = CertificateParserState::PRE_NAME; |
| 172 | 172 |
| 173 const base::CompareCase& compare_mode = base::CompareCase::INSENSITIVE_ASCII; | 173 const base::CompareCase& compare_mode = base::CompareCase::INSENSITIVE_ASCII; |
| 174 std::string name; | 174 std::string name; |
| 175 std::string buffer; | 175 std::string buffer; |
| 176 std::string subject_name; | 176 std::string subject_name; |
| 177 bssl::UniquePtr<X509> certificate; | 177 bssl::UniquePtr<X509> certificate; |
| 178 SPKIHash hash; | 178 SPKIHash hash; |
| 179 | 179 |
| 180 for (const base::StringPiece& line : SplitStringPiece( | 180 for (const base::StringPiece& line : SplitStringPiece( |
| 181 certs_input, "\n", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL)) { | 181 certs_input, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
| 182 if (line[0] == '#') { | 182 if (line[0] == '#') { |
| 183 continue; | 183 continue; |
| 184 } | 184 } |
| 185 | 185 |
| 186 if (line.empty() && current_state == CertificateParserState::PRE_NAME) { | 186 if (line.empty() && current_state == CertificateParserState::PRE_NAME) { |
| 187 continue; | 187 continue; |
| 188 } | 188 } |
| 189 | 189 |
| 190 switch (current_state) { | 190 switch (current_state) { |
| 191 case CertificateParserState::PRE_NAME: | 191 case CertificateParserState::PRE_NAME: |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 368 |
| 369 pinsets->RegisterPinset(std::move(pinset)); | 369 pinsets->RegisterPinset(std::move(pinset)); |
| 370 } | 370 } |
| 371 | 371 |
| 372 return true; | 372 return true; |
| 373 } | 373 } |
| 374 | 374 |
| 375 } // namespace transport_security_state | 375 } // namespace transport_security_state |
| 376 | 376 |
| 377 } // namespace net | 377 } // namespace net |
| OLD | NEW |