| 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 "crypto/cssm_init.h" | 5 #include "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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 LeakySingletonTraits<CSSMInitSingleton> >::get(); | 43 LeakySingletonTraits<CSSMInitSingleton> >::get(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 CSSM_CSP_HANDLE csp_handle() const { return csp_handle_; } | 46 CSSM_CSP_HANDLE csp_handle() const { return csp_handle_; } |
| 47 CSSM_CL_HANDLE cl_handle() const { return cl_handle_; } | 47 CSSM_CL_HANDLE cl_handle() const { return cl_handle_; } |
| 48 CSSM_TP_HANDLE tp_handle() const { return tp_handle_; } | 48 CSSM_TP_HANDLE tp_handle() const { return tp_handle_; } |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 CSSMInitSingleton() | 51 CSSMInitSingleton() |
| 52 : inited_(false), csp_loaded_(false), cl_loaded_(false), | 52 : inited_(false), csp_loaded_(false), cl_loaded_(false), |
| 53 tp_loaded_(false), csp_handle_(NULL), cl_handle_(NULL), | 53 tp_loaded_(false), csp_handle_(CSSM_INVALID_HANDLE), |
| 54 tp_handle_(NULL) { | 54 cl_handle_(CSSM_INVALID_HANDLE), tp_handle_(CSSM_INVALID_HANDLE) { |
| 55 static CSSM_VERSION version = {2, 0}; | 55 static CSSM_VERSION version = {2, 0}; |
| 56 // TODO(wtc): what should our caller GUID be? | 56 // TODO(wtc): what should our caller GUID be? |
| 57 static const CSSM_GUID test_guid = { | 57 static const CSSM_GUID test_guid = { |
| 58 0xFADE, 0, 0, { 1, 2, 3, 4, 5, 6, 7, 0 } | 58 0xFADE, 0, 0, { 1, 2, 3, 4, 5, 6, 7, 0 } |
| 59 }; | 59 }; |
| 60 CSSM_RETURN crtn; | 60 CSSM_RETURN crtn; |
| 61 CSSM_PVC_MODE pvc_policy = CSSM_PVC_NONE; | 61 CSSM_PVC_MODE pvc_policy = CSSM_PVC_NONE; |
| 62 crtn = CSSM_Init(&version, CSSM_PRIVILEGE_SCOPE_NONE, &test_guid, | 62 crtn = CSSM_Init(&version, CSSM_PRIVILEGE_SCOPE_NONE, &test_guid, |
| 63 CSSM_KEY_HIERARCHY_NONE, &pvc_policy, NULL); | 63 CSSM_KEY_HIERARCHY_NONE, &pvc_policy, NULL); |
| 64 if (crtn) { | 64 if (crtn) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 crypto | 204 } // namespace crypto |
| OLD | NEW |