#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "third_party/blink/public/mojom/webauthn/virtual_authenticator.mojom-blink.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "third_party/blink/public/mojom/webauthn/virtual_authenticator.mojom-params-data.h"
#include "third_party/blink/public/mojom/webauthn/virtual_authenticator.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/webauthn/virtual_authenticator.mojom-blink-import-headers.h"
#include "third_party/blink/public/mojom/webauthn/virtual_authenticator.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
namespace blink::test::mojom::blink {
VirtualAuthenticatorOptions::VirtualAuthenticatorOptions()
: … { … }
VirtualAuthenticatorOptions::VirtualAuthenticatorOptions(
ClientToAuthenticatorProtocol protocol_in,
Ctap2Version ctap2_version_in,
::blink::mojom::blink::AuthenticatorTransport transport_in,
::blink::mojom::blink::AuthenticatorAttachment attachment_in,
bool has_resident_key_in,
bool has_user_verification_in,
bool is_user_present_in,
bool has_large_blob_in,
bool has_cred_blob_in,
bool has_min_pin_length_in,
bool has_prf_in,
bool default_backup_eligibility_in,
bool default_backup_state_in)
: … { … }
VirtualAuthenticatorOptions::~VirtualAuthenticatorOptions() = default;
size_t VirtualAuthenticatorOptions::Hash(size_t seed) const { … }
void VirtualAuthenticatorOptions::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool VirtualAuthenticatorOptions::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
RegisteredKey::RegisteredKey()
: … { … }
RegisteredKey::RegisteredKey(
WTF::Vector<uint8_t> key_handle_in,
const WTF::String& rp_id_in,
WTF::Vector<uint8_t> private_key_in,
int32_t counter_in)
: … { … }
RegisteredKey::~RegisteredKey() = default;
void RegisteredKey::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool RegisteredKey::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char VirtualAuthenticator::Name_[] = …;
VirtualAuthenticator::IPCStableHashFunction VirtualAuthenticator::MessageToMethodInfo_(mojo::Message& message) { … }
const char* VirtualAuthenticator::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t VirtualAuthenticator::GetUniqueId_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticator::AddRegistration_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticator::GetRegistrations_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticator::RemoveRegistration_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticator::ClearRegistrations_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticator::GetLargeBlob_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticator::SetLargeBlob_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticator::SetUserVerified_Sym::IPCStableHash() { … }
# endif
class VirtualAuthenticator_GetUniqueId_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticator_AddRegistration_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticator_GetRegistrations_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticator_RemoveRegistration_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticator_ClearRegistrations_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticator_GetLargeBlob_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticator_SetLargeBlob_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticator_SetUserVerified_ForwardToCallback
: public mojo::MessageReceiver { … };
VirtualAuthenticatorProxy::VirtualAuthenticatorProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void VirtualAuthenticatorProxy::GetUniqueId(
GetUniqueIdCallback callback) { … }
void VirtualAuthenticatorProxy::AddRegistration(
RegisteredKeyPtr in_key, AddRegistrationCallback callback) { … }
void VirtualAuthenticatorProxy::GetRegistrations(
GetRegistrationsCallback callback) { … }
void VirtualAuthenticatorProxy::RemoveRegistration(
const WTF::Vector<uint8_t>& in_key_handle, RemoveRegistrationCallback callback) { … }
void VirtualAuthenticatorProxy::ClearRegistrations(
ClearRegistrationsCallback callback) { … }
void VirtualAuthenticatorProxy::GetLargeBlob(
const WTF::Vector<uint8_t>& in_key_handle, GetLargeBlobCallback callback) { … }
void VirtualAuthenticatorProxy::SetLargeBlob(
const WTF::Vector<uint8_t>& in_key_handle, const WTF::Vector<uint8_t>& in_blob, SetLargeBlobCallback callback) { … }
void VirtualAuthenticatorProxy::SetUserVerified(
bool in_verified, SetUserVerifiedCallback callback) { … }
class VirtualAuthenticator_GetUniqueId_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticator_GetUniqueId_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticator_GetUniqueId_ProxyToResponder::Run(
const WTF::String& in_id) { … }
class VirtualAuthenticator_AddRegistration_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticator_AddRegistration_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticator_AddRegistration_ProxyToResponder::Run(
bool in_added) { … }
class VirtualAuthenticator_GetRegistrations_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticator_GetRegistrations_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticator_GetRegistrations_ProxyToResponder::Run(
WTF::Vector<RegisteredKeyPtr> in_keys) { … }
class VirtualAuthenticator_RemoveRegistration_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticator_RemoveRegistration_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticator_RemoveRegistration_ProxyToResponder::Run(
bool in_removed) { … }
class VirtualAuthenticator_ClearRegistrations_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticator_ClearRegistrations_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticator_ClearRegistrations_ProxyToResponder::Run(
) { … }
class VirtualAuthenticator_GetLargeBlob_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticator_GetLargeBlob_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticator_GetLargeBlob_ProxyToResponder::Run(
const std::optional<WTF::Vector<uint8_t>>& in_blob) { … }
class VirtualAuthenticator_SetLargeBlob_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticator_SetLargeBlob_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticator_SetLargeBlob_ProxyToResponder::Run(
bool in_set) { … }
class VirtualAuthenticator_SetUserVerified_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticator_SetUserVerified_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticator_SetUserVerified_ProxyToResponder::Run(
) { … }
bool VirtualAuthenticatorStubDispatch::Accept(
VirtualAuthenticator* impl,
mojo::Message* message) { … }
bool VirtualAuthenticatorStubDispatch::AcceptWithResponder(
VirtualAuthenticator* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kVirtualAuthenticatorValidationInfo[] = …;
bool VirtualAuthenticatorRequestValidator::Accept(mojo::Message* message) { … }
bool VirtualAuthenticatorResponseValidator::Accept(mojo::Message* message) { … }
const char VirtualAuthenticatorManager::Name_[] = …;
VirtualAuthenticatorManager::IPCStableHashFunction VirtualAuthenticatorManager::MessageToMethodInfo_(mojo::Message& message) { … }
const char* VirtualAuthenticatorManager::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t VirtualAuthenticatorManager::CreateAuthenticator_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticatorManager::GetAuthenticators_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticatorManager::RemoveAuthenticator_Sym::IPCStableHash() { … }
uint32_t VirtualAuthenticatorManager::ClearAuthenticators_Sym::IPCStableHash() { … }
# endif
class VirtualAuthenticatorManager_CreateAuthenticator_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticatorManager_GetAuthenticators_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticatorManager_RemoveAuthenticator_ForwardToCallback
: public mojo::MessageReceiver { … };
class VirtualAuthenticatorManager_ClearAuthenticators_ForwardToCallback
: public mojo::MessageReceiver { … };
VirtualAuthenticatorManagerProxy::VirtualAuthenticatorManagerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void VirtualAuthenticatorManagerProxy::CreateAuthenticator(
VirtualAuthenticatorOptionsPtr in_options, CreateAuthenticatorCallback callback) { … }
void VirtualAuthenticatorManagerProxy::GetAuthenticators(
GetAuthenticatorsCallback callback) { … }
void VirtualAuthenticatorManagerProxy::RemoveAuthenticator(
const WTF::String& in_id, RemoveAuthenticatorCallback callback) { … }
void VirtualAuthenticatorManagerProxy::ClearAuthenticators(
ClearAuthenticatorsCallback callback) { … }
class VirtualAuthenticatorManager_CreateAuthenticator_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticatorManager_CreateAuthenticator_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticatorManager_CreateAuthenticator_ProxyToResponder::Run(
::mojo::PendingRemote<VirtualAuthenticator> in_authenticator) { … }
class VirtualAuthenticatorManager_GetAuthenticators_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticatorManager_GetAuthenticators_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticatorManager_GetAuthenticators_ProxyToResponder::Run(
WTF::Vector<::mojo::PendingRemote<VirtualAuthenticator>> in_authenticators) { … }
class VirtualAuthenticatorManager_RemoveAuthenticator_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticatorManager_RemoveAuthenticator_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticatorManager_RemoveAuthenticator_ProxyToResponder::Run(
bool in_removed) { … }
class VirtualAuthenticatorManager_ClearAuthenticators_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool VirtualAuthenticatorManager_ClearAuthenticators_ForwardToCallback::Accept(
mojo::Message* message) { … }
void VirtualAuthenticatorManager_ClearAuthenticators_ProxyToResponder::Run(
) { … }
bool VirtualAuthenticatorManagerStubDispatch::Accept(
VirtualAuthenticatorManager* impl,
mojo::Message* message) { … }
bool VirtualAuthenticatorManagerStubDispatch::AcceptWithResponder(
VirtualAuthenticatorManager* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kVirtualAuthenticatorManagerValidationInfo[] = …;
bool VirtualAuthenticatorManagerRequestValidator::Accept(mojo::Message* message) { … }
bool VirtualAuthenticatorManagerResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::test::mojom::blink::VirtualAuthenticatorOptions::DataView, ::blink::test::mojom::blink::VirtualAuthenticatorOptionsPtr>::Read(
::blink::test::mojom::blink::VirtualAuthenticatorOptions::DataView input,
::blink::test::mojom::blink::VirtualAuthenticatorOptionsPtr* output) { … }
bool StructTraits<::blink::test::mojom::blink::RegisteredKey::DataView, ::blink::test::mojom::blink::RegisteredKeyPtr>::Read(
::blink::test::mojom::blink::RegisteredKey::DataView input,
::blink::test::mojom::blink::RegisteredKeyPtr* output) { … }
}
namespace blink::test::mojom::blink {
void VirtualAuthenticatorInterceptorForTesting::GetUniqueId(GetUniqueIdCallback callback) { … }
void VirtualAuthenticatorInterceptorForTesting::AddRegistration(RegisteredKeyPtr key, AddRegistrationCallback callback) { … }
void VirtualAuthenticatorInterceptorForTesting::GetRegistrations(GetRegistrationsCallback callback) { … }
void VirtualAuthenticatorInterceptorForTesting::RemoveRegistration(const WTF::Vector<uint8_t>& key_handle, RemoveRegistrationCallback callback) { … }
void VirtualAuthenticatorInterceptorForTesting::ClearRegistrations(ClearRegistrationsCallback callback) { … }
void VirtualAuthenticatorInterceptorForTesting::GetLargeBlob(const WTF::Vector<uint8_t>& key_handle, GetLargeBlobCallback callback) { … }
void VirtualAuthenticatorInterceptorForTesting::SetLargeBlob(const WTF::Vector<uint8_t>& key_handle, const WTF::Vector<uint8_t>& blob, SetLargeBlobCallback callback) { … }
void VirtualAuthenticatorInterceptorForTesting::SetUserVerified(bool verified, SetUserVerifiedCallback callback) { … }
VirtualAuthenticatorAsyncWaiter::VirtualAuthenticatorAsyncWaiter(
VirtualAuthenticator* proxy) : … { … }
VirtualAuthenticatorAsyncWaiter::~VirtualAuthenticatorAsyncWaiter() = default;
void VirtualAuthenticatorAsyncWaiter::GetUniqueId(
WTF::String* out_id) { … }
WTF::String VirtualAuthenticatorAsyncWaiter::GetUniqueId(
) { … }
void VirtualAuthenticatorAsyncWaiter::AddRegistration(
RegisteredKeyPtr key, bool* out_added) { … }
bool VirtualAuthenticatorAsyncWaiter::AddRegistration(
RegisteredKeyPtr key) { … }
void VirtualAuthenticatorAsyncWaiter::GetRegistrations(
WTF::Vector<RegisteredKeyPtr>* out_keys) { … }
WTF::Vector<RegisteredKeyPtr> VirtualAuthenticatorAsyncWaiter::GetRegistrations(
) { … }
void VirtualAuthenticatorAsyncWaiter::RemoveRegistration(
const WTF::Vector<uint8_t>& key_handle, bool* out_removed) { … }
bool VirtualAuthenticatorAsyncWaiter::RemoveRegistration(
const WTF::Vector<uint8_t>& key_handle) { … }
void VirtualAuthenticatorAsyncWaiter::ClearRegistrations(
) { … }
void VirtualAuthenticatorAsyncWaiter::GetLargeBlob(
const WTF::Vector<uint8_t>& key_handle, std::optional<WTF::Vector<uint8_t>>* out_blob) { … }
std::optional<WTF::Vector<uint8_t>> VirtualAuthenticatorAsyncWaiter::GetLargeBlob(
const WTF::Vector<uint8_t>& key_handle) { … }
void VirtualAuthenticatorAsyncWaiter::SetLargeBlob(
const WTF::Vector<uint8_t>& key_handle, const WTF::Vector<uint8_t>& blob, bool* out_set) { … }
bool VirtualAuthenticatorAsyncWaiter::SetLargeBlob(
const WTF::Vector<uint8_t>& key_handle, const WTF::Vector<uint8_t>& blob) { … }
void VirtualAuthenticatorAsyncWaiter::SetUserVerified(
bool verified) { … }
void VirtualAuthenticatorManagerInterceptorForTesting::CreateAuthenticator(VirtualAuthenticatorOptionsPtr options, CreateAuthenticatorCallback callback) { … }
void VirtualAuthenticatorManagerInterceptorForTesting::GetAuthenticators(GetAuthenticatorsCallback callback) { … }
void VirtualAuthenticatorManagerInterceptorForTesting::RemoveAuthenticator(const WTF::String& id, RemoveAuthenticatorCallback callback) { … }
void VirtualAuthenticatorManagerInterceptorForTesting::ClearAuthenticators(ClearAuthenticatorsCallback callback) { … }
VirtualAuthenticatorManagerAsyncWaiter::VirtualAuthenticatorManagerAsyncWaiter(
VirtualAuthenticatorManager* proxy) : … { … }
VirtualAuthenticatorManagerAsyncWaiter::~VirtualAuthenticatorManagerAsyncWaiter() = default;
void VirtualAuthenticatorManagerAsyncWaiter::CreateAuthenticator(
VirtualAuthenticatorOptionsPtr options, ::mojo::PendingRemote<VirtualAuthenticator>* out_authenticator) { … }
::mojo::PendingRemote<VirtualAuthenticator> VirtualAuthenticatorManagerAsyncWaiter::CreateAuthenticator(
VirtualAuthenticatorOptionsPtr options) { … }
void VirtualAuthenticatorManagerAsyncWaiter::GetAuthenticators(
WTF::Vector<::mojo::PendingRemote<VirtualAuthenticator>>* out_authenticators) { … }
WTF::Vector<::mojo::PendingRemote<VirtualAuthenticator>> VirtualAuthenticatorManagerAsyncWaiter::GetAuthenticators(
) { … }
void VirtualAuthenticatorManagerAsyncWaiter::RemoveAuthenticator(
const WTF::String& id, bool* out_removed) { … }
bool VirtualAuthenticatorManagerAsyncWaiter::RemoveAuthenticator(
const WTF::String& id) { … }
void VirtualAuthenticatorManagerAsyncWaiter::ClearAuthenticators(
) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif