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

Unified Diff: net/base/cert_database_nss.cc

Issue 10377025: Parse an application/x-x509-user-cert response with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | « content/browser/renderer_host/x509_user_cert_resource_handler.cc ('k') | net/base/x509_certificate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_database_nss.cc
===================================================================
--- net/base/cert_database_nss.cc (revision 134554)
+++ net/base/cert_database_nss.cc (working copy)
@@ -76,6 +76,17 @@
LOG(ERROR) << "Couldn't import user certificate.";
return ERR_ADD_USER_CERT_FAILED;
}
+ const X509Certificate::OSCertHandles& intermediate_certs =
+ cert_obj->GetIntermediateCertificates();
+ for (size_t i = 0; i < intermediate_certs.size(); ++i) {
+ CERTCertificate* intermediate_cert = intermediate_certs[i];
+ // TODO(wtc): skip intermediate_cert if it is a self-signed root cert?
+ // It is not useful to import a root cert without trust settings.
+ char* nickname = CERT_MakeCANickname(intermediate_cert);
+ PK11_ImportCert(slot, intermediate_cert, CK_INVALID_HANDLE, nickname,
+ PR_FALSE);
+ PORT_Free(nickname);
+ }
PK11_FreeSlot(slot);
CertDatabase::NotifyObserversOfUserCertAdded(cert_obj);
return OK;
« no previous file with comments | « content/browser/renderer_host/x509_user_cert_resource_handler.cc ('k') | net/base/x509_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698