OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/crypto/cssm_init.h" | 5 #include "base/crypto/cssm_init.h" |
6 | 6 |
7 #include <Security/SecBase.h> | 7 #include <Security/SecBase.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 bool tp_loaded_; // True if gGuidAppleX509TP has been loaded. | 148 bool tp_loaded_; // True if gGuidAppleX509TP has been loaded. |
149 CSSM_CSP_HANDLE csp_handle_; | 149 CSSM_CSP_HANDLE csp_handle_; |
150 CSSM_CL_HANDLE cl_handle_; | 150 CSSM_CL_HANDLE cl_handle_; |
151 CSSM_TP_HANDLE tp_handle_; | 151 CSSM_TP_HANDLE tp_handle_; |
152 | 152 |
153 friend struct DefaultSingletonTraits<CSSMInitSingleton>; | 153 friend struct DefaultSingletonTraits<CSSMInitSingleton>; |
154 }; | 154 }; |
155 | 155 |
156 } // namespace | 156 } // namespace |
157 | 157 |
158 namespace base { | 158 namespace crypto { |
159 | 159 |
160 void EnsureCSSMInit() { | 160 void EnsureCSSMInit() { |
161 CSSMInitSingleton::GetInstance(); | 161 CSSMInitSingleton::GetInstance(); |
162 } | 162 } |
163 | 163 |
164 CSSM_CSP_HANDLE GetSharedCSPHandle() { | 164 CSSM_CSP_HANDLE GetSharedCSPHandle() { |
165 return CSSMInitSingleton::GetInstance()->csp_handle(); | 165 return CSSMInitSingleton::GetInstance()->csp_handle(); |
166 } | 166 } |
167 | 167 |
168 CSSM_CL_HANDLE GetSharedCLHandle() { | 168 CSSM_CL_HANDLE GetSharedCLHandle() { |
(...skipping 25 matching lines...) Expand all Loading... |
194 memset(&data_, 0, sizeof(data_)); | 194 memset(&data_, 0, sizeof(data_)); |
195 } | 195 } |
196 | 196 |
197 ScopedCSSMData::~ScopedCSSMData() { | 197 ScopedCSSMData::~ScopedCSSMData() { |
198 if (data_.Data) { | 198 if (data_.Data) { |
199 CSSMFree(data_.Data); | 199 CSSMFree(data_.Data); |
200 data_.Data = NULL; | 200 data_.Data = NULL; |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 } // namespace base | 204 } // namespace crypto |
OLD | NEW |