chromium/device/fido/hid/fido_hid_packet.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "device/fido/hid/fido_hid_packet.h"

#include <algorithm>
#include <utility>

#include "base/containers/contains.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"

namespace device {

FidoHidPacket::FidoHidPacket(std::vector<uint8_t> data, uint32_t channel_id)
    :{}

FidoHidPacket::FidoHidPacket() = default;

FidoHidPacket::~FidoHidPacket() = default;

// static
std::unique_ptr<FidoHidInitPacket> FidoHidInitPacket::CreateFromSerializedData(
    base::span<const uint8_t> serialized,
    size_t* remaining_size) {}

// U2F Initialization packet is defined as:
// Offset Length
// 0      4       Channel ID
// 4      1       Command ID
// 5      1       High order packet payload size
// 6      1       Low order packet payload size
// 7      (s-7)   Payload data
FidoHidInitPacket::FidoHidInitPacket(uint32_t channel_id,
                                     FidoHidDeviceCommand cmd,
                                     std::vector<uint8_t> data,
                                     uint16_t payload_length)
    :{}

FidoHidInitPacket::~FidoHidInitPacket() = default;

std::vector<uint8_t> FidoHidInitPacket::GetSerializedData() const {}

// static
std::unique_ptr<FidoHidContinuationPacket>
FidoHidContinuationPacket::CreateFromSerializedData(
    base::span<const uint8_t> serialized,
    size_t* remaining_size) {}

// U2F Continuation packet is defined as:
// Offset Length
// 0      4       Channel ID
// 4      1       Packet sequence 0x00..0x7f
// 5      (s-5)   Payload data
FidoHidContinuationPacket::FidoHidContinuationPacket(const uint32_t channel_id,
                                                     const uint8_t sequence,
                                                     std::vector<uint8_t> data)
    :{}

FidoHidContinuationPacket::~FidoHidContinuationPacket() = default;

std::vector<uint8_t> FidoHidContinuationPacket::GetSerializedData() const {}

}  // namespace device