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/attestation/attestation_flow.h" | 5 #include "chromeos/attestation/attestation_flow.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chromeos/cryptohome/async_method_caller.h" | 8 #include "chromeos/cryptohome/async_method_caller.h" |
9 #include "chromeos/dbus/cryptohome_client.h" | 9 #include "chromeos/dbus/cryptohome_client.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 if (!task.is_null()) | 37 if (!task.is_null()) |
38 task.Run(); | 38 task.Run(); |
39 } | 39 } |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 const char AttestationFlow::kEnterpriseMachineKey[] = "attest-ent-machine"; | 43 const char AttestationFlow::kEnterpriseMachineKey[] = "attest-ent-machine"; |
44 | 44 |
45 AttestationFlow::AttestationFlow(cryptohome::AsyncMethodCaller* async_caller, | 45 AttestationFlow::AttestationFlow(cryptohome::AsyncMethodCaller* async_caller, |
46 CryptohomeClient* cryptohome_client, | 46 CryptohomeClient* cryptohome_client, |
47 ServerProxy* server_proxy) | 47 scoped_ptr<ServerProxy> server_proxy) |
48 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 48 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
49 async_caller_(async_caller), | 49 async_caller_(async_caller), |
50 cryptohome_client_(cryptohome_client), | 50 cryptohome_client_(cryptohome_client), |
51 server_proxy_(server_proxy) { | 51 server_proxy_(server_proxy.Pass()) { |
52 } | 52 } |
53 | 53 |
54 AttestationFlow::~AttestationFlow() { | 54 AttestationFlow::~AttestationFlow() { |
55 } | 55 } |
56 | 56 |
57 void AttestationFlow::GetCertificate(const std::string& name, | 57 void AttestationFlow::GetCertificate(const std::string& name, |
58 const CertificateCallback& callback) { | 58 const CertificateCallback& callback) { |
59 // If this device has not enrolled with the Privacy CA, we need to do that | 59 // If this device has not enrolled with the Privacy CA, we need to do that |
60 // first. Once enrolled we can proceed with the certificate request. | 60 // first. Once enrolled we can proceed with the certificate request. |
61 base::Closure do_cert_request = base::Bind( | 61 base::Closure do_cert_request = base::Bind( |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 if (name == kEnterpriseMachineKey) | 195 if (name == kEnterpriseMachineKey) |
196 key_type = CryptohomeClient::DEVICE_KEY; | 196 key_type = CryptohomeClient::DEVICE_KEY; |
197 async_caller_->AsyncTpmAttestationFinishCertRequest(data, | 197 async_caller_->AsyncTpmAttestationFinishCertRequest(data, |
198 key_type, | 198 key_type, |
199 name, | 199 name, |
200 base::Bind(callback)); | 200 base::Bind(callback)); |
201 } | 201 } |
202 | 202 |
203 } // namespace attestation | 203 } // namespace attestation |
204 } // namespace chromeos | 204 } // namespace chromeos |
OLD | NEW |