OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef DEVICE_U2F_U2F_REGISTER_H_ | 5 #ifndef DEVICE_U2F_U2F_REGISTER_H_ |
6 #define DEVICE_U2F_U2F_REGISTER_H_ | 6 #define DEVICE_U2F_U2F_REGISTER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "u2f_request.h" | 10 #include "u2f_request.h" |
11 | 11 |
12 namespace device { | 12 namespace device { |
13 | 13 |
14 class U2fRegister : public U2fRequest { | 14 class U2fRegister : public U2fRequest { |
15 public: | 15 public: |
16 U2fRegister(const std::vector<uint8_t>& challenge_hash, | 16 U2fRegister(const std::vector<uint8_t>& challenge_hash, |
17 const std::vector<uint8_t>& app_param, | 17 const std::vector<uint8_t>& app_param, |
18 const ResponseCallback& cb); | 18 const ResponseCallback& cb); |
19 ~U2fRegister() override; | 19 ~U2fRegister() override; |
20 | 20 |
21 static std::unique_ptr<U2fRequest> TryRegistration( | 21 static std::unique_ptr<U2fRequest> TryRegistration( |
22 const std::vector<uint8_t>& challenge_hash, | 22 const std::vector<uint8_t>& challenge_hash, |
23 const std::vector<uint8_t>& app_param, | 23 const std::vector<uint8_t>& app_param, |
24 const ResponseCallback& cb); | 24 const ResponseCallback& cb); |
25 | 25 |
26 private: | 26 private: |
27 void TryDevice() override; | 27 void TryDevice() override; |
28 void OnTryDevice(U2fReturnCode, std::vector<uint8_t>); | 28 void OnTryDevice(U2fReturnCode return_code, |
| 29 const std::vector<uint8_t>& response_data); |
29 | 30 |
30 std::vector<uint8_t> challenge_hash_; | 31 std::vector<uint8_t> challenge_hash_; |
31 std::vector<uint8_t> app_param_; | 32 std::vector<uint8_t> app_param_; |
32 base::WeakPtrFactory<U2fRegister> weak_factory_; | 33 base::WeakPtrFactory<U2fRegister> weak_factory_; |
33 }; | 34 }; |
34 | 35 |
35 } // namespace device | 36 } // namespace device |
36 | 37 |
37 #endif // DEVICE_U2F_U2F_REGISTER_H_ | 38 #endif // DEVICE_U2F_U2F_REGISTER_H_ |
OLD | NEW |