| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/cert_verify_proc_whitelist.h" | 5 #include "net/cert/cert_verify_proc_whitelist.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "net/base/test_data_directory.h" | |
| 9 #include "net/cert/x509_certificate.h" | 8 #include "net/cert/x509_certificate.h" |
| 10 #include "net/test/cert_test_util.h" | 9 #include "net/test/cert_test_util.h" |
| 10 #include "net/test/test_data_directory.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 HashValue GetTestHashValue(uint8_t label, HashValueTag tag) { | 17 HashValue GetTestHashValue(uint8_t label, HashValueTag tag) { |
| 18 HashValue hash_value(tag); | 18 HashValue hash_value(tag); |
| 19 memset(hash_value.data(), label, hash_value.size()); | 19 memset(hash_value.data(), label, hash_value.size()); |
| 20 return hash_value; | 20 return hash_value; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // Should return false, because the chain (as indicated by | 180 // Should return false, because the chain (as indicated by |
| 181 // public_key_hashes) is not constrained. | 181 // public_key_hashes) is not constrained. |
| 182 EXPECT_FALSE(IsNonWhitelistedCertificate(*cert, public_key_hashes)); | 182 EXPECT_FALSE(IsNonWhitelistedCertificate(*cert, public_key_hashes)); |
| 183 | 183 |
| 184 SetCertificateWhitelistForTesting(nullptr, 0); | 184 SetCertificateWhitelistForTesting(nullptr, 0); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace | 187 } // namespace |
| 188 | 188 |
| 189 } // namespace net | 189 } // namespace net |
| OLD | NEW |