OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/cert/x509_util.h" | 5 #include "net/cert/x509_util.h" |
6 #include "net/cert/x509_util_nss.h" | 6 #include "net/cert/x509_util_nss.h" |
7 | 7 |
8 #include <cert.h> // Must be included before certdb.h | 8 #include <cert.h> // Must be included before certdb.h |
9 #include <certdb.h> | 9 #include <certdb.h> |
10 #include <cryptohi.h> | 10 #include <cryptohi.h> |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 X509Certificate::OSCertHandle handle = | 207 X509Certificate::OSCertHandle handle = |
208 X509Certificate::CreateOSCertHandleFromBytes( | 208 X509Certificate::CreateOSCertHandleFromBytes( |
209 reinterpret_cast<char*>(certs[i]->data), certs[i]->len); | 209 reinterpret_cast<char*>(certs[i]->data), certs[i]->len); |
210 if (handle) | 210 if (handle) |
211 results->push_back(handle); | 211 results->push_back(handle); |
212 } | 212 } |
213 | 213 |
214 return SECSuccess; | 214 return SECSuccess; |
215 } | 215 } |
216 | 216 |
217 typedef scoped_ptr_malloc< | 217 typedef scoped_ptr< |
218 CERTName, | 218 CERTName, |
219 crypto::NSSDestroyer<CERTName, CERT_DestroyName> > ScopedCERTName; | 219 crypto::NSSDestroyer<CERTName, CERT_DestroyName> > ScopedCERTName; |
220 | 220 |
221 // Create a new CERTName object from its encoded representation. | 221 // Create a new CERTName object from its encoded representation. |
222 // |arena| is the allocation pool to use. | 222 // |arena| is the allocation pool to use. |
223 // |data| points to a DER-encoded X.509 DistinguishedName. | 223 // |data| points to a DER-encoded X.509 DistinguishedName. |
224 // Return a new CERTName pointer on success, or NULL. | 224 // Return a new CERTName pointer on success, or NULL. |
225 CERTName* CreateCertNameFromEncoded(PLArenaPool* arena, | 225 CERTName* CreateCertNameFromEncoded(PLArenaPool* arena, |
226 const base::StringPiece& data) { | 226 const base::StringPiece& data) { |
227 if (!arena) | 227 if (!arena) |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 } | 629 } |
630 | 630 |
631 return new_name; | 631 return new_name; |
632 } | 632 } |
633 | 633 |
634 #endif // defined(USE_NSS) || defined(OS_IOS) | 634 #endif // defined(USE_NSS) || defined(OS_IOS) |
635 | 635 |
636 } // namespace x509_util | 636 } // namespace x509_util |
637 | 637 |
638 } // namespace net | 638 } // namespace net |
OLD | NEW |