1// 2// Copyright (C) 2020 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15 16package { 17 default_applicable_licenses: ["Android-Apache-2.0"], 18} 19 20cc_defaults { 21 name: "secure_env_defaults", 22 shared_libs: [ 23 "libext2_blkid", 24 "libbase", 25 "libcppbor_external", 26 "libcppcose_rkp", 27 "libcuttlefish_fs", 28 "libcuttlefish_kernel_log_monitor_utils", 29 "libcuttlefish_security", 30 "libcuttlefish_utils", 31 "libfruit", 32 "libgatekeeper", 33 "libjsoncpp", 34 "libkeymaster_portable", 35 "libkeymaster_messages", 36 "libsoft_attestation_cert", 37 "liblog", 38 "libcrypto", 39 "libcutils", 40 "libpuresoftkeymasterdevice_host", 41 "ms-tpm-20-ref-lib", 42 "tpm2-tss2-esys", 43 "tpm2-tss2-mu", 44 "tpm2-tss2-rc", 45 "tpm2-tss2-tcti", 46 ], 47 static_libs: [ 48 "libcuttlefish_host_config", 49 "libgflags", 50 "libscrypt_static", 51 ], 52 cflags: [ 53 "-fno-rtti", // Required for libkeymaster_portable 54 ], 55} 56 57cc_library_host_static { 58 name: "libsecure_env", 59 srcs: [ 60 "composite_serialization.cpp", 61 "confui_sign_server.cpp", 62 "device_tpm.cpp", 63 "encrypted_serializable.cpp", 64 "fragile_tpm_storage.cpp", 65 "gatekeeper_responder.cpp", 66 "hmac_serializable.cpp", 67 "in_process_tpm.cpp", 68 "insecure_fallback_storage.cpp", 69 "json_serializable.cpp", 70 "keymaster_responder.cpp", 71 "primary_key_builder.cpp", 72 "secure_env.cpp", 73 "tpm_attestation_record.cpp", 74 "tpm_auth.cpp", 75 "tpm_commands.cpp", 76 "tpm_encrypt_decrypt.cpp", 77 "tpm_gatekeeper.cpp", 78 "tpm_hmac.cpp", 79 "tpm_key_blob_maker.cpp", 80 "tpm_keymaster_context.cpp", 81 "tpm_keymaster_enforcement.cpp", 82 "tpm_random_source.cpp", 83 "tpm_remote_provisioning_context.cpp", 84 "tpm_resource_manager.cpp", 85 "tpm_serialize.cpp", 86 ], 87 defaults: ["cuttlefish_buildhost_only", "secure_env_defaults"], 88} 89 90cc_binary_host { 91 name: "secure_env", 92 srcs: [ 93 "secure_env.cpp", 94 ], 95 static_libs: [ 96 "libsecure_env", 97 ], 98 defaults: ["cuttlefish_buildhost_only", "secure_env_defaults"], 99} 100 101cc_test_host { 102 name: "libsecure_env_test", 103 srcs: [ 104 "test_tpm.cpp", 105 "encrypted_serializable_test.cpp", 106 ], 107 static_libs: [ 108 "libsecure_env", 109 ], 110 defaults: ["cuttlefish_buildhost_only", "secure_env_defaults"], 111 test_options: { 112 unit_test: true, 113 }, 114} 115