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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 deps += [ "//third_party/android_tools:cpu_features" ] | 129 deps += [ "//third_party/android_tools:cpu_features" ] |
130 } | 130 } |
131 | 131 |
132 if (use_openssl) { | 132 if (use_openssl) { |
133 # Remove NSS files when using OpenSSL | 133 # Remove NSS files when using OpenSSL |
134 sources -= [ | 134 sources -= [ |
135 "ec_private_key_nss.cc", | 135 "ec_private_key_nss.cc", |
136 "ec_signature_creator_nss.cc", | 136 "ec_signature_creator_nss.cc", |
137 "encryptor_nss.cc", | 137 "encryptor_nss.cc", |
138 "hmac_nss.cc", | 138 "hmac_nss.cc", |
139 "nss_util.cc", | |
140 "nss_util.h", | |
141 "nss_util_internal.h", | |
142 "rsa_private_key_nss.cc", | 139 "rsa_private_key_nss.cc", |
143 "secure_hash_default.cc", | 140 "secure_hash_default.cc", |
144 "signature_creator_nss.cc", | 141 "signature_creator_nss.cc", |
145 "signature_verifier_nss.cc", | 142 "signature_verifier_nss.cc", |
146 "symmetric_key_nss.cc", | 143 "symmetric_key_nss.cc", |
147 "third_party/nss/chromium-blapi.h", | 144 "third_party/nss/chromium-blapi.h", |
148 "third_party/nss/chromium-blapit.h", | 145 "third_party/nss/chromium-blapit.h", |
149 "third_party/nss/chromium-nss.h", | 146 "third_party/nss/chromium-nss.h", |
150 "third_party/nss/pk11akey.cc", | 147 "third_party/nss/pk11akey.cc", |
151 "third_party/nss/rsawrapr.c", | 148 "third_party/nss/rsawrapr.c", |
(...skipping 11 matching lines...) Expand all Loading... | |
163 "openssl_util.cc", | 160 "openssl_util.cc", |
164 "openssl_util.h", | 161 "openssl_util.h", |
165 "rsa_private_key_openssl.cc", | 162 "rsa_private_key_openssl.cc", |
166 "secure_hash_openssl.cc", | 163 "secure_hash_openssl.cc", |
167 "signature_creator_openssl.cc", | 164 "signature_creator_openssl.cc", |
168 "signature_verifier_openssl.cc", | 165 "signature_verifier_openssl.cc", |
169 "symmetric_key_openssl.cc", | 166 "symmetric_key_openssl.cc", |
170 ] | 167 ] |
171 } | 168 } |
172 | 169 |
170 # NSS is used for neither the internal crypto library nor the platform | |
171 # certificate library. | |
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 | |
173 defines = [ "CRYPTO_IMPLEMENTATION" ] | 180 defines = [ "CRYPTO_IMPLEMENTATION" ] |
174 } | 181 } |
175 | 182 |
176 # TODO(GYP): TODO(dpranke), fix the compile errors for this stuff | 183 # TODO(GYP): TODO(dpranke), fix the compile errors for this stuff |
177 # and make it work. | 184 # and make it work. |
178 if (false && is_win) { | 185 if (false && is_win) { |
179 # A minimal crypto subset for hmac-related stuff that small standalone | 186 # A minimal crypto subset for hmac-related stuff that small standalone |
180 # 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 |
181 # OpenSSL/NSS but will use Windows APIs for that functionality. | 188 # OpenSSL/NSS but will use Windows APIs for that functionality. |
182 source_set("crypto_minimal_win") { | 189 source_set("crypto_minimal_win") { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 "random_unittest.cc", | 231 "random_unittest.cc", |
225 "rsa_private_key_unittest.cc", | 232 "rsa_private_key_unittest.cc", |
226 "rsa_private_key_nss_unittest.cc", | 233 "rsa_private_key_nss_unittest.cc", |
227 "secure_hash_unittest.cc", | 234 "secure_hash_unittest.cc", |
228 "sha2_unittest.cc", | 235 "sha2_unittest.cc", |
229 "signature_creator_unittest.cc", | 236 "signature_creator_unittest.cc", |
230 "signature_verifier_unittest.cc", | 237 "signature_verifier_unittest.cc", |
231 "symmetric_key_unittest.cc", | 238 "symmetric_key_unittest.cc", |
232 ] | 239 ] |
233 | 240 |
234 if (use_openssl || !is_linux) { | 241 if (use_openssl && !use_nss_certs) { |
235 sources -= [ "rsa_private_key_nss_unittest.cc" ] | 242 # nss_util is built if NSS is used for either the internal crypto library |
243 # or the platform certificate library. | |
244 sources -= [ "nss_util_unittest.cc" ] | |
236 } | 245 } |
237 | 246 |
238 if (use_openssl) { | 247 if (use_openssl) { |
239 sources -= [ "nss_util_unittest.cc" ] | 248 sources -= [ "rsa_private_key_nss_unittest.cc" ] |
240 } else { | 249 } else { |
241 sources -= [ "openssl_bio_string_unittest.cc" ] | 250 sources -= [ "openssl_bio_string_unittest.cc" ] |
242 } | 251 } |
243 | 252 |
244 deps = [ | 253 deps = [ |
245 ":crypto", | 254 ":crypto", |
246 ":platform", | 255 ":platform", |
247 ":test_support", | 256 ":test_support", |
248 "//base", | 257 "//base", |
249 "//base/test:run_all_unittests", | 258 "//base/test:run_all_unittests", |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 # on the current SSL library should just depend on this. | 300 # on the current SSL library should just depend on this. |
292 group("platform") { | 301 group("platform") { |
293 if (use_openssl) { | 302 if (use_openssl) { |
294 deps = [ | 303 deps = [ |
295 "//third_party/boringssl", | 304 "//third_party/boringssl", |
296 ] | 305 ] |
297 } else { | 306 } else { |
298 deps = [ | 307 deps = [ |
299 "//net/third_party/nss/ssl:libssl", | 308 "//net/third_party/nss/ssl:libssl", |
300 ] | 309 ] |
310 } | |
311 | |
312 # Link in NSS if it is used for either the internal crypto library | |
313 # (use_openssl==0) or platform certificate library (use_nss==1). | |
314 if (use_nss_certs || !use_openssl) { | |
301 if (is_linux) { | 315 if (is_linux) { |
302 # On Linux, we use the system NSS (excepting SSL where we always use our | 316 # On Linux, we use the system NSS (excepting SSL where we always use our |
303 # own). | 317 # own). |
304 # | 318 # |
305 # We always need our SSL header search path to come before the system one | 319 # We always need our SSL header search path to come before the system one |
306 # so our versions are used. The libssl target will add the search path we | 320 # so our versions are used. The libssl target will add the search path we |
307 # want, but according to GN's ordering rules, public_configs' search path | 321 # want, but according to GN's ordering rules, public_configs' search path |
308 # will get applied before ones inherited from our dependencies. | 322 # will get applied before ones inherited from our dependencies. |
309 # Therefore, we need to explicitly list our custom libssl's config here | 323 # Therefore, we need to explicitly list our custom libssl's config here |
310 # before the system one. | 324 # before the system one. |
311 public_configs = [ | 325 public_configs = [ |
312 "//net/third_party/nss/ssl:ssl_config", | 326 "//net/third_party/nss/ssl:ssl_config", |
Ryan Sleevi
2015/02/26 00:35:36
This doesn't seem right for the use_nss_certs case
davidben
2015/02/26 22:59:24
Yeah, you're right. I've tweaked it a little...
I
| |
313 "//third_party/nss:system_nss_no_ssl_config", | 327 "//third_party/nss:system_nss_no_ssl_config", |
314 ] | 328 ] |
315 } else { | 329 } else { |
316 # Non-Linux platforms use the hermetic NSS from the tree. | 330 # Non-Linux platforms use the hermetic NSS from the tree. |
317 deps += [ | 331 deps += [ |
318 "//third_party/nss:nspr", | 332 "//third_party/nss:nspr", |
319 "//third_party/nss:nss", | 333 "//third_party/nss:nss", |
320 ] | 334 ] |
321 } | 335 } |
322 } | 336 } |
323 } | 337 } |
OLD | NEW |