#include "device/fido/get_assertion_task.h"
#include <algorithm>
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "device/base/features.h"
#include "device/fido/authenticator_get_assertion_response.h"
#include "device/fido/ctap2_device_operation.h"
#include "device/fido/make_credential_task.h"
#include "device/fido/pin.h"
#include "device/fido/u2f_sign_operation.h"
namespace device {
namespace {
bool MayFallbackToU2fWithAppIdExtension(
const FidoDevice& device,
const CtapGetAssertionRequest& request) { … }
bool SetResponseCredential(
AuthenticatorGetAssertionResponse* response,
const std::vector<PublicKeyCredentialDescriptor>& allow_list) { … }
bool HasCredentialSpecificPRFInputs(const CtapGetAssertionOptions& options) { … }
const PRFInput* GetDefaultPRFInput(const CtapGetAssertionOptions& options) { … }
const PRFInput* GetPRFInputForCredential(const CtapGetAssertionOptions& options,
const std::vector<uint8_t>& id) { … }
}
GetAssertionTask::GetAssertionTask(FidoDevice* device,
CtapGetAssertionRequest request,
CtapGetAssertionOptions options,
GetAssertionTaskCallback callback)
: … { … }
GetAssertionTask::~GetAssertionTask() = default;
void GetAssertionTask::Cancel() { … }
bool GetAssertionTask::StringFixupPredicate(
const std::vector<const cbor::Value*>& path) { … }
void GetAssertionTask::StartTask() { … }
CtapGetAssertionRequest GetAssertionTask::NextSilentRequest() { … }
void GetAssertionTask::GetAssertion() { … }
void GetAssertionTask::U2fSign() { … }
void GetAssertionTask::HandleResponse(
std::vector<PublicKeyCredentialDescriptor> allow_list,
CtapDeviceResponseCode response_code,
std::optional<AuthenticatorGetAssertionResponse> response_data) { … }
void GetAssertionTask::HandleNextResponse(
uint8_t num_responses,
CtapDeviceResponseCode response_code,
std::optional<AuthenticatorGetAssertionResponse> response_data) { … }
void GetAssertionTask::HandleResponseToSilentRequest(
CtapDeviceResponseCode response_code,
std::optional<AuthenticatorGetAssertionResponse> response_data) { … }
void GetAssertionTask::HandleDummyMakeCredentialComplete(
CtapDeviceResponseCode response_code,
std::optional<AuthenticatorMakeCredentialResponse> response_data) { … }
void GetAssertionTask::MaybeSetPRFParameters(CtapGetAssertionRequest* request,
const PRFInput* maybe_inputs) { … }
void GetAssertionTask::MaybeRevertU2fFallbackAndInvokeCallback(
CtapDeviceResponseCode status,
std::optional<AuthenticatorGetAssertionResponse> response) { … }
void GetAssertionTask::LogAndFail(const char* error) { … }
}