Android.bp 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. cc_defaults {
  2. name: "keystore_defaults",
  3. cflags: [
  4. "-Wall",
  5. "-Werror",
  6. "-Wextra",
  7. "-Wunused",
  8. ],
  9. sanitize: {
  10. misc_undefined: [
  11. "signed-integer-overflow",
  12. "unsigned-integer-overflow",
  13. "shift",
  14. "integer-divide-by-zero",
  15. "implicit-unsigned-integer-truncation",
  16. // BUG: 123630767
  17. //"implicit-signed-integer-truncation",
  18. "implicit-integer-sign-change",
  19. ],
  20. },
  21. clang: true,
  22. }
  23. cc_binary {
  24. name: "keystore",
  25. defaults: ["keystore_defaults"],
  26. srcs: [
  27. ":IKeyAttestationApplicationIdProvider.aidl",
  28. "KeyStore.cpp",
  29. "auth_token_table.cpp",
  30. "blob.cpp",
  31. "confirmation_manager.cpp",
  32. "grant_store.cpp",
  33. "key_config.proto",
  34. "key_proto_handler.cpp",
  35. "key_store_service.cpp",
  36. "keyblob_utils.cpp",
  37. "keymaster_enforcement.cpp",
  38. "keymaster_worker.cpp",
  39. "keystore_attestation_id.cpp",
  40. "keystore_main.cpp",
  41. "keystore_utils.cpp",
  42. "legacy_keymaster_device_wrapper.cpp",
  43. "operation.cpp",
  44. "operation_config.proto",
  45. "operation_proto_handler.cpp",
  46. "permissions.cpp",
  47. "user_state.cpp",
  48. ],
  49. shared_libs: [
  50. "[email protected]",
  51. "[email protected]",
  52. "[email protected]",
  53. "[email protected]",
  54. "libbase",
  55. "libbinder",
  56. "libcrypto",
  57. "libcutils",
  58. "libhardware",
  59. "libhidlbase",
  60. "libhidltransport",
  61. "libhwbinder",
  62. "libkeymaster4support",
  63. "libkeymaster_messages",
  64. "libkeymaster_portable",
  65. "libkeystore_aidl",
  66. "libkeystore_binder",
  67. "libkeystore_parcelables",
  68. "liblog",
  69. "libprotobuf-cpp-lite",
  70. "libselinux",
  71. "libservices",
  72. "libsoftkeymasterdevice",
  73. "libutils",
  74. "libwifikeystorehal",
  75. ],
  76. init_rc: ["keystore.rc"],
  77. aidl: {
  78. include_dirs: ["frameworks/base/core/java/"],
  79. },
  80. product_variables: {
  81. pdk: {
  82. enabled: false,
  83. },
  84. debuggable: {
  85. cflags: [
  86. // Allow VTS tests running as root to have
  87. // additional permissions.
  88. "-DGRANT_ROOT_ALL_PERMISSIONS",
  89. ],
  90. },
  91. },
  92. required: ["keystore_cli_v2"],
  93. }
  94. cc_binary {
  95. name: "keystore_cli",
  96. defaults: ["keystore_defaults"],
  97. srcs: ["keystore_cli.cpp"],
  98. shared_libs: [
  99. "[email protected]",
  100. "libbinder",
  101. "libcrypto",
  102. "libcutils",
  103. "libhidlbase",
  104. "libhwbinder",
  105. "libkeystore_aidl", // for IKeyStoreService.asInterface()
  106. "libkeystore_binder",
  107. "libkeystore_parcelables",
  108. "liblog",
  109. "libutils",
  110. ],
  111. }
  112. cc_binary {
  113. name: "keystore_cli_v2",
  114. defaults: ["keystore_defaults"],
  115. cflags: [
  116. "-DKEYMASTER_NAME_TAGS",
  117. "-Wno-unused-parameter",
  118. ],
  119. srcs: ["keystore_cli_v2.cpp"],
  120. shared_libs: [
  121. "[email protected]",
  122. "libbinder",
  123. "[email protected]",
  124. "libchrome",
  125. "libutils",
  126. "libhidlbase",
  127. "libhwbinder",
  128. "libkeymaster4support",
  129. "libkeystore_aidl",
  130. "libkeystore_binder",
  131. "libkeystore_parcelables",
  132. ],
  133. local_include_dirs: ["include"],
  134. }
  135. cc_library_shared {
  136. name: "libkeystore_parcelables",
  137. defaults: ["keystore_defaults"],
  138. export_include_dirs: ["include"],
  139. srcs: [
  140. "KeyAttestationApplicationId.cpp",
  141. "KeyAttestationPackageInfo.cpp",
  142. "KeymasterArguments.cpp",
  143. "keystore_aidl_hidl_marshalling_utils.cpp",
  144. "KeystoreResponse.cpp",
  145. "OperationResult.cpp",
  146. "Signature.cpp",
  147. ],
  148. shared_libs: [
  149. "[email protected]",
  150. "libbinder",
  151. "libhardware",
  152. "libhidlbase",
  153. "libhwbinder",
  154. "libkeymaster4support",
  155. "liblog",
  156. "libprotobuf-cpp-lite",
  157. "libutils",
  158. ],
  159. export_shared_lib_headers: [
  160. "[email protected]",
  161. "libbinder",
  162. "libhidlbase",
  163. "libhwbinder",
  164. "libkeymaster4support",
  165. ],
  166. }
  167. // Library for keystore clients
  168. cc_library_shared {
  169. name: "libkeystore_binder",
  170. defaults: ["keystore_defaults"],
  171. srcs: [
  172. "keyblob_utils.cpp",
  173. "keystore_client.proto",
  174. "keystore_client_impl.cpp",
  175. "keystore_get.cpp",
  176. ],
  177. shared_libs: [
  178. "[email protected]",
  179. "libbinder",
  180. "libhidlbase",
  181. "libhwbinder",
  182. "libkeymaster4support",
  183. "libkeystore_aidl",
  184. "libkeystore_parcelables",
  185. "liblog",
  186. "libprotobuf-cpp-lite",
  187. "libutils",
  188. ],
  189. proto: {
  190. type: "lite",
  191. export_proto_headers: true,
  192. },
  193. aidl: {
  194. export_aidl_headers: true,
  195. include_dirs: ["frameworks/base/core/java/"],
  196. },
  197. export_include_dirs: ["include"],
  198. export_shared_lib_headers: [
  199. "[email protected]",
  200. "libbinder",
  201. "libhidlbase",
  202. "libhwbinder",
  203. "libkeystore_aidl",
  204. "libkeystore_parcelables",
  205. ],
  206. }
  207. // Library for keystore clients using the WiFi HIDL interface
  208. cc_library_shared {
  209. name: "libkeystore-wifi-hidl",
  210. defaults: ["keystore_defaults"],
  211. srcs: ["keystore_get_wifi_hidl.cpp"],
  212. shared_libs: [
  213. "[email protected]",
  214. "libbase",
  215. "libhidlbase",
  216. "libhidltransport",
  217. "liblog",
  218. "libutils",
  219. ],
  220. export_include_dirs: ["include"],
  221. vendor: true,
  222. }
  223. // Library for unit tests
  224. cc_library_static {
  225. name: "libkeystore_test",
  226. defaults: ["keystore_defaults"],
  227. srcs: [
  228. ":IKeyAttestationApplicationIdProvider.aidl",
  229. "auth_token_table.cpp",
  230. "blob.cpp",
  231. "keystore_attestation_id.cpp",
  232. "KeyAttestationApplicationId.cpp",
  233. "KeyAttestationPackageInfo.cpp",
  234. "Signature.cpp",
  235. ],
  236. cflags: [ "-O0", ],
  237. static_libs: ["libgtest_main"],
  238. shared_libs: [
  239. "[email protected]",
  240. "libbinder",
  241. "libcrypto",
  242. "libhidlbase",
  243. "libhwbinder",
  244. "libkeymaster4support",
  245. "libutils",
  246. "libkeystore_aidl",
  247. "libkeystore_parcelables",
  248. ],
  249. export_shared_lib_headers: [
  250. "[email protected]",
  251. "libhidlbase",
  252. "libhwbinder",
  253. "libkeymaster4support",
  254. ],
  255. aidl: {
  256. include_dirs: ["frameworks/base/core/java/"],
  257. },
  258. export_include_dirs: ["include"],
  259. }
  260. filegroup {
  261. name: "keystore_aidl",
  262. srcs: [
  263. "binder/android/security/IConfirmationPromptCallback.aidl",
  264. "binder/android/security/keystore/IKeystoreCertificateChainCallback.aidl",
  265. "binder/android/security/keystore/IKeystoreExportKeyCallback.aidl",
  266. "binder/android/security/keystore/IKeystoreKeyCharacteristicsCallback.aidl",
  267. "binder/android/security/keystore/IKeystoreOperationResultCallback.aidl",
  268. "binder/android/security/keystore/IKeystoreResponseCallback.aidl",
  269. "binder/android/security/keystore/IKeystoreService.aidl",
  270. ],
  271. path: "binder",
  272. }
  273. cc_library_shared {
  274. name: "libkeystore_aidl",
  275. srcs: [":keystore_aidl"],
  276. aidl: {
  277. export_aidl_headers: true,
  278. include_dirs: [
  279. "system/security/keystore/binder",
  280. ],
  281. },
  282. shared_libs: [
  283. "libbinder",
  284. "libcutils",
  285. "libhardware",
  286. "libhidlbase",
  287. "libhidltransport",
  288. "libhwbinder",
  289. "libkeystore_parcelables",
  290. "liblog",
  291. "libselinux",
  292. "libutils",
  293. ],
  294. export_shared_lib_headers: [
  295. "libbinder",
  296. "libkeystore_parcelables",
  297. ],
  298. }