DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (b6d82b1a6b02)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
/* 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,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * 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::AttestationConveyancePreference from "mozilla/dom/WebAuthnUtil.h";
using mozilla::dom::AuthenticatorAttachment from "mozilla/dom/WebAuthnUtil.h";
using mozilla::dom::UserVerificationRequirement from "mozilla/dom/WebAuthnUtil.h";

namespace mozilla {
namespace dom {

struct WebAuthnAuthenticatorSelection {
  bool requireResidentKey;
  UserVerificationRequirement userVerificationRequirement;
  AuthenticatorAttachment? authenticatorAttachment;
};

struct WebAuthnScopedCredential {
  uint8_t[] id;
  uint8_t transports;
};

struct WebAuthnExtensionAppId {
  uint8_t[] AppId;
  nsString appIdentifier;
};

struct WebAuthnExtensionHmacSecret {
  bool hmacCreateSecret;
};

union WebAuthnExtension {
  WebAuthnExtensionAppId;
  WebAuthnExtensionHmacSecret;
};

struct WebAuthnExtensionResultAppId {
  bool AppId;
};

struct WebAuthnExtensionResultHmacSecret {
  bool hmacCreateSecret;
};

union WebAuthnExtensionResult {
  WebAuthnExtensionResultAppId;
  WebAuthnExtensionResultHmacSecret;
};

struct WebAuthnMakeCredentialRpInfo {
  nsString Name;
  nsString Icon;
};

struct WebAuthnMakeCredentialUserInfo {
  uint8_t[] Id;
  nsString Name;
  nsString Icon;
  nsString DisplayName;
};

struct CoseAlg {
  long alg;
};

struct WebAuthnMakeCredentialExtraInfo {
  WebAuthnMakeCredentialRpInfo Rp;
  WebAuthnMakeCredentialUserInfo User;
  CoseAlg[] coseAlgs;
  WebAuthnExtension[] Extensions;
  WebAuthnAuthenticatorSelection AuthenticatorSelection;
  AttestationConveyancePreference attestationConveyancePreference;
};

struct WebAuthnMakeCredentialInfo {
  nsString Origin;
  nsString RpId;
  uint8_t[] Challenge;
  nsCString ClientDataJSON;
  uint32_t TimeoutMS;
  WebAuthnScopedCredential[] ExcludeList;
  WebAuthnMakeCredentialExtraInfo? Extra;
};

struct WebAuthnMakeCredentialResult {
  nsCString ClientDataJSON;
  uint8_t[] AttestationObject;
  uint8_t[] KeyHandle;
  /* Might be empty if the token implementation doesn't support CTAP1. */
  uint8_t[] RegistrationData;
  WebAuthnExtensionResult[] Extensions;
};

struct WebAuthnGetAssertionExtraInfo {
  WebAuthnExtension[] Extensions;
  UserVerificationRequirement userVerificationRequirement;
};

struct WebAuthnGetAssertionInfo {
  nsString Origin;
  nsString RpId;
  uint8_t[] Challenge;
  nsCString ClientDataJSON;
  uint32_t TimeoutMS;
  WebAuthnScopedCredential[] AllowList;
  WebAuthnGetAssertionExtraInfo? Extra;
};

struct WebAuthnGetAssertionResult {
  nsCString ClientDataJSON;
  uint8_t[] KeyHandle;
  uint8_t[] Signature;
  uint8_t[] AuthenticatorData;
  WebAuthnExtensionResult[] Extensions;
  /* Might be empty if the token implementation doesn't support CTAP1. */
  uint8_t[] SignatureData;
  uint8_t[] UserHandle;
};

async protocol PWebAuthnTransaction {
  manager PBackground;

  parent:
    async RequestRegister(uint64_t aTransactionId, WebAuthnMakeCredentialInfo aTransactionInfo);
    async RequestSign(uint64_t aTransactionId, WebAuthnGetAssertionInfo aTransactionInfo);
    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);
};

}
}