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

Side by Side 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: . Created 4 years, 7 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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/internal/verify_certificate_chain.h" 5 #include "net/cert/internal/verify_certificate_chain.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 "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 215
216 TEST(VerifyCertificateChainTest, ViolatesPathlen1Root) { 216 TEST(VerifyCertificateChainTest, ViolatesPathlen1Root) {
217 RunTest("violates-pathlen-1-root.pem"); 217 RunTest("violates-pathlen-1-root.pem");
218 } 218 }
219 219
220 TEST(VerifyCertificateChainTest, NonSelfSignedRoot) { 220 TEST(VerifyCertificateChainTest, NonSelfSignedRoot) {
221 RunTest("non-self-signed-root.pem"); 221 RunTest("non-self-signed-root.pem");
222 } 222 }
223 223
224 TEST(VerifyCertificateChainTest, KeyRolloverOldChain) {
225 RunTest("key-rollover-oldchain.pem");
226 }
227
228 TEST(VerifyCertificateChainTest, KeyRolloverRolloverChain) {
229 RunTest("key-rollover-rolloverchain.pem");
230 }
231
232 TEST(VerifyCertificateChainTest, KeyRolloverLongRolloverChain) {
233 RunTest("key-rollover-longrolloverchain.pem");
234 }
235
236 TEST(VerifyCertificateChainTest, KeyRolloverNewChain) {
237 RunTest("key-rollover-newchain.pem");
238 }
239
224 // Tests that verifying a chain with no certificates fails. 240 // Tests that verifying a chain with no certificates fails.
225 TEST(VerifyCertificateChainTest, EmptyChainIsInvalid) { 241 TEST(VerifyCertificateChainTest, EmptyChainIsInvalid) {
226 TrustStore trust_store; 242 TrustStore trust_store;
227 der::GeneralizedTime time; 243 der::GeneralizedTime time;
228 std::vector<der::Input> chain; 244 std::vector<der::Input> chain;
229 SimpleSignaturePolicy signature_policy(2048); 245 SimpleSignaturePolicy signature_policy(2048);
230 246
231 ASSERT_FALSE( 247 ASSERT_FALSE(
232 VerifyCertificateChain(chain, trust_store, &signature_policy, time)); 248 VerifyCertificateChain(chain, trust_store, &signature_policy, time));
233 } 249 }
234 250
235 // TODO(eroman): Add test that invalidate validity dates where the day or month 251 // TODO(eroman): Add test that invalidate validity dates where the day or month
236 // ordinal not in range, like "March 39, 2016" are rejected. 252 // ordinal not in range, like "March 39, 2016" are rejected.
237 253
238 } // namespace 254 } // namespace
239 255
240 } // namespace net 256 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698