Chromium Code Reviews| Index: net/base/x509_util_nss.cc |
| diff --git a/net/base/x509_util_nss.cc b/net/base/x509_util_nss.cc |
| index c86b9c5db8b9e013d0bbd4eb4c2795ab77554d11..20dfc3aaf9db123277f828b2b7ffa2ffd81db83c 100644 |
| --- a/net/base/x509_util_nss.cc |
| +++ b/net/base/x509_util_nss.cc |
| @@ -527,6 +527,23 @@ void GetPublicKeyInfo(CERTCertificate* handle, |
| break; |
| } |
| } |
| + |
| +bool IsCertNameItemInIssuerList( |
| + SECItem* name, |
| + const std::vector<std::string>& valid_issuers) { |
| + for (std::vector<std::string>::const_iterator it = valid_issuers.begin(); |
| + it != valid_issuers.end(); ++it) { |
| + SECItem issuer; |
| + issuer.type = siDERNameBuffer; |
| + issuer.data = reinterpret_cast<unsigned char*>( |
| + const_cast<char*>(it->data())); |
| + issuer.len = static_cast<unsigned int>(it->length()); |
| + if (SECITEM_ItemsAreEqual(&issuer, name)) |
|
Ryan Sleevi
2012/12/13 19:49:05
use the CERTName comparison
digit1
2012/12/14 17:54:33
That's not do-able for the reason explained previo
Ryan Sleevi
2012/12/14 18:16:42
See comments about the NSS API to use to do this :
|
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| #endif // defined(USE_NSS) || defined(OS_IOS) |
| } // namespace x509_util |