Chromium Code Reviews| 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_ios.h" | 5 #include "net/cert/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> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 SHA1HashValue sha1; | 93 SHA1HashValue sha1; |
| 94 memset(sha1.data, 0, sizeof(sha1.data)); | 94 memset(sha1.data, 0, sizeof(sha1.data)); |
| 95 CC_SHA1(cert->derCert.data, cert->derCert.len, sha1.data); | 95 CC_SHA1(cert->derCert.data, cert->derCert.len, sha1.data); |
| 96 return sha1; | 96 return sha1; |
| 97 } | 97 } |
| 98 | 98 |
| 99 // NSSCertificate implementation. | 99 // NSSCertificate implementation. |
| 100 | 100 |
| 101 NSSCertificate::NSSCertificate(SecCertificateRef cert_handle) { | 101 NSSCertificate::NSSCertificate(SecCertificateRef cert_handle) { |
| 102 nss_cert_handle_ = CreateNSSCertHandleFromOSHandle(cert_handle); | 102 nss_cert_handle_ = CreateNSSCertHandleFromOSHandle(cert_handle); |
| 103 DLOG_IF(INFO, cert_handle && !nss_cert_handle_) | 103 DVLOG_IF(0, cert_handle && !nss_cert_handle_) |
| 104 << "Could not convert SecCertificateRef to CERTCertificate*"; | 104 << "Could not convert SecCertificateRef to CERTCertificate*"; |
|
Ryan Sleevi
2013/11/25 01:08:32
Let's delete this.
It should only come up in weir
scottmg
2013/11/25 17:12:38
Done.
| |
| 105 } | 105 } |
| 106 | 106 |
| 107 NSSCertificate::~NSSCertificate() { | 107 NSSCertificate::~NSSCertificate() { |
| 108 CERT_DestroyCertificate(nss_cert_handle_); | 108 CERT_DestroyCertificate(nss_cert_handle_); |
| 109 } | 109 } |
| 110 | 110 |
| 111 CERTCertificate* NSSCertificate::cert_handle() const { | 111 CERTCertificate* NSSCertificate::cert_handle() const { |
| 112 return nss_cert_handle_; | 112 return nss_cert_handle_; |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 132 CERTCertificate* NSSCertChain::cert_handle() const { | 132 CERTCertificate* NSSCertChain::cert_handle() const { |
| 133 return certs_.empty() ? NULL : certs_.front(); | 133 return certs_.empty() ? NULL : certs_.front(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 const std::vector<CERTCertificate*>& NSSCertChain::cert_chain() const { | 136 const std::vector<CERTCertificate*>& NSSCertChain::cert_chain() const { |
| 137 return certs_; | 137 return certs_; |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace x509_util_ios | 140 } // namespace x509_util_ios |
| 141 } // namespace net | 141 } // namespace net |
| OLD | NEW |