| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/internal/path_builder.h" | 5 #include "net/cert/internal/path_builder.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "net/cert/internal/cert_issuer_source_static.h" | 10 #include "net/cert/internal/cert_issuer_source_static.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 427 |
| 428 class PathBuilderKeyRolloverTest : public ::testing::Test { | 428 class PathBuilderKeyRolloverTest : public ::testing::Test { |
| 429 public: | 429 public: |
| 430 PathBuilderKeyRolloverTest() : signature_policy_(1024) {} | 430 PathBuilderKeyRolloverTest() : signature_policy_(1024) {} |
| 431 | 431 |
| 432 void SetUp() override { | 432 void SetUp() override { |
| 433 ParsedCertificateList path; | 433 ParsedCertificateList path; |
| 434 | 434 |
| 435 VerifyCertChainTest test; | 435 VerifyCertChainTest test; |
| 436 ReadVerifyCertChainTestFromFile( | 436 ReadVerifyCertChainTestFromFile( |
| 437 "net/data/verify_certificate_chain_unittest/key-rollover-oldchain.pem", | 437 "net/data/verify_certificate_chain_unittest/key-rollover/oldchain.test", |
| 438 &test); | 438 &test); |
| 439 path = test.chain; | 439 path = test.chain; |
| 440 ASSERT_EQ(3U, path.size()); | 440 ASSERT_EQ(3U, path.size()); |
| 441 target_ = path[0]; | 441 target_ = path[0]; |
| 442 oldintermediate_ = path[1]; | 442 oldintermediate_ = path[1]; |
| 443 oldroot_ = path[2]; | 443 oldroot_ = path[2]; |
| 444 time_ = test.time; | 444 time_ = test.time; |
| 445 | 445 |
| 446 ASSERT_TRUE(target_); | 446 ASSERT_TRUE(target_); |
| 447 ASSERT_TRUE(oldintermediate_); | 447 ASSERT_TRUE(oldintermediate_); |
| 448 | 448 |
| 449 ReadVerifyCertChainTestFromFile( | 449 ReadVerifyCertChainTestFromFile( |
| 450 "net/data/verify_certificate_chain_unittest/" | 450 "net/data/verify_certificate_chain_unittest/" |
| 451 "key-rollover-longrolloverchain.pem", | 451 "key-rollover/longrolloverchain.test", |
| 452 &test); | 452 &test); |
| 453 path = test.chain; | 453 path = test.chain; |
| 454 | 454 |
| 455 ASSERT_EQ(5U, path.size()); | 455 ASSERT_EQ(5U, path.size()); |
| 456 newintermediate_ = path[1]; | 456 newintermediate_ = path[1]; |
| 457 newroot_ = path[2]; | 457 newroot_ = path[2]; |
| 458 newrootrollover_ = path[3]; | 458 newrootrollover_ = path[3]; |
| 459 ASSERT_TRUE(newintermediate_); | 459 ASSERT_TRUE(newintermediate_); |
| 460 ASSERT_TRUE(newroot_); | 460 ASSERT_TRUE(newroot_); |
| 461 ASSERT_TRUE(newrootrollover_); | 461 ASSERT_TRUE(newrootrollover_); |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 const auto& path1 = result.paths[1]->path; | 1093 const auto& path1 = result.paths[1]->path; |
| 1094 ASSERT_EQ(3U, path1.certs.size()); | 1094 ASSERT_EQ(3U, path1.certs.size()); |
| 1095 EXPECT_EQ(target_, path1.certs[0]); | 1095 EXPECT_EQ(target_, path1.certs[0]); |
| 1096 EXPECT_EQ(newintermediate_, path1.certs[1]); | 1096 EXPECT_EQ(newintermediate_, path1.certs[1]); |
| 1097 EXPECT_EQ(newroot_, path1.certs[2]); | 1097 EXPECT_EQ(newroot_, path1.certs[2]); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 } // namespace | 1100 } // namespace |
| 1101 | 1101 |
| 1102 } // namespace net | 1102 } // namespace net |
| OLD | NEW |