// Copyright 2024 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // A library for generating TPM commands and parsing TPM responses. Derived from // the Chromium OS trunks daemon's TPM code. rust_library { name: "libtpmclient", crate_name: "tpmclient", host_supported: true, srcs: ["lib.rs"], rustlibs: ["libcxx"], shared_libs: ["libtpmgenerated"], } // cxxbridge generates C++ code that is included in libtpmgenerated. genrule { name: "libtpmclient_bridge", tools: ["cxxbridge"], cmd: "$(location cxxbridge) $(in) > $(out)", srcs: ["lib.rs"], out: ["libtpmclient_cxx_generated.cc"], } cc_library { name: "libtpmgenerated", host_supported: true, shared_libs: [ "libbase", "libcrypto", ], srcs: [ "ffi.cc", "hex.cc", "multiple_authorization_delegate.cc", "password_authorization_delegate.cc", "secure_hash.cc", "tpm_generated.cc", ], generated_headers: ["cxx-bridge-header"], generated_sources: ["libtpmclient_bridge"], } cc_test_host { name: "libtpmgenerated_test", srcs: [ "mock_authorization_delegate.cc", "mock_command_transceiver.cc", "tpm_generated_test.cc", ], shared_libs: [ "libtpmgenerated", ], static_libs: [ "libgmock", ], }