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 "chrome/common/net/x509_certificate_model.h" | 5 #include "chrome/common/net/x509_certificate_model.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <cms.h> | 8 #include <cms.h> |
9 #include <hasht.h> | 9 #include <hasht.h> |
10 #include <keyhi.h> // SECKEY_DestroyPrivateKey | 10 #include <keyhi.h> // SECKEY_DestroyPrivateKey |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 //////////////////////////////////////////////////////////////////////////////// | 74 //////////////////////////////////////////////////////////////////////////////// |
75 // NSS certificate export functions. | 75 // NSS certificate export functions. |
76 | 76 |
77 struct NSSCMSMessageDeleter { | 77 struct NSSCMSMessageDeleter { |
78 inline void operator()(NSSCMSMessage* x) const { | 78 inline void operator()(NSSCMSMessage* x) const { |
79 NSS_CMSMessage_Destroy(x); | 79 NSS_CMSMessage_Destroy(x); |
80 } | 80 } |
81 }; | 81 }; |
82 typedef scoped_ptr<NSSCMSMessage, NSSCMSMessageDeleter> ScopedNSSCMSMessage; | 82 typedef scoped_ptr<NSSCMSMessage, NSSCMSMessageDeleter> ScopedNSSCMSMessage; |
83 | 83 |
84 class FreeNSSCMSSignedData { | 84 struct FreeNSSCMSSignedData { |
85 public: | |
86 inline void operator()(NSSCMSSignedData* x) const { | 85 inline void operator()(NSSCMSSignedData* x) const { |
87 NSS_CMSSignedData_Destroy(x); | 86 NSS_CMSSignedData_Destroy(x); |
88 } | 87 } |
89 }; | 88 }; |
90 typedef scoped_ptr_malloc<NSSCMSSignedData, FreeNSSCMSSignedData> | 89 typedef scoped_ptr<NSSCMSSignedData, FreeNSSCMSSignedData> |
91 ScopedNSSCMSSignedData; | 90 ScopedNSSCMSSignedData; |
92 | 91 |
93 } // namespace | 92 } // namespace |
94 | 93 |
95 namespace x509_certificate_model { | 94 namespace x509_certificate_model { |
96 | 95 |
97 using net::X509Certificate; | 96 using net::X509Certificate; |
98 using std::string; | 97 using std::string; |
99 | 98 |
100 string GetCertNameOrNickname(X509Certificate::OSCertHandle cert_handle) { | 99 string GetCertNameOrNickname(X509Certificate::OSCertHandle cert_handle) { |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 string ProcessRawBitsSignatureWrap(X509Certificate::OSCertHandle cert_handle) { | 404 string ProcessRawBitsSignatureWrap(X509Certificate::OSCertHandle cert_handle) { |
406 return ProcessRawBits(cert_handle->signatureWrap.signature.data, | 405 return ProcessRawBits(cert_handle->signatureWrap.signature.data, |
407 cert_handle->signatureWrap.signature.len); | 406 cert_handle->signatureWrap.signature.len); |
408 } | 407 } |
409 | 408 |
410 void RegisterDynamicOids() { | 409 void RegisterDynamicOids() { |
411 psm::RegisterDynamicOids(); | 410 psm::RegisterDynamicOids(); |
412 } | 411 } |
413 | 412 |
414 } // namespace x509_certificate_model | 413 } // namespace x509_certificate_model |
OLD | NEW |