blob: 7dd5aef87273aabc678dfcbb7a190a7175b1985e [file] [log] [blame]
Kenny Roota91203b2012-02-15 15:00:46 -08001#
2# Copyright (C) 2009 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
17LOCAL_PATH := $(call my-dir)
18
Darren Krahn251cb282015-09-28 08:51:18 -070019# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
20# which varies depending on what is being built.
21define keystore_proto_include
22$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
23endef
24
Dan Willemsenb346cfb2016-12-12 23:39:24 +000025ifneq ($(TARGET_BUILD_PDK),true)
Kenny Roota91203b2012-02-15 15:00:46 -080026include $(CLEAR_VARS)
Shawn Willdenbd4bb2f2014-08-29 16:31:51 -060027ifeq ($(USE_32_BIT_KEYSTORE), true)
28LOCAL_MULTILIB := 32
29endif
Chad Brubaker61c58842015-03-16 11:05:51 -070030LOCAL_CFLAGS := -Wall -Wextra -Werror -Wunused
Shawn Willdenc1d1fee2016-01-26 22:44:56 -070031LOCAL_SRC_FILES := \
32 auth_token_table.cpp \
33 blob.cpp \
34 entropy.cpp \
35 key_store_service.cpp \
Janis Danisevskis18f27ad2016-06-01 13:57:40 -070036 keystore_attestation_id.cpp \
Shawn Willdenc1d1fee2016-01-26 22:44:56 -070037 keyblob_utils.cpp \
38 keystore.cpp \
39 keystore_main.cpp \
40 keystore_utils.cpp \
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +010041 legacy_keymaster_device_wrapper.cpp \
42 keymaster_enforcement.cpp \
Shawn Willdenc1d1fee2016-01-26 22:44:56 -070043 operation.cpp \
44 permissions.cpp \
Janis Danisevskis18f27ad2016-06-01 13:57:40 -070045 user_state.cpp \
Janis Danisevskis32261c82017-06-07 18:03:31 -070046 grant_store.cpp \
Janis Danisevskis18f27ad2016-06-01 13:57:40 -070047 ../../../frameworks/base/core/java/android/security/keymaster/IKeyAttestationApplicationIdProvider.aidl
Kenny Root17208e02013-09-04 13:56:03 -070048LOCAL_SHARED_LIBRARIES := \
49 libbinder \
50 libcutils \
51 libcrypto \
52 libhardware \
Roshan Piuse653c932017-03-29 10:08:47 -070053 libwifikeystorehal \
Kenny Root17208e02013-09-04 13:56:03 -070054 libkeystore_binder \
55 liblog \
56 libsoftkeymaster \
Riley Spahneaabae92014-06-30 12:39:52 -070057 libutils \
Chad Brubaker919cb2a2015-02-05 21:58:25 -080058 libselinux \
Chad Brubakerd80c7b42015-03-31 11:04:28 -070059 libsoftkeymasterdevice \
Shawn Willden9221bff2015-06-18 18:23:54 -060060 libkeymaster_messages \
Janis Danisevskis5cc0d5e2017-04-26 14:19:51 -070061 libkeymaster_portable \
Janis Danisevskis5d50d7e2017-05-04 14:04:00 -070062 libkeymaster_staging \
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +010063 libhwbinder \
64 libhidlbase \
65 libhidltransport \
Roshan Piuse653c932017-03-29 10:08:47 -070066 android.hardware.keymaster@3.0 \
67 android.system.wifi.keystore@1.0
Steven Moreland52868f22017-05-01 12:35:41 -070068LOCAL_HEADER_LIBRARIES := libbase_headers
Kenny Roota91203b2012-02-15 15:00:46 -080069LOCAL_MODULE := keystore
Kenny Root70e3a862012-02-15 17:20:23 -080070LOCAL_MODULE_TAGS := optional
Tom Cherryad299712015-08-14 13:06:37 -070071LOCAL_INIT_RC := keystore.rc
Chad Brubaker919cb2a2015-02-05 21:58:25 -080072LOCAL_C_INCLUES := system/keymaster/
Chad Brubakerdb25fcd2015-08-12 11:23:45 -070073LOCAL_CLANG := true
74LOCAL_SANITIZE := integer
Kenny Root6a9cafc2012-11-16 12:53:42 -080075LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Janis Danisevskis18f27ad2016-06-01 13:57:40 -070076LOCAL_AIDL_INCLUDES := frameworks/base/core/java/
Kenny Roota91203b2012-02-15 15:00:46 -080077include $(BUILD_EXECUTABLE)
Dan Willemsenb346cfb2016-12-12 23:39:24 +000078endif
Kenny Roota91203b2012-02-15 15:00:46 -080079
80include $(CLEAR_VARS)
Shawn Willdenbd4bb2f2014-08-29 16:31:51 -060081ifeq ($(USE_32_BIT_KEYSTORE), true)
82LOCAL_MULTILIB := 32
83endif
Kenny Rootda1ed9a2012-04-10 12:34:07 -070084LOCAL_CFLAGS := -Wall -Wextra -Werror
Kenny Roota91203b2012-02-15 15:00:46 -080085LOCAL_SRC_FILES := keystore_cli.cpp
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +010086LOCAL_SHARED_LIBRARIES := libcutils libcrypto libkeystore_binder libutils liblog libbinder \
87 libhwbinder \
88 libhidlbase \
89 android.hardware.keymaster@3.0
Kenny Roota91203b2012-02-15 15:00:46 -080090LOCAL_MODULE := keystore_cli
91LOCAL_MODULE_TAGS := debug
Kenny Root6a9cafc2012-11-16 12:53:42 -080092LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Kenny Roota91203b2012-02-15 15:00:46 -080093include $(BUILD_EXECUTABLE)
Kenny Root51878182012-03-13 12:53:19 -070094
Darren Krahn69a3dbc2015-09-22 16:21:04 -070095include $(CLEAR_VARS)
96ifeq ($(USE_32_BIT_KEYSTORE), true)
97LOCAL_MULTILIB := 32
98endif
Shawn Willdend3fac682016-01-26 13:50:17 -070099LOCAL_CFLAGS := -Wall -Wextra -Werror -Wno-unused-parameter -DKEYMASTER_NAME_TAGS
Darren Krahn69a3dbc2015-09-22 16:21:04 -0700100LOCAL_SRC_FILES := keystore_cli_v2.cpp
101LOCAL_SHARED_LIBRARIES := \
102 libchrome \
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +0100103 libkeystore_binder \
104 libhwbinder \
105 libhidlbase \
106 android.hardware.keymaster@3.0
107
Darren Krahn69a3dbc2015-09-22 16:21:04 -0700108LOCAL_MODULE := keystore_cli_v2
109LOCAL_MODULE_TAGS := debug
Darren Krahn251cb282015-09-28 08:51:18 -0700110LOCAL_C_INCLUDES := $(LOCAL_PATH)/include external/gtest/include
Darren Krahn69a3dbc2015-09-22 16:21:04 -0700111LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
112include $(BUILD_EXECUTABLE)
113
Kenny Root51878182012-03-13 12:53:19 -0700114# Library for keystore clients
115include $(CLEAR_VARS)
Shawn Willdenbd4bb2f2014-08-29 16:31:51 -0600116ifeq ($(USE_32_BIT_KEYSTORE), true)
117LOCAL_MULTILIB := 32
118endif
Kenny Rootda1ed9a2012-04-10 12:34:07 -0700119LOCAL_CFLAGS := -Wall -Wextra -Werror
Darren Krahn69a3dbc2015-09-22 16:21:04 -0700120LOCAL_SRC_FILES := \
121 IKeystoreService.cpp \
Janis Danisevskis18f27ad2016-06-01 13:57:40 -0700122 KeyAttestationApplicationId.cpp \
123 KeyAttestationPackageInfo.cpp \
124 Signature.cpp \
Darren Krahn69a3dbc2015-09-22 16:21:04 -0700125 keyblob_utils.cpp \
Darren Krahn251cb282015-09-28 08:51:18 -0700126 keystore_client.proto \
Darren Krahn69a3dbc2015-09-22 16:21:04 -0700127 keystore_client_impl.cpp \
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +0100128 keystore_get.cpp \
129 authorization_set.cpp \
130 keystore_tags_utils.cpp \
131 keystore_aidl_hidl_marshalling_utils.cpp
Darren Krahn69a3dbc2015-09-22 16:21:04 -0700132LOCAL_SHARED_LIBRARIES := \
133 libbinder \
Darren Krahn69a3dbc2015-09-22 16:21:04 -0700134 liblog \
Darren Krahn251cb282015-09-28 08:51:18 -0700135 libprotobuf-cpp-lite \
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +0100136 libutils \
137 libhwbinder \
138 libhidlbase \
139 android.hardware.keymaster@3.0
Darren Krahn251cb282015-09-28 08:51:18 -0700140LOCAL_MODULE_CLASS := SHARED_LIBRARIES
Kenny Root07438c82012-11-02 15:41:02 -0700141LOCAL_MODULE := libkeystore_binder
Kenny Root51878182012-03-13 12:53:19 -0700142LOCAL_MODULE_TAGS := optional
Darren Krahn251cb282015-09-28 08:51:18 -0700143LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(call keystore_proto_include)
Kenny Root07438c82012-11-02 15:41:02 -0700144LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +0100145LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := libbinder \
146 libhwbinder \
147 libhidlbase \
148 android.hardware.keymaster@3.0
Chad Brubakerdb25fcd2015-08-12 11:23:45 -0700149LOCAL_CLANG := true
150LOCAL_SANITIZE := integer
Kenny Root6a9cafc2012-11-16 12:53:42 -0800151LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Kenny Root822c3a92012-03-23 16:34:39 -0700152include $(BUILD_SHARED_LIBRARY)
Shawn Willden489dfe12015-03-17 10:13:27 -0600153
Paul Stewartbf7fc8d2017-03-10 16:22:03 -0800154# Library for keystore clients using the WiFi HIDL interface
155include $(CLEAR_VARS)
156LOCAL_CFLAGS := -Wall -Wextra -Werror
157LOCAL_SRC_FILES := \
158 keystore_get_wifi_hidl.cpp
159LOCAL_SHARED_LIBRARIES := \
160 android.system.wifi.keystore@1.0 \
161 libbase \
162 libhidlbase \
163 libhidltransport \
164 liblog \
165 libutils
166LOCAL_MODULE_CLASS := SHARED_LIBRARIES
167LOCAL_MODULE := libkeystore-wifi-hidl
168LOCAL_MODULE_TAGS := optional
169LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
170LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
171LOCAL_CLANG := true
172LOCAL_SANITIZE := integer
173LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Jiyong Parkecb258e2017-04-10 17:21:59 +0900174LOCAL_VENDOR_MODULE := true
Paul Stewartbf7fc8d2017-03-10 16:22:03 -0800175include $(BUILD_SHARED_LIBRARY)
176
Shawn Willden489dfe12015-03-17 10:13:27 -0600177# Library for unit tests
178include $(CLEAR_VARS)
179ifeq ($(USE_32_BIT_KEYSTORE), true)
180LOCAL_MULTILIB := 32
181endif
Shawn Willden489dfe12015-03-17 10:13:27 -0600182LOCAL_CFLAGS := -Wall -Wextra -Werror
183LOCAL_SRC_FILES := auth_token_table.cpp
184LOCAL_MODULE := libkeystore_test
185LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
186LOCAL_STATIC_LIBRARIES := libgtest_main
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +0100187LOCAL_SHARED_LIBRARIES := libkeymaster_messages \
188 libutils \
189 libhwbinder \
190 libhidlbase \
191 android.hardware.keymaster@3.0
192
Shawn Willden489dfe12015-03-17 10:13:27 -0600193LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
194LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
195include $(BUILD_STATIC_LIBRARY)