| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <algorithm> | 6 #include <algorithm> |
| 7 | 7 |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
| 10 #include "crypto/sha2.h" | 10 #include "crypto/sha2.h" |
| 11 #include "net/base/host_port_pair.h" | 11 #include "net/base/host_port_pair.h" |
| 12 #include "net/base/test_completion_callback.h" | 12 #include "net/base/test_completion_callback.h" |
| 13 #include "net/http/http_security_headers.h" | 13 #include "net/http/http_security_headers.h" |
| 14 #include "net/http/http_util.h" | 14 #include "net/http/http_util.h" |
| 15 #include "net/http/transport_security_state.h" | 15 #include "net/http/transport_security_state.h" |
| 16 #include "net/log/net_log.h" | |
| 17 #include "net/ssl/ssl_info.h" | 16 #include "net/ssl/ssl_info.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 18 |
| 20 namespace net { | 19 namespace net { |
| 21 | 20 |
| 22 namespace { | 21 namespace { |
| 23 | 22 |
| 24 HashValue GetTestHashValue(uint8_t label, HashValueTag tag) { | 23 HashValue GetTestHashValue(uint8_t label, HashValueTag tag) { |
| 25 HashValue hash_value(tag); | 24 HashValue hash_value(tag); |
| 26 memset(hash_value.data(), label, hash_value.size()); | 25 memset(hash_value.data(), label, hash_value.size()); |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 // The old pins must still exist. | 899 // The old pins must still exist. |
| 901 EXPECT_TRUE(state.HasPublicKeyPins("example.com")); | 900 EXPECT_TRUE(state.HasPublicKeyPins("example.com")); |
| 902 EXPECT_EQ(TransportSecurityState::PKPStatus::OK, | 901 EXPECT_EQ(TransportSecurityState::PKPStatus::OK, |
| 903 state.CheckPublicKeyPins( | 902 state.CheckPublicKeyPins( |
| 904 domain_port, is_issued_by_known_root, | 903 domain_port, is_issued_by_known_root, |
| 905 ssl_info.public_key_hashes, nullptr, nullptr, | 904 ssl_info.public_key_hashes, nullptr, nullptr, |
| 906 TransportSecurityState::DISABLE_PIN_REPORTS, &failure_log)); | 905 TransportSecurityState::DISABLE_PIN_REPORTS, &failure_log)); |
| 907 } | 906 } |
| 908 | 907 |
| 909 }; // namespace net | 908 }; // namespace net |
| OLD | NEW |