Index: net/base/x509_certificate_ios.cc |
diff --git a/net/base/x509_certificate_ios.cc b/net/base/x509_certificate_ios.cc |
index 0286203ebb41aa255278c2ca85e87e8c38325707..eb89f2e11ceb38579437394b3fd2e25f2eb6a1a6 100644 |
--- a/net/base/x509_certificate_ios.cc |
+++ b/net/base/x509_certificate_ios.cc |
@@ -69,6 +69,21 @@ void X509Certificate::Initialize() { |
ca_fingerprint_ = CalculateCAFingerprint(intermediate_ca_certs_); |
} |
+bool X509Certificate::IsIssuedByEncoded( |
+ const std::vector<std::string>& valid_issuers) { |
+ x509_util_ios::NSSCertChain nss_chain(this); |
+ // Convert to scoped CERTName* list. |
+ std::vector<CERTName*> issuers; |
+ crypto::ScopedPLArenaPool arena(PORT_NewArena(DER_DEFAULT_CHUNKSIZE)); |
+ if (!x509_util::GetIssuersFromEncodedList( |
+ valid_issuers, arena.get(), &issuers)) { |
Ryan Sleevi
2012/12/21 22:09:50
nit: indent is incorrect here
digit1
2013/01/07 13:58:40
Done.
|
+ return false; |
+ } |
+ // Do the comparison. |
Ryan Sleevi
2012/12/21 22:09:50
nit: Nix this comment
digit1
2013/01/07 13:58:40
Done.
|
+ return x509_util::IsCertificateIssuedBy( |
+ nss_chain.cert_chain(), issuers); |
+} |
+ |
// static |
X509Certificate* X509Certificate::CreateSelfSigned( |
crypto::RSAPrivateKey* key, |