| 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
|
|
|