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

Unified 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 side-by-side diff with in-line comments
Download patch
« device/u2f/u2f_responses.h ('K') | « device/u2f/u2f_responses.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/u2f/u2f_responses.cc
diff --git a/device/u2f/u2f_responses.cc b/device/u2f/u2f_responses.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5b5eac7d9885366c97f109770b45ba45d1229ed2
--- /dev/null
+++ b/device/u2f/u2f_responses.cc
@@ -0,0 +1,55 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <vector>
+
+#include "device/u2f/u2f_responses.h"
+
+namespace device {
+
+scoped_refptr<U2fRegisterResponse> U2fRegisterResponse::Create(
+ U2fApduResponse::Status status,
+ std::vector<uint8_t> user_public_key,
+ std::vector<uint8_t> key_handle,
+ std::vector<uint8_t> attestation_cert,
+ std::vector<uint8_t> signature) {
+ return make_scoped_refptr(new U2fRegisterResponse(
+ status, std::move(user_public_key), std::move(key_handle),
+ std::move(attestation_cert), std::move(signature)));
+}
+
+U2fRegisterResponse::U2fRegisterResponse(U2fApduResponse::Status status,
+ std::vector<uint8_t> user_public_key,
+ std::vector<uint8_t> key_handle,
+ std::vector<uint8_t> attestation_cert,
+ std::vector<uint8_t> signature)
+ : status_(status),
+ user_public_key_(std::move(user_public_key)),
+ key_handle_(std::move(key_handle)),
+ attestation_cert_(std::move(attestation_cert)),
+ signature_(std::move(signature)) {}
+
+U2fRegisterResponse::~U2fRegisterResponse() {}
+
+scoped_refptr<U2fSignResponse> U2fSignResponse::Create(
+ U2fApduResponse::Status status,
+ uint8_t presence,
+ uint32_t counter,
+ std::vector<uint8_t> signature) {
+ return make_scoped_refptr(
+ new U2fSignResponse(status, presence, counter, std::move(signature)));
+}
+
+U2fSignResponse::U2fSignResponse(U2fApduResponse::Status status,
+ uint8_t presence,
+ uint32_t counter,
+ std::vector<uint8_t> signature)
+ : status_(status),
+ presence_(presence),
+ counter_(counter),
+ signature_(std::move(signature)) {}
+
+U2fSignResponse::~U2fSignResponse() {}
+
+} // namespace device
« 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