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

Unified Diff: net/base/x509_certificate_unittest.cc

Issue 6612013: Add X509Certificate::VerifyCertName(string) API. This will be used... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/base/x509_certificate_unittest.cc
===================================================================
--- net/base/x509_certificate_unittest.cc (revision 76583)
+++ net/base/x509_certificate_unittest.cc (working copy)
@@ -293,6 +293,12 @@
EXPECT_EQ(OK, webkit_cert->Verify("webkit.org", flags, &verify_result));
EXPECT_EQ(0, verify_result.cert_status & CERT_STATUS_IS_EV);
#endif
+
+ // Test that the wildcard cert matches properly.
+ EXPECT_TRUE(webkit_cert->VerifyNameMatch("www.webkit.org"));
+ EXPECT_TRUE(webkit_cert->VerifyNameMatch("foo.webkit.org"));
+ EXPECT_TRUE(webkit_cert->VerifyNameMatch("webkit.org"));
wtc 2011/03/03 19:38:46 IMPORTANT: can you add a test case for "www.foo.we
Mike Belshe 2011/03/03 23:06:14 Done.
+ EXPECT_FALSE(webkit_cert->VerifyNameMatch("www.webkit.com"));
}
TEST(X509CertificateTest, ThawteCertParsing) {

Powered by Google App Engine
This is Rietveld 408576698