| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base/transport_security_state.h" | 5 #include "net/base/transport_security_state.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 {13, false, "\007twitter\003com", true, 0 }, | 622 {13, false, "\007twitter\003com", true, 0 }, |
| 623 {17, false, "\003www\007twitter\003com", true, 0 }, | 623 {17, false, "\003www\007twitter\003com", true, 0 }, |
| 624 {17, false, "\003api\007twitter\003com", true, 0 }, | 624 {17, false, "\003api\007twitter\003com", true, 0 }, |
| 625 {17, false, "\003dev\007twitter\003com", true, 0 }, | 625 {17, false, "\003dev\007twitter\003com", true, 0 }, |
| 626 {22, false, "\010business\007twitter\003com", true, 0 }, | 626 {22, false, "\010business\007twitter\003com", true, 0 }, |
| 627 #endif | 627 #endif |
| 628 }; | 628 }; |
| 629 static const size_t kNumPreloadedSTS = ARRAYSIZE_UNSAFE(kPreloadedSTS); | 629 static const size_t kNumPreloadedSTS = ARRAYSIZE_UNSAFE(kPreloadedSTS); |
| 630 | 630 |
| 631 static const struct HSTSPreload kPreloadedSNISTS[] = { | 631 static const struct HSTSPreload kPreloadedSNISTS[] = { |
| 632 {11, true, "\005gmail\003com", true, 0 }, | 632 {11, false, "\005gmail\003com", true, 0 }, |
| 633 {16, true, "\012googlemail\003com", true, 0 }, | 633 {16, false, "\012googlemail\003com", true, 0 }, |
| 634 // TODO(cevans) -- switch to the subdomain level, once we have a dedicated | 634 // TODO(cevans) -- switch to the subdomain level, once we have a dedicated |
| 635 // non-SNI HSTS entry for ssl.google-analytics.com. | 635 // non-SNI HSTS entry for ssl.google-analytics.com. |
| 636 {26, true, "\003www\020google-analytics\003com", false, | 636 {26, true, "\003www\020google-analytics\003com", false, |
| 637 kGoogleAcceptableCerts }, | 637 kGoogleAcceptableCerts }, |
| 638 }; | 638 }; |
| 639 static const size_t kNumPreloadedSNISTS = ARRAYSIZE_UNSAFE(kPreloadedSNISTS); | 639 static const size_t kNumPreloadedSNISTS = ARRAYSIZE_UNSAFE(kPreloadedSNISTS); |
| 640 | 640 |
| 641 for (size_t i = 0; canonicalized_host[i]; i += canonicalized_host[i] + 1) { | 641 for (size_t i = 0; canonicalized_host[i]; i += canonicalized_host[i] + 1) { |
| 642 std::string host_sub_chunk(&canonicalized_host[i], | 642 std::string host_sub_chunk(&canonicalized_host[i], |
| 643 canonicalized_host.size() - i); | 643 canonicalized_host.size() - i); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 } | 704 } |
| 705 | 705 |
| 706 LOG(ERROR) << "Rejecting public key chain for domain " << domain | 706 LOG(ERROR) << "Rejecting public key chain for domain " << domain |
| 707 << ". Validated chain: " << HashesToBase64String(hashes) | 707 << ". Validated chain: " << HashesToBase64String(hashes) |
| 708 << ", expected: " << HashesToBase64String(public_key_hashes); | 708 << ", expected: " << HashesToBase64String(public_key_hashes); |
| 709 | 709 |
| 710 return false; | 710 return false; |
| 711 } | 711 } |
| 712 | 712 |
| 713 } // namespace | 713 } // namespace |
| OLD | NEW |