| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build_overrides/build.gni") | 7 import("//build_overrides/build.gni") |
| 8 import("//testing/libfuzzer/fuzzer_test.gni") | 8 import("//testing/libfuzzer/fuzzer_test.gni") |
| 9 import("BUILD.generated.gni") | 9 import("BUILD.generated.gni") |
| 10 import("BUILD.generated_tests.gni") | 10 import("BUILD.generated_tests.gni") |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 cflags_c = [ "-std=c99" ] | 34 cflags_c = [ "-std=c99" ] |
| 35 defines += [ "_XOPEN_SOURCE=700" ] | 35 defines += [ "_XOPEN_SOURCE=700" ] |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 | 38 |
| 39 config("no_asm_config") { | 39 config("no_asm_config") { |
| 40 visibility = [ ":*" ] # Only targets in this file can depend on this. | 40 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 41 defines = [ "OPENSSL_NO_ASM" ] | 41 defines = [ "OPENSSL_NO_ASM" ] |
| 42 } | 42 } |
| 43 | 43 |
| 44 config("fuzzer_config") { | |
| 45 visibility = [ ":*" ] # Only targets in this file can depend on this. | |
| 46 defines = [ "BORINGSSL_UNSAFE_FUZZER_MODE" ] | |
| 47 } | |
| 48 | |
| 49 all_sources = crypto_sources + ssl_sources | 44 all_sources = crypto_sources + ssl_sources |
| 50 | 45 |
| 51 # Windows' assembly is built with Yasm. The other platforms use the platform | 46 # Windows' assembly is built with Yasm. The other platforms use the platform |
| 52 # assembler. | 47 # assembler. |
| 53 if (is_win && !is_msan) { | 48 if (is_win && !is_msan) { |
| 54 import("//third_party/yasm/yasm_assemble.gni") | 49 import("//third_party/yasm/yasm_assemble.gni") |
| 55 yasm_assemble("boringssl_asm") { | 50 yasm_assemble("boringssl_asm") { |
| 56 if (current_cpu == "x64") { | 51 if (current_cpu == "x64") { |
| 57 sources = crypto_sources_win_x86_64 | 52 sources = crypto_sources_win_x86_64 |
| 58 } else if (current_cpu == "x86") { | 53 } else if (current_cpu == "x86") { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 "//base/test:run_all_unittests", | 144 "//base/test:run_all_unittests", |
| 150 "//base/test:test_support", | 145 "//base/test:test_support", |
| 151 "//testing/gtest", | 146 "//testing/gtest", |
| 152 ] | 147 ] |
| 153 sources = [ | 148 sources = [ |
| 154 "boringssl_unittest.cc", | 149 "boringssl_unittest.cc", |
| 155 ] | 150 ] |
| 156 } | 151 } |
| 157 } | 152 } |
| 158 | 153 |
| 154 config("fuzzer_config") { |
| 155 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 156 defines = [ |
| 157 "BORINGSSL_UNSAFE_FUZZER_MODE", |
| 158 "BORINGSSL_UNSAFE_DETERMINISTIC_MODE", |
| 159 ] |
| 160 } |
| 161 |
| 159 # The same as boringssl, but builds with BORINGSSL_UNSAFE_FUZZER_MODE. | 162 # The same as boringssl, but builds with BORINGSSL_UNSAFE_FUZZER_MODE. |
| 160 component("boringssl_fuzzer") { | 163 component("boringssl_fuzzer") { |
| 161 visibility = [ ":*" ] # Only targets in this file can depend on this. | 164 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 162 | 165 |
| 163 sources = all_sources | 166 sources = all_sources |
| 164 deps = [ | 167 deps = [ |
| 165 ":boringssl_asm", | 168 ":boringssl_asm", |
| 166 ] | 169 ] |
| 167 | 170 |
| 168 public_configs = [ | 171 public_configs = [ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 libfuzzer_options = [ "max_len=512" ] | 204 libfuzzer_options = [ "max_len=512" ] |
| 202 } else if ("server" == fuzzer) { | 205 } else if ("server" == fuzzer) { |
| 203 libfuzzer_options = [ "max_len=4096" ] | 206 libfuzzer_options = [ "max_len=4096" ] |
| 204 } else if ("spki" == fuzzer) { | 207 } else if ("spki" == fuzzer) { |
| 205 libfuzzer_options = [ "max_len=1024" ] | 208 libfuzzer_options = [ "max_len=1024" ] |
| 206 } else if ("ssl_ctx_api" == fuzzer) { | 209 } else if ("ssl_ctx_api" == fuzzer) { |
| 207 libfuzzer_options = [ "max_len=256" ] | 210 libfuzzer_options = [ "max_len=256" ] |
| 208 } | 211 } |
| 209 } | 212 } |
| 210 } | 213 } |
| 214 |
| 215 config("fuzzer_no_fuzzer_mode_config") { |
| 216 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 217 defines = [ "BORINGSSL_UNSAFE_DETERMINISTIC_MODE" ] |
| 218 } |
| 219 |
| 220 # The same as boringssl, but builds with BORINGSSL_UNSAFE_DETERMINISTIC_MODE. |
| 221 component("boringssl_fuzzer_no_fuzzer_mode") { |
| 222 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 223 |
| 224 sources = all_sources |
| 225 deps = [ |
| 226 ":boringssl_asm", |
| 227 ] |
| 228 |
| 229 public_configs = [ |
| 230 ":external_config", |
| 231 ":fuzzer_no_fuzzer_mode_config", |
| 232 ] |
| 233 configs += [ ":internal_config" ] |
| 234 |
| 235 configs -= [ "//build/config/compiler:chromium_code" ] |
| 236 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 237 |
| 238 if (is_nacl) { |
| 239 deps += [ "//native_client_sdk/src/libraries/nacl_io" ] |
| 240 } |
| 241 } |
| 242 |
| 243 fuzzer_test("boringssl_client_no_fuzzer_mode_fuzzer") { |
| 244 sources = [ |
| 245 "src/fuzz/client.cc", |
| 246 ] |
| 247 deps = [ |
| 248 ":boringssl_fuzzer_no_fuzzer_mode", |
| 249 ] |
| 250 seed_corpus = "src/fuzz/client_corpus_no_fuzzer_mode" |
| 251 } |
| 252 |
| 253 fuzzer_test("boringssl_server_no_fuzzer_mode_fuzzer") { |
| 254 sources = [ |
| 255 "src/fuzz/server.cc", |
| 256 ] |
| 257 deps = [ |
| 258 ":boringssl_fuzzer_no_fuzzer_mode", |
| 259 ] |
| 260 seed_corpus = "src/fuzz/server_corpus_no_fuzzer_mode" |
| 261 } |
| 211 } | 262 } |
| OLD | NEW |