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

Unified Diff: net/base/x509_util_nss.cc

Issue 11579002: Add X509Certificate::IsIssuedByEncoded() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add missing base files (damn you git cl upload) Created 8 years 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
« net/base/x509_util_nss.h ('K') | « net/base/x509_util_nss.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« net/base/x509_util_nss.h ('K') | « net/base/x509_util_nss.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698