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