#include "device/fido/virtual_u2f_device.h"
#include <memory>
#include <string>
#include <tuple>
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "components/apdu/apdu_command.h"
#include "components/apdu/apdu_response.h"
#include "crypto/ec_private_key.h"
#include "device/fido/fido_constants.h"
#include "device/fido/fido_parsing_utils.h"
namespace device {
Append;
namespace {
constexpr uint8_t kU2fRegistrationResponseHeader = …;
std::optional<std::vector<uint8_t>> ErrorStatus(
apdu::ApduResponse::Status status) { … }
}
bool VirtualU2fDevice::IsTransportSupported(FidoTransportProtocol transport) { … }
VirtualU2fDevice::VirtualU2fDevice() = default;
VirtualU2fDevice::VirtualU2fDevice(scoped_refptr<State> state)
: … { … }
VirtualU2fDevice::~VirtualU2fDevice() = default;
void VirtualU2fDevice::Cancel(CancelToken) { … }
FidoDevice::CancelToken VirtualU2fDevice::DeviceTransact(
std::vector<uint8_t> command,
DeviceCallback cb) { … }
base::WeakPtr<FidoDevice> VirtualU2fDevice::GetWeakPtr() { … }
std::optional<std::vector<uint8_t>> VirtualU2fDevice::DoRegister(
uint8_t ins,
uint8_t p1,
uint8_t p2,
base::span<const uint8_t> data) { … }
std::optional<std::vector<uint8_t>> VirtualU2fDevice::DoSign(
uint8_t ins,
uint8_t p1,
uint8_t p2,
base::span<const uint8_t> data) { … }
}