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

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
« no previous file with comments | « net/base/x509_certificate_openssl.cc ('k') | net/base/x509_openssl_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,13 @@
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"));
+ EXPECT_FALSE(webkit_cert->VerifyNameMatch("www.webkit.com"));
+ EXPECT_FALSE(webkit_cert->VerifyNameMatch("www.foo.webkit.com"));
}
TEST(X509CertificateTest, ThawteCertParsing) {
« no previous file with comments | « net/base/x509_certificate_openssl.cc ('k') | net/base/x509_openssl_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698