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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 extension->critical.data && extension->critical.data[0] ? | 67 extension->critical.data && extension->critical.data[0] ? |
68 critical_label : non_critical_label; | 68 critical_label : non_critical_label; |
69 return criticality + "\n" + | 69 return criticality + "\n" + |
70 psm::ProcessExtensionData(SECOID_FindOIDTag(&extension->id), | 70 psm::ProcessExtensionData(SECOID_FindOIDTag(&extension->id), |
71 &extension->value); | 71 &extension->value); |
72 } | 72 } |
73 | 73 |
74 //////////////////////////////////////////////////////////////////////////////// | 74 //////////////////////////////////////////////////////////////////////////////// |
75 // NSS certificate export functions. | 75 // NSS certificate export functions. |
76 | 76 |
77 class FreeNSSCMSMessage { | 77 struct NSSCMSMessageDeleter { |
78 public: | |
79 inline void operator()(NSSCMSMessage* x) const { | 78 inline void operator()(NSSCMSMessage* x) const { |
80 NSS_CMSMessage_Destroy(x); | 79 NSS_CMSMessage_Destroy(x); |
81 } | 80 } |
82 }; | 81 }; |
83 typedef scoped_ptr_malloc<NSSCMSMessage, FreeNSSCMSMessage> | 82 typedef scoped_ptr<NSSCMSMessage, NSSCMSMessageDeleter> ScopedNSSCMSMessage; |
84 ScopedNSSCMSMessage; | |
85 | 83 |
86 class FreeNSSCMSSignedData { | 84 class FreeNSSCMSSignedData { |
87 public: | 85 public: |
88 inline void operator()(NSSCMSSignedData* x) const { | 86 inline void operator()(NSSCMSSignedData* x) const { |
89 NSS_CMSSignedData_Destroy(x); | 87 NSS_CMSSignedData_Destroy(x); |
90 } | 88 } |
91 }; | 89 }; |
92 typedef scoped_ptr_malloc<NSSCMSSignedData, FreeNSSCMSSignedData> | 90 typedef scoped_ptr_malloc<NSSCMSSignedData, FreeNSSCMSSignedData> |
93 ScopedNSSCMSSignedData; | 91 ScopedNSSCMSSignedData; |
94 | 92 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 string ProcessRawBitsSignatureWrap(X509Certificate::OSCertHandle cert_handle) { | 405 string ProcessRawBitsSignatureWrap(X509Certificate::OSCertHandle cert_handle) { |
408 return ProcessRawBits(cert_handle->signatureWrap.signature.data, | 406 return ProcessRawBits(cert_handle->signatureWrap.signature.data, |
409 cert_handle->signatureWrap.signature.len); | 407 cert_handle->signatureWrap.signature.len); |
410 } | 408 } |
411 | 409 |
412 void RegisterDynamicOids() { | 410 void RegisterDynamicOids() { |
413 psm::RegisterDynamicOids(); | 411 psm::RegisterDynamicOids(); |
414 } | 412 } |
415 | 413 |
416 } // namespace x509_certificate_model | 414 } // namespace x509_certificate_model |
OLD | NEW |