Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 1 | // Note that some host libraries have the same module name as the target |
| 2 | // libraries. This is currently needed to build, for example, adb. But it's |
| 3 | // probably something that should be changed. |
| 4 | |
Paul Duffin | cb6fdd2 | 2019-06-04 13:24:44 +0100 | [diff] [blame] | 5 | package { |
| 6 | default_visibility: ["//visibility:private"], |
Bob Badour | b313bb5 | 2021-02-12 15:33:59 -0800 | [diff] [blame] | 7 | default_applicable_licenses: ["external_boringssl_license"], |
| 8 | } |
| 9 | |
| 10 | // Added automatically by a large-scale-change that took the approach of |
| 11 | // 'apply every license found to every target'. While this makes sure we respect |
| 12 | // every license restriction, it may not be entirely correct. |
| 13 | // |
| 14 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 15 | // |
| 16 | // Please consider splitting the single license below into multiple licenses, |
| 17 | // taking care not to lose any license_kind information, and overriding the |
| 18 | // default license using the 'licenses: [...]' property on targets as needed. |
| 19 | // |
| 20 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 21 | // to attach the license to, and including a comment whether the files may be |
| 22 | // used in the current project. |
| 23 | // See: http://go/android-license-faq |
| 24 | license { |
| 25 | name: "external_boringssl_license", |
| 26 | visibility: [":__subpackages__"], |
| 27 | license_kinds: [ |
| 28 | "SPDX-license-identifier-Apache-2.0", |
| 29 | "SPDX-license-identifier-BSD", |
| 30 | "SPDX-license-identifier-ISC", |
| 31 | "SPDX-license-identifier-MIT", |
| 32 | "SPDX-license-identifier-OpenSSL", |
| 33 | "legacy_unencumbered", |
| 34 | ], |
| 35 | license_text: [ |
| 36 | "NOTICE", |
| 37 | ], |
Paul Duffin | cb6fdd2 | 2019-06-04 13:24:44 +0100 | [diff] [blame] | 38 | } |
| 39 | |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 40 | // Pull in the autogenerated sources modules |
| 41 | build = ["sources.bp"] |
| 42 | |
| 43 | // Used by libcrypto, libssl, bssl tool, and native tests |
| 44 | cc_defaults { |
| 45 | name: "boringssl_flags", |
Steven Moreland | f593be8 | 2017-04-14 04:51:23 -0700 | [diff] [blame] | 46 | vendor_available: true, |
Justin Yun | 5608329 | 2020-11-11 15:43:11 +0900 | [diff] [blame] | 47 | product_available: true, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 48 | |
| 49 | cflags: [ |
| 50 | "-fvisibility=hidden", |
| 51 | "-DBORINGSSL_SHARED_LIBRARY", |
David Benjamin | fc8a786 | 2018-06-25 19:02:46 -0400 | [diff] [blame] | 52 | "-DBORINGSSL_ANDROID_SYSTEM", |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 53 | "-DOPENSSL_SMALL", |
Chih-Hung Hsieh | 9146d99 | 2017-09-27 10:26:03 -0700 | [diff] [blame] | 54 | "-Werror", |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 55 | "-Wno-unused-parameter", |
| 56 | ], |
| 57 | |
| 58 | cppflags: [ |
| 59 | "-Wall", |
| 60 | "-Werror", |
| 61 | ], |
| 62 | |
| 63 | conlyflags: ["-std=c99"], |
David Benjamin | fc8a786 | 2018-06-25 19:02:46 -0400 | [diff] [blame] | 64 | |
| 65 | // Build BoringSSL and its tests against the same STL. |
| 66 | sdk_version: "9", |
| 67 | target: { |
Benjamin Brittain | 804732f | 2022-01-28 11:03:38 -0500 | [diff] [blame] | 68 | linux: { |
| 69 | cflags: ["-D_XOPEN_SOURCE=700"], |
| 70 | }, |
| 71 | windows: { |
| 72 | cflags: ["-D_XOPEN_SOURCE=700"], |
| 73 | }, |
David Benjamin | fc8a786 | 2018-06-25 19:02:46 -0400 | [diff] [blame] | 74 | android: { |
| 75 | stl: "libc++_static", |
| 76 | }, |
| 77 | }, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | // Used by libcrypto + libssl |
| 81 | cc_defaults { |
| 82 | name: "boringssl_defaults", |
| 83 | |
| 84 | local_include_dirs: ["src/include"], |
| 85 | export_include_dirs: ["src/include"], |
David Benjamin | fc8a786 | 2018-06-25 19:02:46 -0400 | [diff] [blame] | 86 | cflags: ["-DBORINGSSL_IMPLEMENTATION"], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | //// libcrypto |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 90 | cc_defaults { |
| 91 | name: "libcrypto_defaults", |
| 92 | host_supported: true, |
Yifan Hong | ca6b4e8 | 2020-10-21 18:11:12 -0700 | [diff] [blame] | 93 | ramdisk_available: true, |
| 94 | vendor_ramdisk_available: true, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 95 | |
| 96 | // Windows and Macs both have problems with assembly files |
| 97 | target: { |
| 98 | windows: { |
| 99 | enabled: true, |
| 100 | cflags: ["-DOPENSSL_NO_ASM"], |
| 101 | host_ldlibs: ["-lws2_32"], |
| 102 | }, |
| 103 | darwin: { |
| 104 | cflags: ["-DOPENSSL_NO_ASM"], |
| 105 | }, |
Kenny Root | 7b550be | 2016-09-20 15:25:24 -0700 | [diff] [blame] | 106 | host: { |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 107 | host_ldlibs: ["-lpthread"], |
| 108 | }, |
Pete Bentley | 1e9e585 | 2020-06-30 16:45:33 +0100 | [diff] [blame] | 109 | android: { |
| 110 | // On FIPS builds (i.e. Android only) prevent other libraries |
| 111 | // from pre-empting symbols in libcrypto which could affect FIPS |
| 112 | // compliance and cause integrity checks to fail. See b/160231064. |
| 113 | ldflags: ["-Wl,-Bsymbolic"], |
| 114 | }, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 115 | }, |
| 116 | |
| 117 | local_include_dirs: ["src/crypto"], |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 118 | } |
| 119 | |
| 120 | cc_object { |
| 121 | name: "bcm_object", |
| 122 | device_supported: true, |
| 123 | recovery_available: true, |
| 124 | native_bridge_supported: true, |
| 125 | defaults: [ |
| 126 | "libcrypto_bcm_sources", |
| 127 | "libcrypto_defaults", |
| 128 | "boringssl_defaults", |
| 129 | "boringssl_flags", |
| 130 | ], |
Peter Collingbourne | 22f5f87 | 2019-09-27 15:32:38 -0700 | [diff] [blame] | 131 | sanitize: { |
| 132 | address: false, |
Tobias Thierer | 6204b54 | 2019-10-18 21:55:05 +0100 | [diff] [blame] | 133 | hwaddress: false, |
Mitch Phillips | f5a6078 | 2019-12-10 08:47:30 -0800 | [diff] [blame] | 134 | fuzzer: false, |
Peter Collingbourne | 22f5f87 | 2019-09-27 15:32:38 -0700 | [diff] [blame] | 135 | }, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 136 | target: { |
| 137 | android: { |
| 138 | cflags: [ |
| 139 | "-DBORINGSSL_FIPS", |
| 140 | "-fPIC", |
Pete Bentley | 1d07cf8 | 2019-10-18 12:49:31 +0100 | [diff] [blame] | 141 | // -fno[data|text]-sections required to ensure a |
| 142 | // single text and data section for FIPS integrity check |
| 143 | "-fno-data-sections", |
| 144 | "-fno-function-sections", |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 145 | ], |
| 146 | linker_script: "src/crypto/fipsmodule/fips_shared.lds", |
| 147 | }, |
Peter Collingbourne | 0560ada | 2019-11-22 13:50:29 -0800 | [diff] [blame] | 148 | // Temporary hack to let BoringSSL build with a new compiler. |
| 149 | // This doesn't enable HWASAN unconditionally, it just causes |
| 150 | // BoringSSL's asm code to unconditionally use a HWASAN-compatible |
| 151 | // global variable reference so that the non-HWASANified (because of |
| 152 | // sanitize: { hwaddress: false } above) code in the BCM can |
| 153 | // successfully link against the HWASANified code in the rest of |
| 154 | // BoringSSL in HWASAN builds. |
| 155 | android_arm64: { |
| 156 | asflags: [ |
| 157 | "-fsanitize=hwaddress", |
| 158 | ], |
| 159 | }, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 160 | }, |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 161 | apex_available: [ |
| 162 | "//apex_available:platform", |
| 163 | "com.android.adbd", |
Martin Stjernholm | 98b0362 | 2020-10-12 15:10:40 +0100 | [diff] [blame] | 164 | "com.android.art", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 165 | "com.android.art.debug", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 166 | "com.android.art.testing", |
Etienne Ruffieux | 49791bd | 2021-12-15 16:21:34 +0000 | [diff] [blame] | 167 | "com.android.bluetooth", |
Alan Stokes | 53cbde7 | 2021-07-06 17:46:00 +0100 | [diff] [blame] | 168 | "com.android.compos", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 169 | "com.android.conscrypt", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 170 | "com.android.resolv", |
Jiyong Park | 16f7c57 | 2021-01-05 14:41:56 +0900 | [diff] [blame] | 171 | "com.android.virt", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 172 | ], |
Jooyung Han | 856ad1d | 2020-04-16 18:48:25 +0900 | [diff] [blame] | 173 | min_sdk_version: "29", |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | bootstrap_go_package { |
| 177 | name: "bssl_ar", |
| 178 | pkgPath: "boringssl.googlesource.com/boringssl/util/ar", |
| 179 | srcs: [ |
| 180 | "src/util/ar/ar.go", |
| 181 | ], |
| 182 | testSrcs: [ |
| 183 | "src/util/ar/ar_test.go", |
| 184 | ], |
| 185 | } |
| 186 | |
| 187 | bootstrap_go_package { |
| 188 | name: "bssl_fipscommon", |
| 189 | pkgPath: "boringssl.googlesource.com/boringssl/util/fipstools/fipscommon", |
| 190 | srcs: [ |
| 191 | "src/util/fipstools/fipscommon/const.go", |
| 192 | ], |
| 193 | } |
| 194 | |
| 195 | blueprint_go_binary { |
| 196 | name: "bssl_inject_hash", |
| 197 | srcs: [ |
| 198 | "src/util/fipstools/inject_hash/inject_hash.go", |
| 199 | ], |
| 200 | deps: [ |
| 201 | "bssl_ar", |
| 202 | "bssl_fipscommon", |
| 203 | ], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | // Target and host library |
| 207 | cc_library { |
| 208 | name: "libcrypto", |
Paul Duffin | cb6fdd2 | 2019-06-04 13:24:44 +0100 | [diff] [blame] | 209 | visibility: ["//visibility:public"], |
Vijay Venkatraman | 3caad95 | 2017-05-16 12:00:57 -0700 | [diff] [blame] | 210 | vendor_available: true, |
Justin Yun | 5608329 | 2020-11-11 15:43:11 +0900 | [diff] [blame] | 211 | product_available: true, |
dimitry | 09dd3be | 2019-05-09 16:42:01 +0200 | [diff] [blame] | 212 | native_bridge_supported: true, |
Justin Yun | 47949c5 | 2017-07-24 15:19:43 +0900 | [diff] [blame] | 213 | vndk: { |
| 214 | enabled: true, |
| 215 | }, |
Jooyung Han | b6b07c3 | 2019-01-18 15:31:20 +0900 | [diff] [blame] | 216 | double_loadable: true, |
Jiyong Park | c346395 | 2018-04-27 21:44:32 +0900 | [diff] [blame] | 217 | recovery_available: true, |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 218 | defaults: [ |
| 219 | "libcrypto_sources", |
| 220 | "libcrypto_defaults", |
| 221 | "boringssl_defaults", |
| 222 | "boringssl_flags", |
| 223 | ], |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 224 | unique_host_soname: true, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 225 | srcs: [ |
| 226 | ":bcm_object", |
| 227 | ], |
| 228 | target: { |
| 229 | android: { |
| 230 | cflags: [ |
| 231 | "-DBORINGSSL_FIPS", |
| 232 | ], |
Pete Bentley | e0c3f63 | 2020-05-06 19:52:29 +0100 | [diff] [blame] | 233 | sanitize: { |
| 234 | // Disable address sanitizing otherwise libcrypto will not report |
| 235 | // itself as being in FIPS mode, which causes boringssl_self_test |
| 236 | // to fail. |
| 237 | address: false, |
| 238 | }, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 239 | inject_bssl_hash: true, |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 240 | static: { |
| 241 | // Disable the static version of libcrypto, as it causes |
| 242 | // problems for FIPS certification. Use libcrypto_static for |
| 243 | // modules that need static libcrypto but do not need FIPS self |
| 244 | // testing, or use dynamic libcrypto. |
| 245 | enabled: false, |
| 246 | }, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 247 | }, |
| 248 | }, |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 249 | apex_available: [ |
| 250 | "//apex_available:platform", |
| 251 | "com.android.adbd", |
Martin Stjernholm | 98b0362 | 2020-10-12 15:10:40 +0100 | [diff] [blame] | 252 | "com.android.art", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 253 | "com.android.art.debug", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 254 | "com.android.art.testing", |
Etienne Ruffieux | 49791bd | 2021-12-15 16:21:34 +0000 | [diff] [blame] | 255 | "com.android.bluetooth", |
Alan Stokes | 53cbde7 | 2021-07-06 17:46:00 +0100 | [diff] [blame] | 256 | "com.android.compos", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 257 | "com.android.conscrypt", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 258 | "com.android.resolv", |
Jiyong Park | 16f7c57 | 2021-01-05 14:41:56 +0900 | [diff] [blame] | 259 | "com.android.virt", |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 260 | ], |
Jooyung Han | 856ad1d | 2020-04-16 18:48:25 +0900 | [diff] [blame] | 261 | min_sdk_version: "29", |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | // Static library |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 265 | // This version of libcrypto will not have FIPS self tests enabled, so its |
| 266 | // usage is protected through visibility to ensure it doesn't end up used |
| 267 | // somewhere that needs the FIPS version. |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 268 | cc_library_static { |
| 269 | name: "libcrypto_static", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 270 | visibility: [ |
Paul Duffin | ebdc406 | 2020-01-22 14:29:01 +0000 | [diff] [blame] | 271 | "//art/build/sdk", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 272 | "//bootable/recovery/updater", |
| 273 | "//external/conscrypt", |
| 274 | "//external/python/cpython2", |
Luke Huang | f695bbb | 2021-04-23 15:38:04 +0800 | [diff] [blame] | 275 | "//external/rust/crates/quiche", |
Elliott Hughes | 77319d0 | 2020-05-14 15:51:34 -0700 | [diff] [blame] | 276 | // Strictly, only the *static* toybox for legacy devices should have |
| 277 | // access to libcrypto_static, but we can't express that. |
| 278 | "//external/toybox", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 279 | "//hardware/interfaces/confirmationui/1.0/vts/functional", |
| 280 | "//hardware/interfaces/drm/1.0/vts/functional", |
| 281 | "//hardware/interfaces/drm/1.2/vts/functional", |
Robert Shih | 6526b5c | 2020-01-21 11:03:32 -0800 | [diff] [blame] | 282 | "//hardware/interfaces/drm/1.3/vts/functional", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 283 | "//hardware/interfaces/keymaster/3.0/vts/functional", |
| 284 | "//hardware/interfaces/keymaster/4.0/vts/functional", |
Shawn Willden | 1ff77d0 | 2020-01-16 23:52:56 -0700 | [diff] [blame] | 285 | "//hardware/interfaces/keymaster/4.1/vts/functional", |
Josh Gao | e49f0ff | 2021-04-14 15:41:00 -0700 | [diff] [blame] | 286 | "//packages/modules/adb", |
Luke Huang | 16a30fc | 2019-11-22 11:44:50 +0800 | [diff] [blame] | 287 | "//packages/modules/DnsResolver/tests:__subpackages__", |
Baligh Uddin | f58f870 | 2020-11-24 05:58:10 +0000 | [diff] [blame] | 288 | "//packages/modules/NeuralNetworks:__subpackages__", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 289 | "//system/core/init", |
| 290 | "//system/core/fs_mgr/liblp", |
| 291 | "//system/core/fs_mgr/liblp/vts_core", |
| 292 | "//system/core/fs_mgr/libsnapshot", |
| 293 | "//system/libvintf/test", |
| 294 | "//system/security/keystore/tests", |
| 295 | "//test/vts-testcase/security/avb", |
| 296 | ], |
Przemyslaw Szczepaniak | dab438a | 2020-02-05 17:33:41 +0000 | [diff] [blame] | 297 | apex_available: [ |
| 298 | "//apex_available:platform", |
| 299 | "com.android.neuralnetworks", |
Przemyslaw Szczepaniak | dab438a | 2020-02-05 17:33:41 +0000 | [diff] [blame] | 300 | ], |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 301 | defaults: [ |
Pete Bentley | 4763734 | 2019-08-19 12:22:49 +0100 | [diff] [blame] | 302 | "libcrypto_bcm_sources", |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 303 | "libcrypto_sources", |
| 304 | "libcrypto_defaults", |
| 305 | "boringssl_defaults", |
| 306 | "boringssl_flags", |
| 307 | ], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 308 | } |
| 309 | |
Yifan Hong | a11a41e | 2021-09-28 17:18:45 -0700 | [diff] [blame] | 310 | // Common defaults for lib*_fuzz_unsafe. These are unsafe and deterministic |
| 311 | // libraries for testing and fuzzing only. See src/FUZZING.md. |
| 312 | cc_defaults { |
| 313 | name: "boringssl_fuzz_unsafe_defaults", |
| 314 | host_supported: true, |
| 315 | cflags: [ |
| 316 | "-DBORINGSSL_UNSAFE_DETERMINISTIC_MODE", |
| 317 | "-DBORINGSSL_UNSAFE_FUZZER_MODE", |
| 318 | ], |
| 319 | visibility: [ |
| 320 | "//frameworks/native/libs/binder/tests:__subpackages__", |
| 321 | ], |
| 322 | } |
| 323 | |
| 324 | // Unsafe and deterministic version of libcrypto. For testing and fuzzing only. |
| 325 | // See src/FUZZING.md. |
| 326 | cc_test_library { |
| 327 | name: "libcrypto_fuzz_unsafe", |
| 328 | ramdisk_available: false, |
| 329 | vendor_ramdisk_available: false, |
| 330 | defaults: [ |
| 331 | "libcrypto_bcm_sources", |
| 332 | "libcrypto_sources", |
| 333 | "libcrypto_defaults", |
| 334 | "boringssl_defaults", |
| 335 | "boringssl_flags", |
| 336 | "boringssl_fuzz_unsafe_defaults", |
| 337 | ], |
| 338 | } |
| 339 | |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 340 | //// libssl |
| 341 | |
| 342 | // Target static library |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 343 | |
| 344 | // Static and Shared library |
| 345 | cc_library { |
| 346 | name: "libssl", |
Paul Duffin | cb6fdd2 | 2019-06-04 13:24:44 +0100 | [diff] [blame] | 347 | visibility: ["//visibility:public"], |
Dan Willemsen | ea55e18 | 2018-10-23 13:41:19 -0700 | [diff] [blame] | 348 | recovery_available: true, |
Justin Yun | 47949c5 | 2017-07-24 15:19:43 +0900 | [diff] [blame] | 349 | vendor_available: true, |
Justin Yun | 5608329 | 2020-11-11 15:43:11 +0900 | [diff] [blame] | 350 | product_available: true, |
dimitry | 09dd3be | 2019-05-09 16:42:01 +0200 | [diff] [blame] | 351 | native_bridge_supported: true, |
Justin Yun | 47949c5 | 2017-07-24 15:19:43 +0900 | [diff] [blame] | 352 | vndk: { |
| 353 | enabled: true, |
| 354 | }, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 355 | host_supported: true, |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 356 | defaults: [ |
| 357 | "libssl_sources", |
| 358 | "boringssl_defaults", |
| 359 | "boringssl_flags", |
| 360 | ], |
Joshua Duong | 81ce7a5 | 2019-10-31 12:44:47 -0700 | [diff] [blame] | 361 | target: { |
| 362 | windows: { |
| 363 | enabled: true, |
| 364 | }, |
| 365 | }, |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 366 | unique_host_soname: true, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 367 | |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 368 | shared_libs: ["libcrypto"], |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 369 | |
| 370 | apex_available: [ |
| 371 | "//apex_available:platform", |
Roopa Sattiraju | 517dcb0 | 2021-12-22 14:04:18 -0800 | [diff] [blame] | 372 | "com.android.bluetooth", |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 373 | "com.android.adbd", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 374 | "com.android.conscrypt", |
| 375 | "com.android.resolv", |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 376 | ], |
Jooyung Han | 856ad1d | 2020-04-16 18:48:25 +0900 | [diff] [blame] | 377 | min_sdk_version: "29", |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 378 | } |
| 379 | |
Yifan Hong | a11a41e | 2021-09-28 17:18:45 -0700 | [diff] [blame] | 380 | // Unsafe and deterministic version of libssl. For testing and fuzzing only. |
| 381 | // See src/FUZZING.md. |
| 382 | cc_test_library { |
| 383 | name: "libssl_fuzz_unsafe", |
| 384 | host_supported: true, |
| 385 | defaults: [ |
| 386 | "libssl_sources", |
| 387 | "boringssl_defaults", |
| 388 | "boringssl_flags", |
| 389 | "boringssl_fuzz_unsafe_defaults", |
| 390 | ], |
| 391 | static_libs: [ |
| 392 | "libcrypto_fuzz_unsafe", |
| 393 | ], |
| 394 | } |
| 395 | |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 396 | // Tool |
| 397 | cc_binary { |
| 398 | name: "bssl", |
| 399 | host_supported: true, |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 400 | defaults: [ |
| 401 | "bssl_sources", |
| 402 | "boringssl_flags", |
| 403 | ], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 404 | |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 405 | shared_libs: [ |
| 406 | "libcrypto", |
| 407 | "libssl", |
| 408 | ], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 409 | target: { |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 410 | darwin: { |
| 411 | enabled: false, |
| 412 | }, |
Pete Bentley | d716553 | 2020-05-14 12:01:03 +0100 | [diff] [blame] | 413 | android: { |
| 414 | compile_multilib: "both", |
| 415 | }, |
| 416 | }, |
| 417 | multilib: { |
| 418 | lib32: { |
| 419 | suffix: "32", |
| 420 | }, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 421 | }, |
| 422 | } |
Dan Willemsen | 2458a41 | 2016-07-15 09:28:31 -0700 | [diff] [blame] | 423 | |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 424 | // Used for CAVP testing for FIPS certification. |
| 425 | // Not installed on devices by default. |
Adam Langley | 7c16793 | 2018-02-02 14:44:53 -0800 | [diff] [blame] | 426 | cc_binary { |
| 427 | name: "cavp", |
| 428 | host_supported: true, |
| 429 | srcs: [ |
Pete Bentley | 0c61efe | 2019-08-13 09:32:23 +0100 | [diff] [blame] | 430 | "src/util/fipstools/cavp/cavp_aes_gcm_test.cc", |
| 431 | "src/util/fipstools/cavp/cavp_aes_test.cc", |
| 432 | "src/util/fipstools/cavp/cavp_ctr_drbg_test.cc", |
| 433 | "src/util/fipstools/cavp/cavp_ecdsa2_keypair_test.cc", |
| 434 | "src/util/fipstools/cavp/cavp_ecdsa2_pkv_test.cc", |
| 435 | "src/util/fipstools/cavp/cavp_ecdsa2_siggen_test.cc", |
| 436 | "src/util/fipstools/cavp/cavp_ecdsa2_sigver_test.cc", |
| 437 | "src/util/fipstools/cavp/cavp_hmac_test.cc", |
| 438 | "src/util/fipstools/cavp/cavp_kas_test.cc", |
| 439 | "src/util/fipstools/cavp/cavp_keywrap_test.cc", |
| 440 | "src/util/fipstools/cavp/cavp_main.cc", |
| 441 | "src/util/fipstools/cavp/cavp_rsa2_keygen_test.cc", |
| 442 | "src/util/fipstools/cavp/cavp_rsa2_siggen_test.cc", |
| 443 | "src/util/fipstools/cavp/cavp_rsa2_sigver_test.cc", |
| 444 | "src/util/fipstools/cavp/cavp_sha_monte_test.cc", |
| 445 | "src/util/fipstools/cavp/cavp_sha_test.cc", |
| 446 | "src/util/fipstools/cavp/cavp_tdes_test.cc", |
| 447 | "src/util/fipstools/cavp/cavp_test_util.cc", |
| 448 | "src/util/fipstools/cavp/cavp_tlskdf_test.cc", |
Adam Langley | 7c16793 | 2018-02-02 14:44:53 -0800 | [diff] [blame] | 449 | ], |
Pete Bentley | d716553 | 2020-05-14 12:01:03 +0100 | [diff] [blame] | 450 | target: { |
| 451 | android: { |
| 452 | compile_multilib: "both", |
| 453 | }, |
| 454 | }, |
| 455 | multilib: { |
| 456 | lib32: { |
| 457 | suffix: "32", |
| 458 | }, |
| 459 | }, |
Adam Langley | 7c16793 | 2018-02-02 14:44:53 -0800 | [diff] [blame] | 460 | |
| 461 | shared_libs: [ |
| 462 | "libcrypto", |
| 463 | ], |
| 464 | |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 465 | defaults: [ |
| 466 | "boringssl_test_support_sources", |
| 467 | "boringssl_flags", |
| 468 | ], |
Adam Langley | 7c16793 | 2018-02-02 14:44:53 -0800 | [diff] [blame] | 469 | } |
| 470 | |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 471 | // Used for ACVP testing for FIPS certification. |
| 472 | // Not installed on devices by default. |
| 473 | cc_binary { |
| 474 | name: "acvp_modulewrapper", |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 475 | srcs: [ |
Stephen Crane | d457399 | 2021-02-25 10:52:24 -0800 | [diff] [blame] | 476 | "src/util/fipstools/acvp/modulewrapper/main.cc", |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 477 | ], |
| 478 | target: { |
Pete Bentley | 7f684a4 | 2021-07-21 13:52:17 +0100 | [diff] [blame] | 479 | android_x86: { |
| 480 | enabled: false, |
| 481 | }, |
| 482 | android_x86_64: { |
| 483 | enabled: false, |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 484 | }, |
| 485 | }, |
| 486 | stem: "modulewrapper", |
Pete Bentley | 7f684a4 | 2021-07-21 13:52:17 +0100 | [diff] [blame] | 487 | compile_multilib: "both", |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 488 | multilib: { |
| 489 | lib32: { |
| 490 | suffix: "32", |
| 491 | }, |
| 492 | }, |
| 493 | |
Stephen Crane | d457399 | 2021-02-25 10:52:24 -0800 | [diff] [blame] | 494 | static_libs: [ |
| 495 | "libacvp_modulewrapper", |
| 496 | ], |
| 497 | shared_libs: [ |
| 498 | "libcrypto", |
| 499 | ], |
| 500 | |
| 501 | defaults: [ |
| 502 | "boringssl_flags", |
| 503 | ], |
| 504 | } |
| 505 | |
| 506 | // ACVP wrapper implementation shared between Android and Trusty |
| 507 | cc_library_static { |
| 508 | name: "libacvp_modulewrapper", |
| 509 | host_supported: true, |
| 510 | vendor_available: true, |
| 511 | srcs: [ |
| 512 | "src/util/fipstools/acvp/modulewrapper/modulewrapper.cc", |
| 513 | ], |
| 514 | target: { |
| 515 | android: { |
| 516 | compile_multilib: "both", |
| 517 | }, |
| 518 | }, |
| 519 | export_include_dirs: ["src/util/fipstools/acvp/modulewrapper/"], |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 520 | shared_libs: [ |
| 521 | "libcrypto", |
| 522 | ], |
| 523 | |
| 524 | defaults: [ |
| 525 | "boringssl_flags", |
| 526 | ], |
Stephen Crane | 859a48d | 2021-03-10 18:01:35 -0800 | [diff] [blame] | 527 | |
| 528 | visibility: ["//system/core/trusty/utils/acvp"], |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 529 | } |
| 530 | |
Dan Willemsen | 2458a41 | 2016-07-15 09:28:31 -0700 | [diff] [blame] | 531 | // Test support library |
| 532 | cc_library_static { |
| 533 | name: "boringssl_test_support", |
| 534 | host_supported: true, |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 535 | defaults: [ |
| 536 | "boringssl_test_support_sources", |
| 537 | "boringssl_flags", |
| 538 | ], |
Dan Willemsen | 2458a41 | 2016-07-15 09:28:31 -0700 | [diff] [blame] | 539 | |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 540 | shared_libs: [ |
| 541 | "libcrypto", |
| 542 | "libssl", |
| 543 | ], |
Dan Willemsen | 2458a41 | 2016-07-15 09:28:31 -0700 | [diff] [blame] | 544 | } |
| 545 | |
| 546 | // Tests |
| 547 | cc_test { |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 548 | name: "boringssl_crypto_test", |
| 549 | test_suites: ["device-tests"], |
| 550 | host_supported: true, |
| 551 | defaults: [ |
| 552 | "boringssl_crypto_test_sources", |
| 553 | "boringssl_flags", |
| 554 | ], |
| 555 | whole_static_libs: ["boringssl_test_support"], |
David Benjamin | f31229b | 2017-01-25 14:08:15 -0500 | [diff] [blame] | 556 | |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 557 | shared_libs: ["libcrypto"], |
David Benjamin | f31229b | 2017-01-25 14:08:15 -0500 | [diff] [blame] | 558 | } |
| 559 | |
| 560 | cc_test { |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 561 | name: "boringssl_ssl_test", |
| 562 | test_suites: ["device-tests"], |
| 563 | host_supported: true, |
| 564 | defaults: [ |
| 565 | "boringssl_ssl_test_sources", |
| 566 | "boringssl_flags", |
| 567 | ], |
| 568 | whole_static_libs: ["boringssl_test_support"], |
David Benjamin | f31229b | 2017-01-25 14:08:15 -0500 | [diff] [blame] | 569 | |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 570 | shared_libs: [ |
| 571 | "libcrypto", |
| 572 | "libssl", |
| 573 | ], |
David Benjamin | f31229b | 2017-01-25 14:08:15 -0500 | [diff] [blame] | 574 | } |
Adam Langley | b6f7515 | 2019-10-18 12:20:11 -0700 | [diff] [blame] | 575 | |
| 576 | // Utility binary for CMVP on-site testing. |
| 577 | cc_binary { |
Tobias Thierer | 6204b54 | 2019-10-18 21:55:05 +0100 | [diff] [blame] | 578 | name: "test_fips", |
| 579 | host_supported: false, |
| 580 | defaults: [ |
| 581 | "boringssl_flags", |
| 582 | ], |
| 583 | shared_libs: [ |
| 584 | "libcrypto", |
| 585 | ], |
| 586 | srcs: [ |
| 587 | "src/util/fipstools/cavp/test_fips.c", |
| 588 | ], |
Adam Langley | b6f7515 | 2019-10-18 12:20:11 -0700 | [diff] [blame] | 589 | } |