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 "chromeos/cryptohome/async_method_caller.h" | 5 #include "chromeos/cryptohome/async_method_caller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 AsyncTpmAttestationCreateCertRequest( | 116 AsyncTpmAttestationCreateCertRequest( |
117 options, | 117 options, |
118 base::Bind(&AsyncMethodCallerImpl::RegisterAsyncDataCallback, | 118 base::Bind(&AsyncMethodCallerImpl::RegisterAsyncDataCallback, |
119 weak_ptr_factory_.GetWeakPtr(), | 119 weak_ptr_factory_.GetWeakPtr(), |
120 callback, | 120 callback, |
121 "Couldn't initiate async attestation cert request.")); | 121 "Couldn't initiate async attestation cert request.")); |
122 } | 122 } |
123 | 123 |
124 virtual void AsyncTpmAttestationFinishCertRequest( | 124 virtual void AsyncTpmAttestationFinishCertRequest( |
125 const std::string& pca_response, | 125 const std::string& pca_response, |
126 chromeos::CryptohomeClient::AttestationKeyType key_type, | 126 chromeos::attestation::AttestationKeyType key_type, |
127 const std::string& key_name, | 127 const std::string& key_name, |
128 const DataCallback& callback) OVERRIDE { | 128 const DataCallback& callback) OVERRIDE { |
129 DBusThreadManager::Get()->GetCryptohomeClient()-> | 129 DBusThreadManager::Get()->GetCryptohomeClient()-> |
130 AsyncTpmAttestationFinishCertRequest( | 130 AsyncTpmAttestationFinishCertRequest( |
131 pca_response, | 131 pca_response, |
132 key_type, | 132 key_type, |
133 key_name, | 133 key_name, |
134 base::Bind( | 134 base::Bind( |
135 &AsyncMethodCallerImpl::RegisterAsyncDataCallback, | 135 &AsyncMethodCallerImpl::RegisterAsyncDataCallback, |
136 weak_ptr_factory_.GetWeakPtr(), | 136 weak_ptr_factory_.GetWeakPtr(), |
137 callback, | 137 callback, |
138 "Couldn't initiate async attestation finish cert request.")); | 138 "Couldn't initiate async attestation finish cert request.")); |
139 } | 139 } |
140 | 140 |
141 virtual void TpmAttestationRegisterKey( | 141 virtual void TpmAttestationRegisterKey( |
142 chromeos::CryptohomeClient::AttestationKeyType key_type, | 142 chromeos::attestation::AttestationKeyType key_type, |
143 const std::string& key_name, | 143 const std::string& key_name, |
144 const Callback& callback) OVERRIDE { | 144 const Callback& callback) OVERRIDE { |
145 DBusThreadManager::Get()->GetCryptohomeClient()-> | 145 DBusThreadManager::Get()->GetCryptohomeClient()-> |
146 TpmAttestationRegisterKey( | 146 TpmAttestationRegisterKey( |
147 key_type, | 147 key_type, |
148 key_name, | 148 key_name, |
149 base::Bind( | 149 base::Bind( |
150 &AsyncMethodCallerImpl::RegisterAsyncCallback, | 150 &AsyncMethodCallerImpl::RegisterAsyncCallback, |
151 weak_ptr_factory_.GetWeakPtr(), | 151 weak_ptr_factory_.GetWeakPtr(), |
152 callback, | 152 callback, |
153 "Couldn't initiate async attestation register key.")); | 153 "Couldn't initiate async attestation register key.")); |
154 } | 154 } |
155 | 155 |
156 virtual void TpmAttestationSignEnterpriseChallenge( | 156 virtual void TpmAttestationSignEnterpriseChallenge( |
157 chromeos::CryptohomeClient::AttestationKeyType key_type, | 157 chromeos::attestation::AttestationKeyType key_type, |
158 const std::string& key_name, | 158 const std::string& key_name, |
159 const std::string& domain, | 159 const std::string& domain, |
160 const std::string& device_id, | 160 const std::string& device_id, |
161 chromeos::CryptohomeClient::AttestationChallengeOptions options, | 161 chromeos::attestation::AttestationChallengeOptions options, |
162 const std::string& challenge, | 162 const std::string& challenge, |
163 const DataCallback& callback) OVERRIDE { | 163 const DataCallback& callback) OVERRIDE { |
164 DBusThreadManager::Get()->GetCryptohomeClient()-> | 164 DBusThreadManager::Get()->GetCryptohomeClient()-> |
165 TpmAttestationSignEnterpriseChallenge( | 165 TpmAttestationSignEnterpriseChallenge( |
166 key_type, | 166 key_type, |
167 key_name, | 167 key_name, |
168 domain, | 168 domain, |
169 device_id, | 169 device_id, |
170 options, | 170 options, |
171 challenge, | 171 challenge, |
172 base::Bind( | 172 base::Bind( |
173 &AsyncMethodCallerImpl::RegisterAsyncDataCallback, | 173 &AsyncMethodCallerImpl::RegisterAsyncDataCallback, |
174 weak_ptr_factory_.GetWeakPtr(), | 174 weak_ptr_factory_.GetWeakPtr(), |
175 callback, | 175 callback, |
176 "Couldn't initiate async attestation enterprise challenge.")); | 176 "Couldn't initiate async attestation enterprise challenge.")); |
177 } | 177 } |
178 | 178 |
179 virtual void TpmAttestationSignSimpleChallenge( | 179 virtual void TpmAttestationSignSimpleChallenge( |
180 chromeos::CryptohomeClient::AttestationKeyType key_type, | 180 chromeos::attestation::AttestationKeyType key_type, |
181 const std::string& key_name, | 181 const std::string& key_name, |
182 const std::string& challenge, | 182 const std::string& challenge, |
183 const DataCallback& callback) OVERRIDE { | 183 const DataCallback& callback) OVERRIDE { |
184 DBusThreadManager::Get()->GetCryptohomeClient()-> | 184 DBusThreadManager::Get()->GetCryptohomeClient()-> |
185 TpmAttestationSignSimpleChallenge( | 185 TpmAttestationSignSimpleChallenge( |
186 key_type, | 186 key_type, |
187 key_name, | 187 key_name, |
188 challenge, | 188 challenge, |
189 base::Bind( | 189 base::Bind( |
190 &AsyncMethodCallerImpl::RegisterAsyncDataCallback, | 190 &AsyncMethodCallerImpl::RegisterAsyncDataCallback, |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 g_async_method_caller = NULL; | 338 g_async_method_caller = NULL; |
339 VLOG(1) << "AsyncMethodCaller Shutdown completed"; | 339 VLOG(1) << "AsyncMethodCaller Shutdown completed"; |
340 } | 340 } |
341 | 341 |
342 // static | 342 // static |
343 AsyncMethodCaller* AsyncMethodCaller::GetInstance() { | 343 AsyncMethodCaller* AsyncMethodCaller::GetInstance() { |
344 return g_async_method_caller; | 344 return g_async_method_caller; |
345 } | 345 } |
346 | 346 |
347 } // namespace cryptohome | 347 } // namespace cryptohome |
OLD | NEW |