Source code
Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
/*
* IPC Transaction protocol for the WebAuthn DOM API. This IPC protocol allows
* the content process to call to the parent to access hardware for
* authentication registration and challenges. All transactions start in the
* child process, and the parent replies with a "Confirm*" message, or a
* "Cancel" message if there was an error (no hardware available, no registered
* keys, etc) or interruption (another transaction was started in another
* content process). Similarly, the content process can also request a cancel,
* either triggered explicitly by the user/script or due to UI events like
* selecting a different tab.
*/
include protocol PBackground;
using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
namespace mozilla {
namespace dom {
struct WebAuthnAuthenticatorSelection {
nsString residentKey;
nsString userVerificationRequirement;
nsString? authenticatorAttachment;
};
struct WebAuthnScopedCredential {
uint8_t[] id;
uint8_t transports;
};
struct WebAuthnExtensionAppId {
nsString appIdentifier;
};
struct WebAuthnExtensionCredProps {
bool credProps;
};
struct WebAuthnExtensionHmacSecret {
bool hmacCreateSecret;
};
struct WebAuthnExtensionMinPinLength {
bool minPinLength;
};
union WebAuthnExtension {
WebAuthnExtensionAppId;
WebAuthnExtensionCredProps;
WebAuthnExtensionHmacSecret;
WebAuthnExtensionMinPinLength;
};
struct WebAuthnExtensionResultAppId {
bool AppId;
};
struct WebAuthnExtensionResultCredProps {
bool rk;
};
struct WebAuthnExtensionResultHmacSecret {
bool hmacCreateSecret;
};
union WebAuthnExtensionResult {
WebAuthnExtensionResultAppId;
WebAuthnExtensionResultCredProps;
WebAuthnExtensionResultHmacSecret;
};
struct WebAuthnMakeCredentialRpInfo {
nsString Name;
};
struct WebAuthnMakeCredentialUserInfo {
uint8_t[] Id;
nsString Name;
nsString DisplayName;
};
struct CoseAlg {
long alg;
};
struct WebAuthnMakeCredentialInfo {
nsString Origin;
nsString RpId;
uint8_t[] Challenge;
nsCString ClientDataJSON;
uint32_t TimeoutMS;
WebAuthnScopedCredential[] ExcludeList;
WebAuthnMakeCredentialRpInfo Rp;
WebAuthnMakeCredentialUserInfo User;
CoseAlg[] coseAlgs;
WebAuthnExtension[] Extensions;
WebAuthnAuthenticatorSelection AuthenticatorSelection;
nsString attestationConveyancePreference;
uint64_t BrowsingContextId;
};
struct WebAuthnMakeCredentialResult {
nsCString ClientDataJSON;
uint8_t[] AttestationObject;
uint8_t[] KeyHandle;
nsString[] Transports;
WebAuthnExtensionResult[] Extensions;
nsString? AuthenticatorAttachment;
};
struct WebAuthnGetAssertionInfo {
nsString Origin;
nsString RpId;
uint8_t[] Challenge;
nsCString ClientDataJSON;
uint32_t TimeoutMS;
WebAuthnScopedCredential[] AllowList;
WebAuthnExtension[] Extensions;
nsString userVerificationRequirement;
bool ConditionallyMediated;
uint64_t BrowsingContextId;
};
struct WebAuthnGetAssertionResult {
nsCString ClientDataJSON;
uint8_t[] KeyHandle;
uint8_t[] Signature;
uint8_t[] AuthenticatorData;
WebAuthnExtensionResult[] Extensions;
uint8_t[] UserHandle;
nsString? AuthenticatorAttachment;
};
[ManualDealloc]
async protocol PWebAuthnTransaction {
manager PBackground;
parent:
async RequestRegister(uint64_t aTransactionId, WebAuthnMakeCredentialInfo aTransactionInfo);
async RequestSign(uint64_t aTransactionId, WebAuthnGetAssertionInfo aTransactionInfo);
async RequestIsUVPAA() returns (bool available);
[Tainted] async RequestCancel(uint64_t aTransactionId);
async DestroyMe();
child:
async __delete__();
async ConfirmRegister(uint64_t aTransactionId, WebAuthnMakeCredentialResult aResult);
async ConfirmSign(uint64_t aTransactionId, WebAuthnGetAssertionResult aResult);
async Abort(uint64_t aTransactionId, nsresult Error);
};
}
}