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

Unified Diff: net/cert/nss_profile_filter_chromeos.cc

Issue 137553004: NSS Cros multiprofile: trust roots added by a profile shouldn't apply to other profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: handle additional trust roots, add TestRootCertsTest.Contains, remove instantiated certtests from c… Created 6 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
Index: net/cert/nss_profile_filter_chromeos.cc
diff --git a/net/cert/nss_profile_filter_chromeos.cc b/net/cert/nss_profile_filter_chromeos.cc
index 48718174e8b37a4f0626c95fce7340034e795bd5..2e0b571b87e6ea72837f300300fdcabad866142f 100644
--- a/net/cert/nss_profile_filter_chromeos.cc
+++ b/net/cert/nss_profile_filter_chromeos.cc
@@ -6,16 +6,17 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h"
namespace net {
namespace {
-std::string CertSlotsString(const scoped_refptr<X509Certificate>& cert) {
+std::string CertSlotsString(CERTCertificate* cert) {
std::string result;
crypto::ScopedPK11SlotList slots_for_cert(
- PK11_GetAllSlotsForCert(cert->os_cert_handle(), NULL));
+ PK11_GetAllSlotsForCert(cert, NULL));
for (PK11SlotListElement* slot_element =
PK11_GetFirstSafe(slots_for_cert.get());
slot_element;
@@ -66,13 +67,12 @@ bool NSSProfileFilterChromeOS::IsModuleAllowed(PK11SlotInfo* slot) const {
return false;
}
-bool NSSProfileFilterChromeOS::IsCertAllowed(
- const scoped_refptr<X509Certificate>& cert) const {
+bool NSSProfileFilterChromeOS::IsCertAllowed(CERTCertificate* cert) const {
crypto::ScopedPK11SlotList slots_for_cert(
- PK11_GetAllSlotsForCert(cert->os_cert_handle(), NULL));
+ PK11_GetAllSlotsForCert(cert, NULL));
if (!slots_for_cert) {
- DVLOG(2) << "cert no slots: " << cert->subject().GetDisplayName();
- return true;
+ DVLOG(2) << "cert no slots: " << base::StringPiece(cert->nickname);
+ return false;
}
for (PK11SlotListElement* slot_element =
@@ -82,13 +82,13 @@ bool NSSProfileFilterChromeOS::IsCertAllowed(
PK11_GetNextSafe(slots_for_cert.get(), slot_element, PR_FALSE)) {
if (IsModuleAllowed(slot_element->slot)) {
DVLOG(3) << "cert from " << CertSlotsString(cert)
- << " allowed: " << cert->subject().GetDisplayName();
+ << " allowed: " << base::StringPiece(cert->nickname);
PK11_FreeSlotListElement(slots_for_cert.get(), slot_element);
return true;
}
}
DVLOG(2) << "cert from " << CertSlotsString(cert)
- << " filtered: " << cert->subject().GetDisplayName();
+ << " filtered: " << base::StringPiece(cert->nickname);
return false;
}
@@ -98,7 +98,7 @@ NSSProfileFilterChromeOS::CertNotAllowedForProfilePredicate::
bool NSSProfileFilterChromeOS::CertNotAllowedForProfilePredicate::operator()(
const scoped_refptr<X509Certificate>& cert) const {
- return !filter_.IsCertAllowed(cert);
+ return !filter_.IsCertAllowed(cert->os_cert_handle());
}
NSSProfileFilterChromeOS::ModuleNotAllowedForProfilePredicate::

Powered by Google App Engine
This is Rietveld 408576698