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

Unified Diff: net/base/cert_database_nss.cc

Issue 7272014: Mark untrusted certificates as such in Linux UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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/base/cert_database_nss.cc
diff --git a/net/base/cert_database_nss.cc b/net/base/cert_database_nss.cc
index 1e753dea7ac5358deaba7c97fa6f29f9ec6e8a5f..9d0f21986be20961b63eeafb0d3f9c3a5991b6d9 100644
--- a/net/base/cert_database_nss.cc
+++ b/net/base/cert_database_nss.cc
@@ -236,6 +236,19 @@ unsigned int CertDatabase::GetCertTrust(
}
}
+bool CertDatabase::IsUntrusted(const X509Certificate* cert) const {
+ CERTCertTrust nsstrust;
+ SECStatus rv = CERT_GetCertTrust(cert->os_cert_handle(), &nsstrust);
+ if (rv != SECSuccess) {
+ LOG(ERROR) << "CERT_GetCertTrust failed with error " << PORT_GetError();
+ return false;
+ }
+
+ return nsstrust.sslFlags == 0 &&
+ nsstrust.emailFlags == 0 &&
+ nsstrust.objectSigningFlags == 0;
wtc 2011/06/29 00:30:45 I believe this is correct only for root certs. (N
mattm 2011/06/29 01:12:07 Maybe we should only check the sslFlags? If for s
+}
+
bool CertDatabase::SetCertTrust(const X509Certificate* cert,
CertType type,
unsigned int trusted) {
« chrome/browser/ui/webui/options/certificate_manager_handler.cc ('K') | « net/base/cert_database.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698