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

Unified Diff: net/cert/internal/verify_certificate_chain_unittest.cc

Issue 1923433002: Certificate path builder for new certificate verification library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip: Make CertPathIter build the full path including the trust anchor Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: net/cert/internal/verify_certificate_chain_unittest.cc
diff --git a/net/cert/internal/verify_certificate_chain_unittest.cc b/net/cert/internal/verify_certificate_chain_unittest.cc
index a4443ca2d1c61d60b6c5d43b0d8a67d8aff5ff6d..d21f5ca08ddb2009e3a912fc5b7c93d5087d3ca4 100644
--- a/net/cert/internal/verify_certificate_chain_unittest.cc
+++ b/net/cert/internal/verify_certificate_chain_unittest.cc
@@ -75,7 +75,10 @@ void ReadTestFromFile(const std::string& file_name,
if (block_type == kCertificateHeader) {
chain->push_back(block_data);
} else if (block_type == kTrustedCertificateHeader) {
- ASSERT_TRUE(trust_store->AddTrustedCertificate(block_data));
+ scoped_refptr<CertThing> cert(
+ CertThing::CreateFromCertificateCopy(block_data));
+ ASSERT_TRUE(cert);
+ trust_store->AddTrustedCertificate(std::move(cert));
} else if (block_type == kTimeHeader) {
ASSERT_FALSE(has_time) << "Duplicate " << kTimeHeader;
has_time = true;
@@ -221,6 +224,22 @@ TEST(VerifyCertificateChainTest, NonSelfSignedRoot) {
RunTest("non-self-signed-root.pem");
}
+TEST(VerifyCertificateChainTest, KeyRolloverOldChain) {
+ RunTest("key-rollover-oldchain.pem");
+}
+
+TEST(VerifyCertificateChainTest, KeyRolloverRolloverChain) {
+ RunTest("key-rollover-rolloverchain.pem");
+}
+
+TEST(VerifyCertificateChainTest, KeyRolloverLongRolloverChain) {
+ RunTest("key-rollover-longrolloverchain.pem");
+}
+
+TEST(VerifyCertificateChainTest, KeyRolloverNewChain) {
+ RunTest("key-rollover-newchain.pem");
+}
+
// Tests that verifying a chain with no certificates fails.
TEST(VerifyCertificateChainTest, EmptyChainIsInvalid) {
TrustStore trust_store;

Powered by Google App Engine
This is Rietveld 408576698