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

Unified Diff: net/cert/cert_verify_proc_unittest.cc

Issue 20628006: Reject certificates that are valid for too long. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase?! In our moment of triumph?! Created 6 years, 11 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/cert_verify_proc_unittest.cc
diff --git a/net/cert/cert_verify_proc_unittest.cc b/net/cert/cert_verify_proc_unittest.cc
index 9d7e7503ba4d62ed1c79cf1b741a88d0d9674c5b..7325a9d5792424414bce5e9bf1edead3cd4055db 100644
--- a/net/cert/cert_verify_proc_unittest.cc
+++ b/net/cert/cert_verify_proc_unittest.cc
@@ -613,6 +613,18 @@ TEST_F(CertVerifyProcTest, NameConstraintsFailure) {
verify_result.cert_status & CERT_STATUS_NAME_CONSTRAINT_VIOLATION);
}
+TEST_F(CertVerifyProcTest, TestHasTooLongValidity) {
+ base::FilePath certs_dir = GetTestCertsDirectory();
+ scoped_refptr<X509Certificate> ok_cert =
+ ImportCertFromFile(certs_dir, "ok_cert.pem");
+ EXPECT_TRUE(CertVerifyProc::HasTooLongValidity(*ok_cert));
+
+ scoped_refptr<X509Certificate> compliant_cert =
+ ImportCertFromFile(certs_dir, "br-compliant-validity.pem");
+ EXPECT_FALSE(CertVerifyProc::HasTooLongValidity(*compliant_cert));
+}
+
+// The certse.pem certificate has been revoked. crbug.com/259723.
TEST_F(CertVerifyProcTest, TestKnownRoot) {
if (!SupportsDetectingKnownRoots()) {
LOG(INFO) << "Skipping this test in this platform.";

Powered by Google App Engine
This is Rietveld 408576698