Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: device/u2f/u2f_responses.cc

Issue 2655853006: Define FIDO U2f Device abstraction (Closed)
Patch Set: Define FIDO U2f Device abstraction Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« device/u2f/u2f_responses.h ('K') | « device/u2f/u2f_responses.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <vector>
6
7 #include "device/u2f/u2f_responses.h"
8
9 namespace device {
10
11 scoped_refptr<U2fRegisterResponse> U2fRegisterResponse::Create(
12 U2fApduResponse::Status status,
13 std::vector<uint8_t> user_public_key,
14 std::vector<uint8_t> key_handle,
15 std::vector<uint8_t> attestation_cert,
16 std::vector<uint8_t> signature) {
17 return make_scoped_refptr(new U2fRegisterResponse(
18 status, std::move(user_public_key), std::move(key_handle),
19 std::move(attestation_cert), std::move(signature)));
20 }
21
22 U2fRegisterResponse::U2fRegisterResponse(U2fApduResponse::Status status,
23 std::vector<uint8_t> user_public_key,
24 std::vector<uint8_t> key_handle,
25 std::vector<uint8_t> attestation_cert,
26 std::vector<uint8_t> signature)
27 : status_(status),
28 user_public_key_(std::move(user_public_key)),
29 key_handle_(std::move(key_handle)),
30 attestation_cert_(std::move(attestation_cert)),
31 signature_(std::move(signature)) {}
32
33 U2fRegisterResponse::~U2fRegisterResponse() {}
34
35 scoped_refptr<U2fSignResponse> U2fSignResponse::Create(
36 U2fApduResponse::Status status,
37 uint8_t presence,
38 uint32_t counter,
39 std::vector<uint8_t> signature) {
40 return make_scoped_refptr(
41 new U2fSignResponse(status, presence, counter, std::move(signature)));
42 }
43
44 U2fSignResponse::U2fSignResponse(U2fApduResponse::Status status,
45 uint8_t presence,
46 uint32_t counter,
47 std::vector<uint8_t> signature)
48 : status_(status),
49 presence_(presence),
50 counter_(counter),
51 signature_(std::move(signature)) {}
52
53 U2fSignResponse::~U2fSignResponse() {}
54
55 } // namespace device
OLDNEW
« device/u2f/u2f_responses.h ('K') | « device/u2f/u2f_responses.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698