#include "device/fido/make_credential_task.h"
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/ranges/algorithm.h"
#include "device/base/features.h"
#include "device/fido/ctap2_device_operation.h"
#include "device/fido/ctap_make_credential_request.h"
#include "device/fido/pin.h"
#include "device/fido/u2f_command_constructor.h"
#include "device/fido/u2f_register_operation.h"
namespace device {
namespace {
bool CtapDeviceShouldUseU2fBecauseClientPinIsSet(
const FidoDevice* device,
const CtapMakeCredentialRequest& request) { … }
std::optional<AuthenticatorMakeCredentialResponse> ConvertCTAPResponse(
FidoDevice* device,
bool resident_key_required,
const std::optional<cbor::Value>& cbor) { … }
}
MakeCredentialTask::MakeCredentialTask(FidoDevice* device,
CtapMakeCredentialRequest request,
MakeCredentialOptions options,
MakeCredentialTaskCallback callback)
: … { … }
MakeCredentialTask::~MakeCredentialTask() = default;
CtapMakeCredentialRequest MakeCredentialTask::GetTouchRequest(
const FidoDevice* device) { … }
bool MakeCredentialTask::WillUseCTAP2(const FidoDevice* device,
const CtapMakeCredentialRequest& request,
const MakeCredentialOptions& options) { … }
void MakeCredentialTask::Cancel() { … }
void MakeCredentialTask::StartTask() { … }
CtapGetAssertionRequest MakeCredentialTask::NextSilentRequest() { … }
void MakeCredentialTask::MakeCredential() { … }
void MakeCredentialTask::HandleResponseToSilentSignRequest(
CtapDeviceResponseCode response_code,
std::optional<AuthenticatorGetAssertionResponse> response_data) { … }
void MakeCredentialTask::HandleResponseToDummyTouch(
CtapDeviceResponseCode response_code,
std::optional<AuthenticatorMakeCredentialResponse> response_data) { … }
void MakeCredentialTask::U2fRegister() { … }
void MakeCredentialTask::MaybeRevertU2fFallback(
CtapDeviceResponseCode status,
std::optional<AuthenticatorMakeCredentialResponse> response) { … }
std::vector<std::vector<PublicKeyCredentialDescriptor>>
FilterAndBatchCredentialDescriptors(
const std::vector<PublicKeyCredentialDescriptor>& in,
const FidoDevice& device) { … }
}