#include <string_view>
#include "base/containers/contains.h"
#include "base/ranges/algorithm.h"
#include "components/cbor/reader.h"
#include "components/cbor/values.h"
#include "components/cbor/writer.h"
#include "device/fido/attestation_statement_formats.h"
#include "device/fido/authenticator_get_assertion_response.h"
#include "device/fido/authenticator_make_credential_response.h"
#include "device/fido/device_response_converter.h"
#include "device/fido/fido_constants.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/opaque_attestation_statement.h"
#include "device/fido/p256_public_key.h"
#include "device/fido/public_key.h"
#include "fido_transport_protocol.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace device {
namespace {
constexpr uint8_t kTestAuthenticatorGetInfoResponseWithNoVersion[] = …;
constexpr uint8_t kTestAuthenticatorGetInfoResponseWithDuplicateVersion[] = …;
constexpr uint8_t kTestAuthenticatorGetInfoResponseWithCtap2_1[] = …;
constexpr uint8_t kTestAuthenticatorGetInfoResponseOnlyCtap2_1[] = …;
constexpr uint8_t kTestAuthenticatorGetInfoResponseWithIncorrectAaguid[] = …;
constexpr uint8_t kTestAttestedCredentialDataPrefix[] = …;
constexpr uint8_t kTestAuthenticatorDataPrefix[] = …;
constexpr uint8_t kFormatFidoU2fCBOR[] = …;
constexpr uint8_t kAttStmtCBOR[] = …;
constexpr uint8_t kAuthDataCBOR[] = …;
constexpr std::array<uint8_t, kAaguidLength> kTestDeviceAaguid = …;
std::vector<uint8_t> GetTestAttestedCredentialDataBytes() { … }
std::vector<uint8_t> GetTestAuthenticatorDataBytes() { … }
std::vector<uint8_t> GetTestAttestationObjectBytes() { … }
std::vector<uint8_t> GetTestSignResponse() { … }
std::vector<uint8_t> GetTestCorruptedSignResponse(size_t length) { … }
std::vector<uint8_t> GetTestCredentialRawIdBytes() { … }
std::optional<cbor::Value> DecodeCBOR(base::span<const uint8_t> in) { … }
}
TEST(CTAPResponseTest, TestReadMakeCredentialResponse) { … }
TEST(CTAPResponseTest, TestMakeCredentialNoneAttestationResponse) { … }
TEST(CTAPResponseTest, TestReadGetAssertionResponse) { … }
TEST(CTAPResponseTest, TestParseRegisterResponseData) { … }
TEST(CTAPResponseTest, TestSerializedPublicKey) { … }
TEST(CTAPResponseTest, TestParseU2fAttestationStatementCBOR) { … }
TEST(CTAPResponseTest, TestSerializeAttestedCredentialData) { … }
TEST(CTAPResponseTest, TestSerializeAuthenticatorData) { … }
TEST(CTAPResponseTest, TestSerializeU2fAttestationObject) { … }
TEST(CTAPResponseTest, TestSerializeAuthenticatorDataForSign) { … }
TEST(CTAPResponseTest, TestParseSignResponseData) { … }
TEST(CTAPResponseTest, TestParseU2fSignWithNullNullKeyHandle) { … }
TEST(CTAPResponseTest, TestParseU2fSignWithNullResponse) { … }
TEST(CTAPResponseTest, TestParseU2fSignWithCTAP2Flags) { … }
TEST(CTAPResponseTest, TestParseU2fSignWithNullCorruptedCounter) { … }
TEST(CTAPResponseTest, TestParseU2fSignWithNullCorruptedSignature) { … }
TEST(CTAPResponseTest, TestReadGetInfoResponse) { … }
TEST(CTAPResponseTest, TestReadGetInfoResponseWithDuplicateVersion) { … }
TEST(CTAPResponseTest, TestReadGetInfoResponseWithCtap2_1) { … }
TEST(CTAPResponseTest, TestReadGetInfoResponseOnlyCtap2_1) { … }
TEST(CTAPResponseTest, TestReadGetInfoResponseWithIncorrectFormat) { … }
TEST(CTAPResponseTest, TestSerializeGetInfoResponse) { … }
TEST(CTAPResponseTest, TestSerializeMakeCredentialResponse) { … }
TEST(CTAPResponseTest, AttestationObjectResponseFields) { … }
}