OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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/crypto.gni") | 5 import("//build/config/crypto.gni") |
6 import("//testing/test.gni") | 6 import("//testing/test.gni") |
7 | 7 |
8 component("crypto") { | 8 component("crypto") { |
9 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto. | 9 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto. |
10 sources = [ | 10 sources = [ |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 cflags = [ "/wd4267" ] | 131 cflags = [ "/wd4267" ] |
132 } | 132 } |
133 | 133 |
134 if (use_openssl) { | 134 if (use_openssl) { |
135 # Remove NSS files when using OpenSSL | 135 # Remove NSS files when using OpenSSL |
136 sources -= [ | 136 sources -= [ |
137 "ec_private_key_nss.cc", | 137 "ec_private_key_nss.cc", |
138 "ec_signature_creator_nss.cc", | 138 "ec_signature_creator_nss.cc", |
139 "encryptor_nss.cc", | 139 "encryptor_nss.cc", |
140 "hmac_nss.cc", | 140 "hmac_nss.cc", |
141 "nss_util.cc", | |
142 "nss_util.h", | |
143 "nss_util_internal.h", | |
144 "rsa_private_key_nss.cc", | 141 "rsa_private_key_nss.cc", |
145 "secure_hash_default.cc", | 142 "secure_hash_default.cc", |
146 "signature_creator_nss.cc", | 143 "signature_creator_nss.cc", |
147 "signature_verifier_nss.cc", | 144 "signature_verifier_nss.cc", |
148 "symmetric_key_nss.cc", | 145 "symmetric_key_nss.cc", |
149 "third_party/nss/chromium-blapi.h", | 146 "third_party/nss/chromium-blapi.h", |
150 "third_party/nss/chromium-blapit.h", | 147 "third_party/nss/chromium-blapit.h", |
151 "third_party/nss/chromium-nss.h", | 148 "third_party/nss/chromium-nss.h", |
152 "third_party/nss/pk11akey.cc", | 149 "third_party/nss/pk11akey.cc", |
153 "third_party/nss/rsawrapr.c", | 150 "third_party/nss/rsawrapr.c", |
(...skipping 11 matching lines...) Expand all Loading... |
165 "openssl_util.cc", | 162 "openssl_util.cc", |
166 "openssl_util.h", | 163 "openssl_util.h", |
167 "rsa_private_key_openssl.cc", | 164 "rsa_private_key_openssl.cc", |
168 "secure_hash_openssl.cc", | 165 "secure_hash_openssl.cc", |
169 "signature_creator_openssl.cc", | 166 "signature_creator_openssl.cc", |
170 "signature_verifier_openssl.cc", | 167 "signature_verifier_openssl.cc", |
171 "symmetric_key_openssl.cc", | 168 "symmetric_key_openssl.cc", |
172 ] | 169 ] |
173 } | 170 } |
174 | 171 |
| 172 if (use_openssl && !use_nss_certs) { |
| 173 sources -= [ |
| 174 "nss_util.cc", |
| 175 "nss_util.h", |
| 176 "nss_util_internal.h", |
| 177 ] |
| 178 } |
| 179 |
175 defines = [ "CRYPTO_IMPLEMENTATION" ] | 180 defines = [ "CRYPTO_IMPLEMENTATION" ] |
176 } | 181 } |
177 | 182 |
178 # TODO(GYP): TODO(dpranke), fix the compile errors for this stuff | 183 # TODO(GYP): TODO(dpranke), fix the compile errors for this stuff |
179 # and make it work. | 184 # and make it work. |
180 if (false && is_win) { | 185 if (false && is_win) { |
181 # A minimal crypto subset for hmac-related stuff that small standalone | 186 # A minimal crypto subset for hmac-related stuff that small standalone |
182 # targets can use to reduce code size on Windows. This does not depend on | 187 # targets can use to reduce code size on Windows. This does not depend on |
183 # OpenSSL/NSS but will use Windows APIs for that functionality. | 188 # OpenSSL/NSS but will use Windows APIs for that functionality. |
184 source_set("crypto_minimal_win") { | 189 source_set("crypto_minimal_win") { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 "random_unittest.cc", | 231 "random_unittest.cc", |
227 "rsa_private_key_unittest.cc", | 232 "rsa_private_key_unittest.cc", |
228 "rsa_private_key_nss_unittest.cc", | 233 "rsa_private_key_nss_unittest.cc", |
229 "secure_hash_unittest.cc", | 234 "secure_hash_unittest.cc", |
230 "sha2_unittest.cc", | 235 "sha2_unittest.cc", |
231 "signature_creator_unittest.cc", | 236 "signature_creator_unittest.cc", |
232 "signature_verifier_unittest.cc", | 237 "signature_verifier_unittest.cc", |
233 "symmetric_key_unittest.cc", | 238 "symmetric_key_unittest.cc", |
234 ] | 239 ] |
235 | 240 |
236 if (use_openssl || !is_linux) { | 241 if (use_openssl || !use_nss_certs) { |
237 sources -= [ "rsa_private_key_nss_unittest.cc" ] | 242 sources -= [ "rsa_private_key_nss_unittest.cc" ] |
238 } | 243 } |
239 | 244 |
240 if (use_openssl) { | 245 if (!use_nss_certs) { |
241 sources -= [ "nss_util_unittest.cc" ] | 246 sources -= [ "nss_util_unittest.cc" ] |
242 } else { | 247 } |
| 248 |
| 249 if (!use_openssl) { |
243 sources -= [ "openssl_bio_string_unittest.cc" ] | 250 sources -= [ "openssl_bio_string_unittest.cc" ] |
244 } | 251 } |
245 | 252 |
246 deps = [ | 253 deps = [ |
247 ":crypto", | 254 ":crypto", |
248 ":platform", | 255 ":platform", |
249 ":test_support", | 256 ":test_support", |
250 "//base", | 257 "//base", |
251 "//base/test:run_all_unittests", | 258 "//base/test:run_all_unittests", |
252 "//base/test:test_support", | 259 "//base/test:test_support", |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 # on the current SSL library should just depend on this. | 300 # on the current SSL library should just depend on this. |
294 group("platform") { | 301 group("platform") { |
295 if (use_openssl) { | 302 if (use_openssl) { |
296 deps = [ | 303 deps = [ |
297 "//third_party/boringssl", | 304 "//third_party/boringssl", |
298 ] | 305 ] |
299 } else { | 306 } else { |
300 deps = [ | 307 deps = [ |
301 "//net/third_party/nss/ssl:libssl", | 308 "//net/third_party/nss/ssl:libssl", |
302 ] | 309 ] |
| 310 } |
| 311 |
| 312 if (use_nss_certs || !use_openssl) { |
303 if (is_linux) { | 313 if (is_linux) { |
304 # On Linux, we use the system NSS (excepting SSL where we always use our | 314 # On Linux, we use the system NSS (excepting SSL where we always use our |
305 # own). | 315 # own). |
306 # | 316 # |
307 # We always need our SSL header search path to come before the system one | 317 # We always need our SSL header search path to come before the system one |
308 # so our versions are used. The libssl target will add the search path we | 318 # so our versions are used. The libssl target will add the search path we |
309 # want, but according to GN's ordering rules, public_configs' search path | 319 # want, but according to GN's ordering rules, public_configs' search path |
310 # will get applied before ones inherited from our dependencies. | 320 # will get applied before ones inherited from our dependencies. |
311 # Therefore, we need to explicitly list our custom libssl's config here | 321 # Therefore, we need to explicitly list our custom libssl's config here |
312 # before the system one. | 322 # before the system one. |
313 public_configs = [ | 323 public_configs = [ |
314 "//net/third_party/nss/ssl:ssl_config", | 324 "//net/third_party/nss/ssl:ssl_config", |
315 "//third_party/nss:system_nss_no_ssl_config", | 325 "//third_party/nss:system_nss_no_ssl_config", |
316 ] | 326 ] |
317 } else { | 327 } else { |
318 # Non-Linux platforms use the hermetic NSS from the tree. | 328 # Non-Linux platforms use the hermetic NSS from the tree. |
319 deps += [ | 329 deps += [ |
320 "//third_party/nss:nspr", | 330 "//third_party/nss:nspr", |
321 "//third_party/nss:nss", | 331 "//third_party/nss:nss", |
322 ] | 332 ] |
323 } | 333 } |
324 } | 334 } |
325 } | 335 } |
OLD | NEW |