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

Unified Diff: chrome/common/net/x509_certificate_model_unittest.cc

Issue 10391197: If the version field is omitted from the certificate, the default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add unit test Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/net/x509_certificate_model_nss.cc ('k') | net/data/ssl/certificates/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/net/x509_certificate_model_unittest.cc
===================================================================
--- chrome/common/net/x509_certificate_model_unittest.cc (revision 137201)
+++ chrome/common/net/x509_certificate_model_unittest.cc (working copy)
@@ -71,3 +71,14 @@
x509_certificate_model::GetType(cert->os_cert_handle()));
#endif
}
+
+// An X.509 v1 certificate with the version field omitted should get
+// the default value v1.
+TEST(X509CertificateModelTest, GetVersionOmitted) {
+ scoped_refptr<net::X509Certificate> cert(
+ net::ImportCertFromFile(net::GetTestCertsDirectory(),
+ "ndn.ca.crt"));
+ ASSERT_TRUE(cert.get());
+
+ EXPECT_EQ("1", x509_certificate_model::GetVersion(cert->os_cert_handle()));
+}
« no previous file with comments | « chrome/common/net/x509_certificate_model_nss.cc ('k') | net/data/ssl/certificates/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698