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: { |
Martin Stjernholm | ba9db87 | 2020-07-16 03:52:16 +0100 | [diff] [blame] | 132 | linux_bionic: { |
Martin Stjernholm | d688890 | 2020-04-08 01:02:41 +0100 | [diff] [blame] | 133 | header_libs: ["libc_headers"], // TODO(b/153662223): Clean this up. |
| 134 | }, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 135 | android: { |
Martin Stjernholm | d688890 | 2020-04-08 01:02:41 +0100 | [diff] [blame] | 136 | header_libs: ["libc_headers"], // TODO(b/153662223): Clean this up. |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 137 | cflags: [ |
| 138 | "-DBORINGSSL_FIPS", |
| 139 | "-fPIC", |
Pete Bentley | 1d07cf8 | 2019-10-18 12:49:31 +0100 | [diff] [blame] | 140 | // -fno[data|text]-sections required to ensure a |
| 141 | // single text and data section for FIPS integrity check |
| 142 | "-fno-data-sections", |
| 143 | "-fno-function-sections", |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 144 | ], |
| 145 | linker_script: "src/crypto/fipsmodule/fips_shared.lds", |
| 146 | }, |
Peter Collingbourne | 0560ada | 2019-11-22 13:50:29 -0800 | [diff] [blame] | 147 | // Temporary hack to let BoringSSL build with a new compiler. |
| 148 | // This doesn't enable HWASAN unconditionally, it just causes |
| 149 | // BoringSSL's asm code to unconditionally use a HWASAN-compatible |
| 150 | // global variable reference so that the non-HWASANified (because of |
| 151 | // sanitize: { hwaddress: false } above) code in the BCM can |
| 152 | // successfully link against the HWASANified code in the rest of |
| 153 | // BoringSSL in HWASAN builds. |
| 154 | android_arm64: { |
| 155 | asflags: [ |
| 156 | "-fsanitize=hwaddress", |
| 157 | ], |
| 158 | }, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 159 | }, |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 160 | apex_available: [ |
| 161 | "//apex_available:platform", |
| 162 | "com.android.adbd", |
Martin Stjernholm | 98b0362 | 2020-10-12 15:10:40 +0100 | [diff] [blame] | 163 | "com.android.art", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 164 | "com.android.art.debug", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 165 | "com.android.art.testing", |
| 166 | "com.android.bluetooth.updatable", |
| 167 | "com.android.conscrypt", |
| 168 | "com.android.media", |
| 169 | "com.android.resolv", |
Jiyong Park | 16f7c57 | 2021-01-05 14:41:56 +0900 | [diff] [blame] | 170 | "com.android.virt", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 171 | ], |
Jooyung Han | 856ad1d | 2020-04-16 18:48:25 +0900 | [diff] [blame] | 172 | min_sdk_version: "29", |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | bootstrap_go_package { |
| 176 | name: "bssl_ar", |
| 177 | pkgPath: "boringssl.googlesource.com/boringssl/util/ar", |
| 178 | srcs: [ |
| 179 | "src/util/ar/ar.go", |
| 180 | ], |
| 181 | testSrcs: [ |
| 182 | "src/util/ar/ar_test.go", |
| 183 | ], |
| 184 | } |
| 185 | |
| 186 | bootstrap_go_package { |
| 187 | name: "bssl_fipscommon", |
| 188 | pkgPath: "boringssl.googlesource.com/boringssl/util/fipstools/fipscommon", |
| 189 | srcs: [ |
| 190 | "src/util/fipstools/fipscommon/const.go", |
| 191 | ], |
| 192 | } |
| 193 | |
| 194 | blueprint_go_binary { |
| 195 | name: "bssl_inject_hash", |
| 196 | srcs: [ |
| 197 | "src/util/fipstools/inject_hash/inject_hash.go", |
| 198 | ], |
| 199 | deps: [ |
| 200 | "bssl_ar", |
| 201 | "bssl_fipscommon", |
| 202 | ], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | // Target and host library |
| 206 | cc_library { |
| 207 | name: "libcrypto", |
Paul Duffin | cb6fdd2 | 2019-06-04 13:24:44 +0100 | [diff] [blame] | 208 | visibility: ["//visibility:public"], |
Vijay Venkatraman | 3caad95 | 2017-05-16 12:00:57 -0700 | [diff] [blame] | 209 | vendor_available: true, |
Justin Yun | 5608329 | 2020-11-11 15:43:11 +0900 | [diff] [blame] | 210 | product_available: true, |
dimitry | 09dd3be | 2019-05-09 16:42:01 +0200 | [diff] [blame] | 211 | native_bridge_supported: true, |
Justin Yun | 47949c5 | 2017-07-24 15:19:43 +0900 | [diff] [blame] | 212 | vndk: { |
| 213 | enabled: true, |
| 214 | }, |
Jooyung Han | b6b07c3 | 2019-01-18 15:31:20 +0900 | [diff] [blame] | 215 | double_loadable: true, |
Jiyong Park | c346395 | 2018-04-27 21:44:32 +0900 | [diff] [blame] | 216 | recovery_available: true, |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 217 | defaults: [ |
| 218 | "libcrypto_sources", |
| 219 | "libcrypto_defaults", |
| 220 | "boringssl_defaults", |
| 221 | "boringssl_flags", |
| 222 | ], |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 223 | unique_host_soname: true, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 224 | srcs: [ |
| 225 | ":bcm_object", |
| 226 | ], |
| 227 | target: { |
| 228 | android: { |
| 229 | cflags: [ |
| 230 | "-DBORINGSSL_FIPS", |
| 231 | ], |
Pete Bentley | e0c3f63 | 2020-05-06 19:52:29 +0100 | [diff] [blame] | 232 | sanitize: { |
| 233 | // Disable address sanitizing otherwise libcrypto will not report |
| 234 | // itself as being in FIPS mode, which causes boringssl_self_test |
| 235 | // to fail. |
| 236 | address: false, |
| 237 | }, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 238 | inject_bssl_hash: true, |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 239 | static: { |
| 240 | // Disable the static version of libcrypto, as it causes |
| 241 | // problems for FIPS certification. Use libcrypto_static for |
| 242 | // modules that need static libcrypto but do not need FIPS self |
| 243 | // testing, or use dynamic libcrypto. |
| 244 | enabled: false, |
| 245 | }, |
Pete Bentley | e6a478a | 2019-08-19 22:20:24 +0100 | [diff] [blame] | 246 | }, |
| 247 | }, |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 248 | apex_available: [ |
| 249 | "//apex_available:platform", |
| 250 | "com.android.adbd", |
Martin Stjernholm | 98b0362 | 2020-10-12 15:10:40 +0100 | [diff] [blame] | 251 | "com.android.art", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 252 | "com.android.art.debug", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 253 | "com.android.art.testing", |
| 254 | "com.android.bluetooth.updatable", |
| 255 | "com.android.conscrypt", |
| 256 | "com.android.media", |
| 257 | "com.android.resolv", |
Jiyong Park | 16f7c57 | 2021-01-05 14:41:56 +0900 | [diff] [blame] | 258 | "com.android.virt", |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 259 | ], |
Jooyung Han | 856ad1d | 2020-04-16 18:48:25 +0900 | [diff] [blame] | 260 | min_sdk_version: "29", |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | // Static library |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 264 | // This version of libcrypto will not have FIPS self tests enabled, so its |
| 265 | // usage is protected through visibility to ensure it doesn't end up used |
| 266 | // somewhere that needs the FIPS version. |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 267 | cc_library_static { |
| 268 | name: "libcrypto_static", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 269 | visibility: [ |
Paul Duffin | ebdc406 | 2020-01-22 14:29:01 +0000 | [diff] [blame] | 270 | "//art/build/sdk", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 271 | "//bootable/recovery/updater", |
| 272 | "//external/conscrypt", |
| 273 | "//external/python/cpython2", |
Elliott Hughes | 77319d0 | 2020-05-14 15:51:34 -0700 | [diff] [blame] | 274 | // Strictly, only the *static* toybox for legacy devices should have |
| 275 | // access to libcrypto_static, but we can't express that. |
| 276 | "//external/toybox", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 277 | "//hardware/interfaces/confirmationui/1.0/vts/functional", |
| 278 | "//hardware/interfaces/drm/1.0/vts/functional", |
| 279 | "//hardware/interfaces/drm/1.2/vts/functional", |
Robert Shih | 6526b5c | 2020-01-21 11:03:32 -0800 | [diff] [blame] | 280 | "//hardware/interfaces/drm/1.3/vts/functional", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 281 | "//hardware/interfaces/keymaster/3.0/vts/functional", |
| 282 | "//hardware/interfaces/keymaster/4.0/vts/functional", |
Shawn Willden | 1ff77d0 | 2020-01-16 23:52:56 -0700 | [diff] [blame] | 283 | "//hardware/interfaces/keymaster/4.1/vts/functional", |
Luke Huang | 16a30fc | 2019-11-22 11:44:50 +0800 | [diff] [blame] | 284 | "//packages/modules/DnsResolver/tests:__subpackages__", |
Baligh Uddin | f58f870 | 2020-11-24 05:58:10 +0000 | [diff] [blame] | 285 | "//packages/modules/NeuralNetworks:__subpackages__", |
Colin Cross | 4b979db | 2019-09-18 11:20:16 -0700 | [diff] [blame] | 286 | "//system/core/adb", |
| 287 | "//system/core/init", |
| 288 | "//system/core/fs_mgr/liblp", |
| 289 | "//system/core/fs_mgr/liblp/vts_core", |
| 290 | "//system/core/fs_mgr/libsnapshot", |
| 291 | "//system/libvintf/test", |
| 292 | "//system/security/keystore/tests", |
| 293 | "//test/vts-testcase/security/avb", |
| 294 | ], |
Przemyslaw Szczepaniak | dab438a | 2020-02-05 17:33:41 +0000 | [diff] [blame] | 295 | apex_available: [ |
| 296 | "//apex_available:platform", |
| 297 | "com.android.neuralnetworks", |
Przemyslaw Szczepaniak | dab438a | 2020-02-05 17:33:41 +0000 | [diff] [blame] | 298 | ], |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 299 | defaults: [ |
Pete Bentley | 4763734 | 2019-08-19 12:22:49 +0100 | [diff] [blame] | 300 | "libcrypto_bcm_sources", |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 301 | "libcrypto_sources", |
| 302 | "libcrypto_defaults", |
| 303 | "boringssl_defaults", |
| 304 | "boringssl_flags", |
| 305 | ], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 306 | } |
| 307 | |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 308 | //// libssl |
| 309 | |
| 310 | // Target static library |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 311 | |
| 312 | // Static and Shared library |
| 313 | cc_library { |
| 314 | name: "libssl", |
Paul Duffin | cb6fdd2 | 2019-06-04 13:24:44 +0100 | [diff] [blame] | 315 | visibility: ["//visibility:public"], |
Dan Willemsen | ea55e18 | 2018-10-23 13:41:19 -0700 | [diff] [blame] | 316 | recovery_available: true, |
Justin Yun | 47949c5 | 2017-07-24 15:19:43 +0900 | [diff] [blame] | 317 | vendor_available: true, |
Justin Yun | 5608329 | 2020-11-11 15:43:11 +0900 | [diff] [blame] | 318 | product_available: true, |
dimitry | 09dd3be | 2019-05-09 16:42:01 +0200 | [diff] [blame] | 319 | native_bridge_supported: true, |
Justin Yun | 47949c5 | 2017-07-24 15:19:43 +0900 | [diff] [blame] | 320 | vndk: { |
| 321 | enabled: true, |
| 322 | }, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 323 | host_supported: true, |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 324 | defaults: [ |
| 325 | "libssl_sources", |
| 326 | "boringssl_defaults", |
| 327 | "boringssl_flags", |
| 328 | ], |
Joshua Duong | 81ce7a5 | 2019-10-31 12:44:47 -0700 | [diff] [blame] | 329 | target: { |
| 330 | windows: { |
| 331 | enabled: true, |
| 332 | }, |
| 333 | }, |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 334 | unique_host_soname: true, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 335 | |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 336 | shared_libs: ["libcrypto"], |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 337 | |
| 338 | apex_available: [ |
| 339 | "//apex_available:platform", |
| 340 | "com.android.adbd", |
Jiyong Park | 0dcd4e8 | 2020-03-09 15:23:05 +0900 | [diff] [blame] | 341 | "com.android.conscrypt", |
| 342 | "com.android.resolv", |
Joshua Duong | 26b57e2 | 2020-02-10 16:04:44 -0800 | [diff] [blame] | 343 | ], |
Jooyung Han | 856ad1d | 2020-04-16 18:48:25 +0900 | [diff] [blame] | 344 | min_sdk_version: "29", |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 345 | } |
| 346 | |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 347 | // Tool |
| 348 | cc_binary { |
| 349 | name: "bssl", |
| 350 | host_supported: true, |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 351 | defaults: [ |
| 352 | "bssl_sources", |
| 353 | "boringssl_flags", |
| 354 | ], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 355 | |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 356 | shared_libs: [ |
| 357 | "libcrypto", |
| 358 | "libssl", |
| 359 | ], |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 360 | target: { |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 361 | darwin: { |
| 362 | enabled: false, |
| 363 | }, |
Pete Bentley | d716553 | 2020-05-14 12:01:03 +0100 | [diff] [blame] | 364 | android: { |
| 365 | compile_multilib: "both", |
| 366 | }, |
| 367 | }, |
| 368 | multilib: { |
| 369 | lib32: { |
| 370 | suffix: "32", |
| 371 | }, |
Dan Willemsen | 21986fb | 2016-07-14 15:23:56 -0700 | [diff] [blame] | 372 | }, |
| 373 | } |
Dan Willemsen | 2458a41 | 2016-07-15 09:28:31 -0700 | [diff] [blame] | 374 | |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 375 | // Used for CAVP testing for FIPS certification. |
| 376 | // Not installed on devices by default. |
Adam Langley | 7c16793 | 2018-02-02 14:44:53 -0800 | [diff] [blame] | 377 | cc_binary { |
| 378 | name: "cavp", |
| 379 | host_supported: true, |
| 380 | srcs: [ |
Pete Bentley | 0c61efe | 2019-08-13 09:32:23 +0100 | [diff] [blame] | 381 | "src/util/fipstools/cavp/cavp_aes_gcm_test.cc", |
| 382 | "src/util/fipstools/cavp/cavp_aes_test.cc", |
| 383 | "src/util/fipstools/cavp/cavp_ctr_drbg_test.cc", |
| 384 | "src/util/fipstools/cavp/cavp_ecdsa2_keypair_test.cc", |
| 385 | "src/util/fipstools/cavp/cavp_ecdsa2_pkv_test.cc", |
| 386 | "src/util/fipstools/cavp/cavp_ecdsa2_siggen_test.cc", |
| 387 | "src/util/fipstools/cavp/cavp_ecdsa2_sigver_test.cc", |
| 388 | "src/util/fipstools/cavp/cavp_hmac_test.cc", |
| 389 | "src/util/fipstools/cavp/cavp_kas_test.cc", |
| 390 | "src/util/fipstools/cavp/cavp_keywrap_test.cc", |
| 391 | "src/util/fipstools/cavp/cavp_main.cc", |
| 392 | "src/util/fipstools/cavp/cavp_rsa2_keygen_test.cc", |
| 393 | "src/util/fipstools/cavp/cavp_rsa2_siggen_test.cc", |
| 394 | "src/util/fipstools/cavp/cavp_rsa2_sigver_test.cc", |
| 395 | "src/util/fipstools/cavp/cavp_sha_monte_test.cc", |
| 396 | "src/util/fipstools/cavp/cavp_sha_test.cc", |
| 397 | "src/util/fipstools/cavp/cavp_tdes_test.cc", |
| 398 | "src/util/fipstools/cavp/cavp_test_util.cc", |
| 399 | "src/util/fipstools/cavp/cavp_tlskdf_test.cc", |
Adam Langley | 7c16793 | 2018-02-02 14:44:53 -0800 | [diff] [blame] | 400 | ], |
Pete Bentley | d716553 | 2020-05-14 12:01:03 +0100 | [diff] [blame] | 401 | target: { |
| 402 | android: { |
| 403 | compile_multilib: "both", |
| 404 | }, |
| 405 | }, |
| 406 | multilib: { |
| 407 | lib32: { |
| 408 | suffix: "32", |
| 409 | }, |
| 410 | }, |
Adam Langley | 7c16793 | 2018-02-02 14:44:53 -0800 | [diff] [blame] | 411 | |
| 412 | shared_libs: [ |
| 413 | "libcrypto", |
| 414 | ], |
| 415 | |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 416 | defaults: [ |
| 417 | "boringssl_test_support_sources", |
| 418 | "boringssl_flags", |
| 419 | ], |
Adam Langley | 7c16793 | 2018-02-02 14:44:53 -0800 | [diff] [blame] | 420 | } |
| 421 | |
Pete Bentley | 390f587 | 2020-12-10 11:19:10 +0000 | [diff] [blame] | 422 | // Used for ACVP testing for FIPS certification. |
| 423 | // Not installed on devices by default. |
| 424 | cc_binary { |
| 425 | name: "acvp_modulewrapper", |
| 426 | host_supported: true, |
| 427 | srcs: [ |
| 428 | "src/util/fipstools/acvp/modulewrapper/modulewrapper.cc", |
| 429 | ], |
| 430 | target: { |
| 431 | android: { |
| 432 | compile_multilib: "both", |
| 433 | }, |
| 434 | }, |
| 435 | stem: "modulewrapper", |
| 436 | multilib: { |
| 437 | lib32: { |
| 438 | suffix: "32", |
| 439 | }, |
| 440 | }, |
| 441 | |
| 442 | shared_libs: [ |
| 443 | "libcrypto", |
| 444 | ], |
| 445 | |
| 446 | defaults: [ |
| 447 | "boringssl_flags", |
| 448 | ], |
| 449 | } |
| 450 | |
Dan Willemsen | 2458a41 | 2016-07-15 09:28:31 -0700 | [diff] [blame] | 451 | // Test support library |
| 452 | cc_library_static { |
| 453 | name: "boringssl_test_support", |
| 454 | host_supported: true, |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 455 | defaults: [ |
| 456 | "boringssl_test_support_sources", |
| 457 | "boringssl_flags", |
| 458 | ], |
Dan Willemsen | 2458a41 | 2016-07-15 09:28:31 -0700 | [diff] [blame] | 459 | |
Dan Willemsen | 2b2c24b | 2016-07-21 11:03:36 -0700 | [diff] [blame] | 460 | shared_libs: [ |
| 461 | "libcrypto", |
| 462 | "libssl", |
| 463 | ], |
Dan Willemsen | 2458a41 | 2016-07-15 09:28:31 -0700 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | // Tests |
| 467 | cc_test { |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 468 | name: "boringssl_crypto_test", |
| 469 | test_suites: ["device-tests"], |
| 470 | host_supported: true, |
| 471 | defaults: [ |
| 472 | "boringssl_crypto_test_sources", |
| 473 | "boringssl_flags", |
| 474 | ], |
| 475 | whole_static_libs: ["boringssl_test_support"], |
David Benjamin | f31229b | 2017-01-25 14:08:15 -0500 | [diff] [blame] | 476 | |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 477 | shared_libs: ["libcrypto"], |
David Benjamin | f31229b | 2017-01-25 14:08:15 -0500 | [diff] [blame] | 478 | } |
| 479 | |
| 480 | cc_test { |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 481 | name: "boringssl_ssl_test", |
| 482 | test_suites: ["device-tests"], |
| 483 | host_supported: true, |
| 484 | defaults: [ |
| 485 | "boringssl_ssl_test_sources", |
| 486 | "boringssl_flags", |
| 487 | ], |
| 488 | whole_static_libs: ["boringssl_test_support"], |
David Benjamin | f31229b | 2017-01-25 14:08:15 -0500 | [diff] [blame] | 489 | |
Paul Duffin | f6a61fd | 2019-06-25 12:06:25 +0100 | [diff] [blame] | 490 | shared_libs: [ |
| 491 | "libcrypto", |
| 492 | "libssl", |
| 493 | ], |
David Benjamin | f31229b | 2017-01-25 14:08:15 -0500 | [diff] [blame] | 494 | } |
Adam Langley | b6f7515 | 2019-10-18 12:20:11 -0700 | [diff] [blame] | 495 | |
| 496 | // Utility binary for CMVP on-site testing. |
| 497 | cc_binary { |
Tobias Thierer | 6204b54 | 2019-10-18 21:55:05 +0100 | [diff] [blame] | 498 | name: "test_fips", |
| 499 | host_supported: false, |
| 500 | defaults: [ |
| 501 | "boringssl_flags", |
| 502 | ], |
| 503 | shared_libs: [ |
| 504 | "libcrypto", |
| 505 | ], |
| 506 | srcs: [ |
| 507 | "src/util/fipstools/cavp/test_fips.c", |
| 508 | ], |
Adam Langley | b6f7515 | 2019-10-18 12:20:11 -0700 | [diff] [blame] | 509 | } |