Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 1 | // Copyright (C) 2014 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | // libkeymaster_messages contains just the code necessary to communicate with a |
| 16 | // AndroidKeymaster implementation, e.g. one running in TrustZone. |
| 17 | cc_library_shared { |
| 18 | name: "libkeymaster_messages", |
Steven Moreland | d998c15 | 2017-04-18 10:25:45 -0700 | [diff] [blame] | 19 | vendor_available: true, |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 20 | srcs: [ |
| 21 | "android_keymaster_messages.cpp", |
| 22 | "android_keymaster_utils.cpp", |
| 23 | "authorization_set.cpp", |
| 24 | "keymaster_tags.cpp", |
| 25 | "logger.cpp", |
| 26 | "serializable.cpp", |
| 27 | ], |
| 28 | cflags: [ |
| 29 | "-Wall", |
| 30 | "-Werror", |
| 31 | "-Wunused", |
| 32 | "-DKEYMASTER_NAME_TAGS", |
| 33 | ], |
| 34 | clang: true, |
| 35 | // TODO(krasin): reenable coverage flags, when the new Clang toolchain is released. |
| 36 | // Currently, if enabled, these flags will cause an internal error in Clang. |
| 37 | clang_cflags: ["-fno-sanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp"], |
| 38 | |
| 39 | export_include_dirs: ["include"], |
| 40 | |
| 41 | } |
| 42 | |
| 43 | // libkeymaster1 contains almost everything needed for a keymaster1 |
| 44 | // implementation, lacking only a subclass of the (abstract) KeymasterContext |
| 45 | // class to provide environment-specific services and a wrapper to translate from |
| 46 | // the function-based keymaster HAL API to the message-based AndroidKeymaster API. |
| 47 | cc_library_shared { |
| 48 | name: "libkeymaster1", |
Steven Moreland | d998c15 | 2017-04-18 10:25:45 -0700 | [diff] [blame] | 49 | vendor_available: true, |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 50 | srcs: [ |
| 51 | "aes_key.cpp", |
| 52 | "aes_operation.cpp", |
| 53 | "android_keymaster.cpp", |
| 54 | "android_keymaster_messages.cpp", |
| 55 | "android_keymaster_utils.cpp", |
| 56 | "asymmetric_key.cpp", |
| 57 | "asymmetric_key_factory.cpp", |
| 58 | "attestation_record.cpp", |
| 59 | "auth_encrypted_key_blob.cpp", |
| 60 | "ec_key.cpp", |
| 61 | "ec_key_factory.cpp", |
| 62 | "ecdsa_operation.cpp", |
| 63 | "ecies_kem.cpp", |
| 64 | "hkdf.cpp", |
| 65 | "hmac.cpp", |
| 66 | "hmac_key.cpp", |
| 67 | "hmac_operation.cpp", |
| 68 | "integrity_assured_key_blob.cpp", |
| 69 | "iso18033kdf.cpp", |
| 70 | "kdf.cpp", |
| 71 | "key.cpp", |
| 72 | "keymaster_enforcement.cpp", |
| 73 | "nist_curve_key_exchange.cpp", |
| 74 | "ocb.c", |
| 75 | "ocb_utils.cpp", |
| 76 | "openssl_err.cpp", |
| 77 | "openssl_utils.cpp", |
| 78 | "operation.cpp", |
| 79 | "operation_table.cpp", |
| 80 | "rsa_key.cpp", |
| 81 | "rsa_key_factory.cpp", |
| 82 | "rsa_operation.cpp", |
| 83 | "symmetric_key.cpp", |
| 84 | ], |
| 85 | |
| 86 | shared_libs: [ |
| 87 | "libcrypto", |
| 88 | "libkeymaster_messages", |
| 89 | ], |
| 90 | cflags: [ |
| 91 | "-Wall", |
| 92 | "-Werror", |
| 93 | "-Wunused", |
| 94 | ], |
| 95 | clang: true, |
| 96 | clang_cflags: [ |
| 97 | "-Wno-error=unused-const-variable", |
| 98 | "-Wno-error=unused-private-field", |
| 99 | // TODO(krasin): reenable coverage flags, when the new Clang toolchain is released. |
| 100 | // Currently, if enabled, these flags will cause an internal error in Clang. |
| 101 | "-fno-sanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" |
| 102 | ], |
| 103 | |
| 104 | export_include_dirs: ["include"], |
| 105 | |
| 106 | } |
| 107 | |
| 108 | // libsoftkeymaster provides a software-based keymaster HAL implementation. |
| 109 | // This is used by keystore as a fallback for when the hardware keymaster does |
| 110 | // not support the request. |
| 111 | cc_library_shared { |
| 112 | name: "libsoftkeymasterdevice", |
Steven Moreland | d998c15 | 2017-04-18 10:25:45 -0700 | [diff] [blame] | 113 | vendor_available: true, |
Steven Moreland | 7d6416c | 2017-04-18 10:06:28 -0700 | [diff] [blame] | 114 | srcs: [ |
| 115 | "ec_keymaster0_key.cpp", |
| 116 | "ec_keymaster1_key.cpp", |
| 117 | "ecdsa_keymaster1_operation.cpp", |
| 118 | "keymaster0_engine.cpp", |
| 119 | "keymaster1_engine.cpp", |
| 120 | "keymaster_configuration.cpp", |
| 121 | "rsa_keymaster0_key.cpp", |
| 122 | "rsa_keymaster1_key.cpp", |
| 123 | "rsa_keymaster1_operation.cpp", |
| 124 | "soft_keymaster_context.cpp", |
| 125 | "soft_keymaster_device.cpp", |
| 126 | "soft_keymaster_logger.cpp", |
| 127 | ], |
| 128 | include_dirs: ["system/security/keystore"], |
| 129 | cflags: [ |
| 130 | "-Wall", |
| 131 | "-Werror", |
| 132 | "-Wunused", |
| 133 | ], |
| 134 | clang: true, |
| 135 | clang_cflags: [ |
| 136 | "-Wno-error=unused-const-variable", |
| 137 | "-Wno-error=unused-private-field", |
| 138 | // TODO(krasin): reenable coverage flags, when the new Clang toolchain is released. |
| 139 | // Currently, if enabled, these flags will cause an internal error in Clang. |
| 140 | "-fno-sanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp" |
| 141 | ], |
| 142 | |
| 143 | shared_libs: [ |
| 144 | "libkeymaster_messages", |
| 145 | "libkeymaster1", |
| 146 | "liblog", |
| 147 | "libcrypto", |
| 148 | "libcutils", |
| 149 | ], |
| 150 | |
| 151 | export_include_dirs: ["include"], |
| 152 | } |
| 153 | |
| 154 | // libkeymasterfiles is an empty library that exports all of the files in keymaster as includes. |
| 155 | cc_library_static { |
| 156 | name: "libkeymasterfiles", |
| 157 | export_include_dirs: [ |
| 158 | ".", |
| 159 | "include", |
| 160 | ], |
| 161 | } |