1# 2# Copyright (C) 2024 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# 16 17# 18# This makefile should be included by devices that use Trusty TEE 19# to pull in a set of Trusty KeyMint specific modules. 20# 21# Allow KeyMint HAL service implementation selection at build time. This must be 22# synchronized with the TA implementation included in Trusty. Possible values: 23# 24# - Rust implementation for Trusty VM (requires Trusty VM support): 25# export TRUSTY_KEYMINT_IMPL=rust 26# export TRUSTY_SYSTEM_VM=nonsecure 27# - Rust implementation for Trusty TEE (no Trusty VM support): 28# export TRUSTY_KEYMINT_IMPL=rust 29# - C++ implementation (default): (any other value or unset TRUSTY_KEYMINT_IMPL) 30 31ifeq ($(TRUSTY_KEYMINT_IMPL),rust) 32 ifeq ($(TRUSTY_SYSTEM_VM),nonsecure) 33 LOCAL_KEYMINT_PRODUCT_PACKAGE := android.hardware.security.keymint-service.rust.trusty.system.nonsecure 34 else 35 LOCAL_KEYMINT_PRODUCT_PACKAGE := android.hardware.security.keymint-service.rust.trusty 36 endif 37else 38 # Default to the C++ implementation 39 LOCAL_KEYMINT_PRODUCT_PACKAGE := android.hardware.security.keymint-service.trusty 40endif 41 42PRODUCT_PACKAGES += \ 43 $(LOCAL_KEYMINT_PRODUCT_PACKAGE) \ 44