| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/http/transport_security_state.h" | 5 #include "net/http/transport_security_state.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 EXPECT_TRUE(HasPublicKeyPins("twitter.com")); | 527 EXPECT_TRUE(HasPublicKeyPins("twitter.com")); |
| 528 EXPECT_FALSE(HasPublicKeyPins("foo.twitter.com")); | 528 EXPECT_FALSE(HasPublicKeyPins("foo.twitter.com")); |
| 529 EXPECT_TRUE(HasPublicKeyPins("www.twitter.com")); | 529 EXPECT_TRUE(HasPublicKeyPins("www.twitter.com")); |
| 530 EXPECT_TRUE(HasPublicKeyPins("api.twitter.com")); | 530 EXPECT_TRUE(HasPublicKeyPins("api.twitter.com")); |
| 531 EXPECT_TRUE(HasPublicKeyPins("oauth.twitter.com")); | 531 EXPECT_TRUE(HasPublicKeyPins("oauth.twitter.com")); |
| 532 EXPECT_TRUE(HasPublicKeyPins("mobile.twitter.com")); | 532 EXPECT_TRUE(HasPublicKeyPins("mobile.twitter.com")); |
| 533 EXPECT_TRUE(HasPublicKeyPins("dev.twitter.com")); | 533 EXPECT_TRUE(HasPublicKeyPins("dev.twitter.com")); |
| 534 EXPECT_TRUE(HasPublicKeyPins("business.twitter.com")); | 534 EXPECT_TRUE(HasPublicKeyPins("business.twitter.com")); |
| 535 EXPECT_TRUE(HasPublicKeyPins("platform.twitter.com")); | 535 EXPECT_TRUE(HasPublicKeyPins("platform.twitter.com")); |
| 536 EXPECT_TRUE(HasPublicKeyPins("si0.twimg.com")); | 536 EXPECT_TRUE(HasPublicKeyPins("si0.twimg.com")); |
| 537 EXPECT_TRUE(HasPublicKeyPins("twimg0-a.akamaihd.net")); | |
| 538 } | 537 } |
| 539 | 538 |
| 540 static bool AddHash(const std::string& type_and_base64, | 539 static bool AddHash(const std::string& type_and_base64, |
| 541 HashValueVector* out) { | 540 HashValueVector* out) { |
| 542 HashValue hash; | 541 HashValue hash; |
| 543 if (!hash.FromString(type_and_base64)) | 542 if (!hash.FromString(type_and_base64)) |
| 544 return false; | 543 return false; |
| 545 | 544 |
| 546 out->push_back(hash); | 545 out->push_back(hash); |
| 547 return true; | 546 return true; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 // Expect to fail for SNI hosts when not searching the SNI list: | 682 // Expect to fail for SNI hosts when not searching the SNI list: |
| 684 EXPECT_FALSE(TransportSecurityState::IsGooglePinnedProperty( | 683 EXPECT_FALSE(TransportSecurityState::IsGooglePinnedProperty( |
| 685 "gmail.com", false)); | 684 "gmail.com", false)); |
| 686 EXPECT_FALSE(TransportSecurityState::IsGooglePinnedProperty( | 685 EXPECT_FALSE(TransportSecurityState::IsGooglePinnedProperty( |
| 687 "googlegroups.com", false)); | 686 "googlegroups.com", false)); |
| 688 EXPECT_FALSE(TransportSecurityState::IsGooglePinnedProperty( | 687 EXPECT_FALSE(TransportSecurityState::IsGooglePinnedProperty( |
| 689 "www.googlegroups.com", false)); | 688 "www.googlegroups.com", false)); |
| 690 } | 689 } |
| 691 | 690 |
| 692 } // namespace net | 691 } // namespace net |
| OLD | NEW |