Chromium Code Reviews| 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) { |