Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: net/cert/internal/path_builder_unittest.cc

Issue 2282183004: Add error information to VerifyCertificateChain(). (Closed)
Patch Set: fix typo in README Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/cancelable_callback.h" 8 #include "base/cancelable_callback.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 EXPECT_EQ(d_by_d_, path.trust_anchor->cert()); 488 EXPECT_EQ(d_by_d_, path.trust_anchor->cert());
489 } 489 }
490 } 490 }
491 491
492 class PathBuilderKeyRolloverTest : public ::testing::Test { 492 class PathBuilderKeyRolloverTest : public ::testing::Test {
493 public: 493 public:
494 PathBuilderKeyRolloverTest() : signature_policy_(1024) {} 494 PathBuilderKeyRolloverTest() : signature_policy_(1024) {}
495 495
496 void SetUp() override { 496 void SetUp() override {
497 ParsedCertificateList path; 497 ParsedCertificateList path;
498 bool unused; 498 bool unused_result;
499 std::string unused_errors;
499 500
500 ReadVerifyCertChainTestFromFile("key-rollover-oldchain.pem", &path, 501 ReadVerifyCertChainTestFromFile("key-rollover-oldchain.pem", &path,
501 &oldroot_, &time_, &unused); 502 &oldroot_, &time_, &unused_result,
503 &unused_errors);
502 ASSERT_EQ(2U, path.size()); 504 ASSERT_EQ(2U, path.size());
503 target_ = path[0]; 505 target_ = path[0];
504 oldintermediate_ = path[1]; 506 oldintermediate_ = path[1];
505 ASSERT_TRUE(target_); 507 ASSERT_TRUE(target_);
506 ASSERT_TRUE(oldintermediate_); 508 ASSERT_TRUE(oldintermediate_);
507 509
508 ReadVerifyCertChainTestFromFile("key-rollover-longrolloverchain.pem", &path, 510 ReadVerifyCertChainTestFromFile("key-rollover-longrolloverchain.pem", &path,
509 &oldroot_, &time_, &unused); 511 &oldroot_, &time_, &unused_result,
512 &unused_errors);
510 ASSERT_EQ(4U, path.size()); 513 ASSERT_EQ(4U, path.size());
511 newintermediate_ = path[1]; 514 newintermediate_ = path[1];
512 newroot_ = path[2]; 515 newroot_ = path[2];
513 newrootrollover_ = path[3]; 516 newrootrollover_ = path[3];
514 ASSERT_TRUE(newintermediate_); 517 ASSERT_TRUE(newintermediate_);
515 ASSERT_TRUE(newroot_); 518 ASSERT_TRUE(newroot_);
516 ASSERT_TRUE(newrootrollover_); 519 ASSERT_TRUE(newrootrollover_);
517 } 520 }
518 521
519 protected: 522 protected:
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 const auto& path1 = result.paths[1]->path; 1184 const auto& path1 = result.paths[1]->path;
1182 ASSERT_EQ(2U, path1.certs.size()); 1185 ASSERT_EQ(2U, path1.certs.size());
1183 EXPECT_EQ(target_, path1.certs[0]); 1186 EXPECT_EQ(target_, path1.certs[0]);
1184 EXPECT_EQ(newintermediate_, path1.certs[1]); 1187 EXPECT_EQ(newintermediate_, path1.certs[1]);
1185 EXPECT_EQ(newroot_, path1.trust_anchor->cert()); 1188 EXPECT_EQ(newroot_, path1.trust_anchor->cert());
1186 } 1189 }
1187 1190
1188 } // namespace 1191 } // namespace
1189 1192
1190 } // namespace net 1193 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/path_builder.cc ('k') | net/cert/internal/path_builder_verify_certificate_chain_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698