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

Unified Diff: net/base/cert_verify_proc_unittest.cc

Issue 10883012: net: don't crash when processing a certificate with an unknown public key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: g try Created 8 years, 4 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 | « no previous file | net/base/x509_certificate_openssl.cc » ('j') | net/base/x509_certificate_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_verify_proc_unittest.cc
diff --git a/net/base/cert_verify_proc_unittest.cc b/net/base/cert_verify_proc_unittest.cc
index 30bf28057c014d8fd05cde623aca973883fd8e37..5dd7cdb98be403a93b3dd59abb699cc6f9d7aa18 100644
--- a/net/base/cert_verify_proc_unittest.cc
+++ b/net/base/cert_verify_proc_unittest.cc
@@ -223,6 +223,21 @@ TEST_F(CertVerifyProcTest, DISABLED_GlobalSignR3EVTest) {
EXPECT_EQ(ERR_CERT_DATE_INVALID, error);
}
+TEST_F(CertVerifyProcTest, ECDSA_RSA) {
+ FilePath certs_dir = GetTestCertsDirectory();
+
+ scoped_refptr<X509Certificate> cert =
+ ImportCertFromFile(certs_dir, "ecdsa_rsa_test.pem");
+
+ CertVerifyResult verify_result;
+ Verify(cert, "test2.imperialviolet.org", 0, NULL, &verify_result);
Ryan Sleevi 2012/08/23 20:48:59 You should be able to use one of the existing auto
agl 2012/08/24 13:46:17 Thanks for pointing them out. Done.
+
+ // We don't check verify_result because the certificate is signed by an
+ // unknown CA and will be considered invalid on XP because of the ECDSA
+ // public key. However, this test ensures that we don't crash (see
+ // crbug.com/144466).
Ryan Sleevi 2012/08/23 20:48:59 Per the rest of the file, move the description of
agl 2012/08/24 13:46:17 Done.
+}
+
// Currently, only RSA and DSA keys are checked for weakness, and our example
// weak size is 768. These could change in the future.
//
« no previous file with comments | « no previous file | net/base/x509_certificate_openssl.cc » ('j') | net/base/x509_certificate_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698