dom/webauthn/moz.build
author Tim Taubert <ttaubert@mozilla.com>
Thu, 02 Nov 2017 12:18:19 +0100
changeset 692130 3a5bfa2ffc9890b7db7c49d5eabd044c6c217e70
parent 681911 c09ea1671fc337f30941d52e64588f76af7096ef
child 707783 bb739695f5661b572d0fbf2dde5977f2a7433d38
permissions -rw-r--r--
Bug 1412408 - Fix content process leak of U2FTransactionChild instances r=jcj Summary: This patch fixes the reported leak of U2FTransactionChild instances in the content process by introducing a WebAuthnTransactionChildBase class that both WebAuthnTransactionChild and U2FTransactionChild inherit from. This base class is responsible for proper refcounting. In BackgroundChildImpl::DeallocPWebAuthnTransactionChild() we currently always cast to WebAuthnTransactionChild, that will work only for the WebAuthn API. We can now cast to WebAuthnTransactionChildBase to make this work for U2F as well. Reviewers: jcj Reviewed By: jcj Bug #: 1412408 Differential Revision: https://phabricator.services.mozilla.com/D179

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.

with Files("**"):
    BUG_COMPONENT = ("Core", "DOM: Device Interfaces")

IPDL_SOURCES += [
    'PWebAuthnTransaction.ipdl'
]

EXPORTS.mozilla.dom += [
    'AuthenticatorAssertionResponse.h',
    'AuthenticatorAttestationResponse.h',
    'AuthenticatorResponse.h',
    'PublicKeyCredential.h',
    'U2FHIDTokenManager.h',
    'U2FSoftTokenManager.h',
    'U2FTokenManager.h',
    'U2FTokenTransport.h',
    'WebAuthnCBORUtil.h',
    'WebAuthnManager.h',
    'WebAuthnTransactionChild.h',
    'WebAuthnTransactionChildBase.h',
    'WebAuthnTransactionParent.h',
    'WebAuthnUtil.h',
]

UNIFIED_SOURCES += [
    'AuthenticatorAssertionResponse.cpp',
    'AuthenticatorAttestationResponse.cpp',
    'AuthenticatorResponse.cpp',
    'cbor-cpp/src/encoder.cpp',
    'cbor-cpp/src/output_dynamic.cpp',
    'PublicKeyCredential.cpp',
    'U2FHIDTokenManager.cpp',
    'U2FSoftTokenManager.cpp',
    'U2FTokenManager.cpp',
    'WebAuthnCBORUtil.cpp',
    'WebAuthnManager.cpp',
    'WebAuthnTransactionChild.cpp',
    'WebAuthnTransactionChildBase.cpp',
    'WebAuthnTransactionParent.cpp',
    'WebAuthnUtil.cpp',
]

include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'

LOCAL_INCLUDES += [
    '/dom/base',
    '/dom/crypto',
    '/security/manager/ssl',
    '/security/pkix/include',
    '/security/pkix/lib',
]

if CONFIG['OS_ARCH'] == 'WINNT':
    OS_LIBS += [
        'hid',
    ]

MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']