#include "device/fido/virtual_ctap2_device.h"
#include <cstdint>
#include <memory>
#include <optional>
#include <string_view>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "components/cbor/reader.h"
#include "components/cbor/values.h"
#include "components/cbor/writer.h"
#include "device/fido/attestation_statement.h"
#include "device/fido/authenticator_get_assertion_response.h"
#include "device/fido/authenticator_make_credential_response.h"
#include "device/fido/ctap_get_assertion_request.h"
#include "device/fido/ctap_make_credential_request.h"
#include "device/fido/device_response_converter.h"
#include "device/fido/fido_constants.h"
#include "device/fido/fido_device.h"
#include "device/fido/fido_parsing_utils.h"
#include "device/fido/fido_test_data.h"
#include "device/fido/fido_transport_protocol.h"
#include "device/fido/fido_types.h"
#include "device/fido/large_blob.h"
#include "device/fido/public_key_credential_descriptor.h"
#include "device/fido/virtual_fido_device.h"
#include "net/cert/asn1_util.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace device {
namespace {
TestFuture;
void SendCommand(VirtualCtap2Device* device,
base::span<const uint8_t> command,
FidoDevice::DeviceCallback callback = base::DoNothing()) { … }
std::optional<cbor::Value> DecodeCBOR(base::span<const uint8_t> in) { … }
std::vector<uint8_t> ToCTAP2Command(
const std::pair<device::CtapRequestCommand, std::optional<cbor::Value>>&
parts) { … }
}
class VirtualCtap2DeviceTest : public ::testing::Test { … };
TEST_F(VirtualCtap2DeviceTest, ParseMakeCredentialRequestForVirtualCtapKey) { … }
TEST_F(VirtualCtap2DeviceTest, ParseGetAssertionRequestForVirtualCtapKey) { … }
TEST_F(VirtualCtap2DeviceTest, DestroyInsideSimulatePressCallback) { … }
TEST_F(VirtualCtap2DeviceTest, AttestationCertificateIsValid) { … }
TEST_F(VirtualCtap2DeviceTest, RejectsCredentialsWithExtraKeys) { … }
TEST_F(VirtualCtap2DeviceTest, OnGetAssertionBogusSignature) { … }
TEST_F(VirtualCtap2DeviceTest, OnMakeCredentialBogusSignature) { … }
TEST_F(VirtualCtap2DeviceTest, OnGetAssertionUnsetUPBit) { … }
TEST_F(VirtualCtap2DeviceTest, OnGetAssertionUnsetUVBit) { … }
TEST_F(VirtualCtap2DeviceTest, OnMakeCredentialUnsetUPBit) { … }
TEST_F(VirtualCtap2DeviceTest, OnMakeCredentialUnsetUVBit) { … }
TEST_F(VirtualCtap2DeviceTest, InjectLargeBlob) { … }
}