| # Copyright 2020 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//common-mk/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":attestation-injected-keys", |
| ":fake_pca_agentd", |
| ":hwsec-test-va", |
| ] |
| if (use.test) { |
| deps += [ ":hwsec-test-utils_testrunner" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome-${libbase_ver}", |
| ] |
| defines = [ "USE_TPM2=${use.tpm2}" ] |
| } |
| |
| executable("attestation-injected-keys") { |
| configs += [ ":target_defaults" ] |
| sources = [ |
| "attestation_injected_keys/main.cc", |
| "attestation_injected_keys/utility.cc", |
| ] |
| |
| # NOSORT |
| pkg_deps = [ |
| # system_api depends on protobuf (or protobuf-lite). It must appear |
| # before protobuf here or the linker flags won't be in the right |
| # order. |
| "system_api", |
| "protobuf", |
| ] |
| } |
| |
| executable("hwsec-test-va") { |
| configs += [ ":target_defaults" ] |
| sources = [ "verified_access/main.cc" ] |
| deps = [ |
| ":common_library", |
| ":verified_access_library", |
| ] |
| |
| # NOSORT |
| pkg_deps = [ |
| "openssl", |
| |
| # system_api depends on protobuf (or protobuf-lite). It must appear |
| # before protobuf here or the linker flags won't be in the right |
| # order. |
| "system_api", |
| "protobuf", |
| ] |
| } |
| |
| source_set("common_library") { |
| configs += [ ":target_defaults" ] |
| sources = [ |
| "common/attestation_crypto.cc", |
| "common/openssl_utility.cc", |
| "well_known_key_pairs/well_known_key_pairs.cc", |
| ] |
| } |
| |
| source_set("verified_access_library") { |
| configs += [ ":target_defaults" ] |
| sources = [ "verified_access/verified_access.cc" ] |
| } |
| |
| executable("fake_pca_agentd") { |
| configs += [ ":target_defaults" ] |
| sources = [ "fake_pca_agent/main.cc" ] |
| deps = [ |
| ":common_library", |
| ":fake_pca_agent_library", |
| ] |
| |
| # NOSORT |
| pkg_deps = [ |
| "openssl", |
| |
| # system_api depends on protobuf (or protobuf-lite). It must appear |
| # before protobuf here or the linker flags won't be in the right |
| # order. |
| "system_api", |
| "protobuf", |
| ] |
| } |
| |
| source_set("fake_pca_agent_library") { |
| configs += [ ":target_defaults" ] |
| sources = [ |
| "fake_pca_agent/issue_certificate.cc", |
| "fake_pca_agent/pca_factory.cc", |
| "fake_pca_agent/service.cc", |
| ] |
| if (use.tpm2) { |
| sources += [ |
| "fake_pca_agent/kdf.cc", |
| "fake_pca_agent/pca_certify_v2.cc", |
| "fake_pca_agent/pca_enroll_v2.cc", |
| "fake_pca_agent/tpm2_struct_utils.cc", |
| ] |
| libs = [ "trunks" ] |
| } else { |
| sources += [ |
| "fake_pca_agent/pca_certify_v1.cc", |
| "fake_pca_agent/pca_enroll_v1.cc", |
| "fake_pca_agent/tpm1_struct_utils.cc", |
| ] |
| libs = [ "tspi" ] |
| } |
| } |
| |
| if (use.test) { |
| pkg_config("hwsec-test-utils_testrunner_config") { |
| pkg_deps = [ "libchrome-test-${libbase_ver}" ] |
| } |
| |
| executable("hwsec-test-utils_testrunner") { |
| configs += [ |
| ":target_defaults", |
| ":hwsec-test-utils_testrunner_config", |
| "//common-mk:test", |
| ] |
| sources = [ "verified_access/verified_access_test.cc" ] |
| deps = [ |
| ":common_library", |
| ":fake_pca_agent_library", |
| ":verified_access_library", |
| "//common-mk/testrunner", |
| ] |
| if (use.tpm2) { |
| sources += [ |
| "fake_pca_agent/pca_certify_v2_test.cc", |
| "fake_pca_agent/pca_enroll_v2_test.cc", |
| ] |
| libs = [ "trunks" ] |
| } else { |
| sources += [ |
| "fake_pca_agent/pca_certify_v1_test.cc", |
| "fake_pca_agent/pca_enroll_v1_test.cc", |
| ] |
| libs = [ "tspi" ] |
| } |
| |
| # NOSORT |
| pkg_deps = [ |
| "openssl", |
| |
| # system_api depends on protobuf (or protobuf-lite). It must appear |
| # before protobuf here or the linker flags won't be in the right |
| # order. |
| "system_api", |
| "protobuf", |
| ] |
| } |
| } |