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

Unified Diff: net/cert/x509_certificate_unittest.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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/cert/x509_certificate_openssl.cc ('k') | net/cert/x509_certificate_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate_unittest.cc
diff --git a/net/cert/x509_certificate_unittest.cc b/net/cert/x509_certificate_unittest.cc
index 652a5fba99707e56b112978392b865e671eb2e33..c64da2ca430bed747b9c436e289d9083c8a1309a 100644
--- a/net/cert/x509_certificate_unittest.cc
+++ b/net/cert/x509_certificate_unittest.cc
@@ -714,6 +714,20 @@ TEST(X509CertificateTest, IsIssuedByEncoded) {
EXPECT_TRUE(google_cert->IsIssuedByEncoded(issuers));
}
+TEST(X509CertificateTest, IsSelfSigned) {
+ base::FilePath certs_dir = GetTestCertsDirectory();
+
+ scoped_refptr<X509Certificate> cert(
+ ImportCertFromFile(certs_dir, "mit.davidben.der"));
+ ASSERT_NE(static_cast<X509Certificate*>(NULL), cert.get());
+ EXPECT_FALSE(X509Certificate::IsSelfSigned(cert->os_cert_handle()));
+
+ scoped_refptr<X509Certificate> self_signed(
+ ImportCertFromFile(certs_dir, "aia-root.pem"));
+ ASSERT_NE(static_cast<X509Certificate*>(NULL), self_signed.get());
+ EXPECT_TRUE(X509Certificate::IsSelfSigned(self_signed->os_cert_handle()));
+}
+
TEST(X509CertificateTest, IsIssuedByEncodedWithIntermediates) {
static const unsigned char kPolicyRootDN[] = {
0x30, 0x1e, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c,
« no previous file with comments | « net/cert/x509_certificate_openssl.cc ('k') | net/cert/x509_certificate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698