chromium/chromeos/ash/components/dbus/userdataauth/BUILD.gn

# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chromeos/ui_mode.gni")
import("//third_party/protobuf/proto_library.gni")

assert(is_chromeos_ash, "Non-ChromeOS builds cannot depend on //chromeos/ash")

component("userdataauth") {
  output_name = "ash_dbus_userdataauth"

  defines = [ "IS_USERDATAAUTH_CLIENT_IMPL" ]

  deps = [
    ":userdataauth_proto",
    "//base",
    "//chromeos/ash/components/cryptohome:public",
    "//chromeos/ash/components/dbus/cryptohome",
    "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto",
    "//chromeos/dbus/common",
    "//components/policy/proto",
    "//dbus",
  ]

  sources = [
    "cryptohome_misc_client.cc",
    "cryptohome_misc_client.h",
    "cryptohome_pkcs11_client.cc",
    "cryptohome_pkcs11_client.h",
    "fake_cryptohome_misc_client.cc",
    "fake_cryptohome_misc_client.h",
    "fake_cryptohome_pkcs11_client.cc",
    "fake_cryptohome_pkcs11_client.h",
    "fake_userdataauth_client.cc",
    "fake_userdataauth_client.h",
    "userdataauth_client.cc",
    "userdataauth_client.h",
  ]
}

static_library("test_support") {
  testonly = true

  sources = [
    "mock_userdataauth_client.cc",
    "mock_userdataauth_client.h",
  ]
  deps = [
    ":userdataauth",
    ":userdataauth_proto",
    "//base",
    "//testing/gmock",
  ]
}

proto_library("userdataauth_proto") {
  deps = [ "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto" ]

  sources = [
    "//third_party/cros_system_api/dbus/cryptohome/UserDataAuth.proto",
    "//third_party/cros_system_api/dbus/cryptohome/auth_factor.proto",
    "//third_party/cros_system_api/dbus/cryptohome/fido.proto",
    "//third_party/cros_system_api/dbus/cryptohome/recoverable_key_store.proto",
  ]

  proto_out_dir = "chromeos/ash/components/dbus/cryptohome"
}