dom/webauthn/PWebAuthnTransaction.ipdl
author David Major <dmajor@mozilla.com>
Wed, 20 Dec 2017 09:07:46 -0500
changeset 448763 e9cfe039a796e2963a6d3e7d2a161b02cdbadcac
parent 446960 752801d6a02040796db0f379b23357195635b68a
child 450104 7b0bbd94352de559b0656c2b19e482c679ea34b8
permissions -rw-r--r--
Bug 1425906: Rename LINK to LINKER throughout the build system. r=glandium Windows linkers give special meaning to getenv("LINK"), which makes `export LINK=...` in mozconfigs do unexpected things.

/* 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;

namespace mozilla {
namespace dom {

struct WebAuthnAuthenticatorSelection {
    bool requireResidentKey;
    bool requireUserVerification;
    bool requirePlatformAttachment;
};

struct WebAuthnScopedCredentialDescriptor {
  uint8_t[] id;
};

struct WebAuthnExtension {
  /* TODO Fill in with predefined extensions */
};

struct WebAuthnMakeCredentialInfo {
  uint8_t[] RpIdHash;
  uint8_t[] ClientDataHash;
  uint32_t TimeoutMS;
  WebAuthnScopedCredentialDescriptor[] ExcludeList;
  WebAuthnExtension[] Extensions;
  WebAuthnAuthenticatorSelection AuthenticatorSelection;
};

struct WebAuthnGetAssertionInfo {
  uint8_t[] RpIdHash;
  uint8_t[] ClientDataHash;
  uint32_t TimeoutMS;
  WebAuthnScopedCredentialDescriptor[] AllowList;
  WebAuthnExtension[] Extensions;
};

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, uint8_t[] RegBuffer);
    async ConfirmSign(uint64_t aTransactionId, uint8_t[] CredentialID, uint8_t[] ReplyBuffer);
    async Abort(uint64_t aTransactionId, nsresult Error);
};

}
}