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

Unified Diff: net/base/x509_certificate_nss.cc

Issue 9271060: Check cert->isRoot to skip extraneous root certificates in certificate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_nss.cc
===================================================================
--- net/base/x509_certificate_nss.cc (revision 119153)
+++ net/base/x509_certificate_nss.cc (working copy)
@@ -194,6 +194,17 @@
} else {
verified_chain.push_back(node->cert);
}
+
+ // Because of an NSS bug, CERT_PKIXVerifyCert may chain one self-signed
+ // certificate of a root CA to another self-signed certificate of the
+ // same root CA. Detect that error and ignore the root CA certificate.
+ // See https://bugzilla.mozilla.org/show_bug.cgi?id=721288.
+ if (node->cert->isRoot && root_cert &&
wtc 2012/01/26 03:10:23 The isRoot member of the NSS CERTCertificate struc
Ryan Sleevi 2012/01/26 04:36:27 I think I'd be interested in seeing a unit test. I
wtc 2012/01/27 02:54:04 I will add a unit test tomorrow.
+ SECITEM_ItemsAreEqual(&node->cert->derSubject,
+ &root_cert->derSubject)) {
+ continue;
+ }
+
SECAlgorithmID& signature = node->cert->signature;
SECOidTag oid_tag = SECOID_FindOIDTag(&signature.algorithm);
switch (oid_tag) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698