| 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/base/x509_util_ios.h" | 5 #include "net/base/x509_util_ios.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <CommonCrypto/CommonDigest.h> | 8 #include <CommonCrypto/CommonDigest.h> |
| 9 #include <nss.h> | 9 #include <nss.h> |
| 10 #include <prtypes.h> | 10 #include <prtypes.h> |
| 11 | 11 |
| 12 #include "base/mac/scoped_cftyperef.h" | 12 #include "base/mac/scoped_cftyperef.h" |
| 13 #include "crypto/nss_util.h" | 13 #include "crypto/nss_util.h" |
| 14 #include "net/base/x509_certificate.h" | 14 #include "net/base/x509_certificate.h" |
| 15 #include "net/base/x509_util_nss.h" |
| 15 | 16 |
| 16 using base::mac::ScopedCFTypeRef; | 17 using base::mac::ScopedCFTypeRef; |
| 17 | 18 |
| 18 namespace net { | 19 namespace net { |
| 19 namespace x509_util_ios { | 20 namespace x509_util_ios { |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 | 23 |
| 23 // Creates an NSS certificate handle from |data|, which is |length| bytes in | 24 // Creates an NSS certificate handle from |data|, which is |length| bytes in |
| 24 // size. | 25 // size. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 126 |
| 126 NSSCertChain::~NSSCertChain() { | 127 NSSCertChain::~NSSCertChain() { |
| 127 for (size_t i = 0; i < certs_.size(); ++i) | 128 for (size_t i = 0; i < certs_.size(); ++i) |
| 128 CERT_DestroyCertificate(certs_[i]); | 129 CERT_DestroyCertificate(certs_[i]); |
| 129 } | 130 } |
| 130 | 131 |
| 131 CERTCertificate* NSSCertChain::cert_handle() const { | 132 CERTCertificate* NSSCertChain::cert_handle() const { |
| 132 return certs_.empty() ? NULL : certs_.front(); | 133 return certs_.empty() ? NULL : certs_.front(); |
| 133 } | 134 } |
| 134 | 135 |
| 136 const std::vector<CERTCertificate*>& NSSCertChain::cert_chain() const { |
| 137 return certs_; |
| 138 } |
| 139 |
| 135 } // namespace x509_util_ios | 140 } // namespace x509_util_ios |
| 136 } // namespace net | 141 } // namespace net |
| 137 | |
| OLD | NEW |