#include "device/fido/device_response_converter.h"
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include "base/containers/contains.h"
#include "base/containers/span.h"
#include "base/i18n/streaming_utf8_validator.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "components/cbor/diagnostic_writer.h"
#include "components/cbor/reader.h"
#include "components/cbor/writer.h"
#include "components/device_event_log/device_event_log.h"
#include "device/fido/authenticator_data.h"
#include "device/fido/authenticator_supported_options.h"
#include "device/fido/features.h"
#include "device/fido/fido_constants.h"
#include "device/fido/fido_parsing_utils.h"
#include "device/fido/fido_transport_protocol.h"
#include "device/fido/opaque_attestation_statement.h"
namespace device {
namespace {
constexpr size_t kResponseCodeLength = …;
ProtocolVersion ConvertStringToProtocolVersion(std::string_view version) { … }
std::optional<Ctap2Version> ConvertStringToCtap2Version(
std::string_view version) { … }
std::optional<std::vector<uint8_t>> GetPRFOutputs(
const cbor::Value& results_value) { … }
}
CBOR;
CtapDeviceResponseCode GetResponseCode(base::span<const uint8_t> buffer) { … }
std::optional<AuthenticatorMakeCredentialResponse>
ReadCTAPMakeCredentialResponse(FidoTransportProtocol transport_used,
const std::optional<cbor::Value>& cbor) { … }
std::optional<AuthenticatorGetAssertionResponse> ReadCTAPGetAssertionResponse(
FidoTransportProtocol transport_used,
const std::optional<cbor::Value>& cbor) { … }
std::optional<AuthenticatorGetInfoResponse> ReadCTAPGetInfoResponse(
base::span<const uint8_t> buffer) { … }
static std::optional<std::string> FixInvalidUTF8String(
base::span<const uint8_t> utf8_bytes) { … }
PathPredicate;
static std::optional<cbor::Value> FixInvalidUTF8Value(
const cbor::Value& v,
std::vector<const cbor::Value*>* path,
PathPredicate predicate) { … }
static bool ContainsInvalidUTF8(const cbor::Value& v) { … }
std::optional<cbor::Value> FixInvalidUTF8(cbor::Value in,
PathPredicate predicate) { … }
std::optional<PINUVAuthProtocol> ToPINUVAuthProtocol(int64_t in) { … }
}