blob: c8068739f25405ca9388ea9e0cf51e2ccf6b6af6 [file] [log] [blame]
[email protected]e4c18472012-01-25 00:56:431# Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]4b559b4d2011-04-14 17:37:142# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
6 'variables': {
7 'chromium_code': 1,
[email protected]4a0141b2012-03-27 01:15:308 # Put all transitive dependencies for Windows HMAC here.
9 # This is required so that we can build them for nacl win64.
10 'hmac_win64_related_sources': [
11 'hmac.cc',
12 'hmac.h',
13 'hmac_win.cc',
14 'secure_util.cc',
15 'secure_util.h',
16 'symmetric_key.h',
17 'symmetric_key_win.cc',
18 'third_party/nss/chromium-sha256.h',
19 'third_party/nss/sha512.cc',
20 ],
[email protected]4b559b4d2011-04-14 17:37:1421 },
22 'targets': [
23 {
24 'target_name': 'crypto',
[email protected]3581bac2011-07-12 19:18:5425 'type': '<(component)',
[email protected]fed029712011-04-14 18:56:5926 'product_name': 'crcrypto', # Avoid colliding with OpenSSL's libcrypto
[email protected]4b559b4d2011-04-14 17:37:1427 'dependencies': [
28 '../base/base.gyp:base',
[email protected]82091cc2011-06-17 21:11:1329 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
[email protected]4b559b4d2011-04-14 17:37:1430 ],
[email protected]1dde29e2011-07-20 18:38:2431 'defines': [
32 'CRYPTO_IMPLEMENTATION',
33 ],
[email protected]4b559b4d2011-04-14 17:37:1434 'msvs_disabled_warnings': [
35 4018,
36 ],
37 'conditions': [
[email protected]271428d2012-08-09 10:24:5438 [ 'os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
[email protected]638e9df42011-05-31 17:19:3039 'dependencies': [
40 '../build/linux/system.gyp:ssl',
41 ],
42 'export_dependent_settings': [
43 '../build/linux/system.gyp:ssl',
44 ],
[email protected]4b559b4d2011-04-14 17:37:1445 'conditions': [
46 [ 'chromeos==1', {
47 'sources/': [ ['include', '_chromeos\\.cc$'] ]
48 },
49 ],
[email protected]4b559b4d2011-04-14 17:37:1450 ],
[email protected]271428d2012-08-09 10:24:5451 }, { # os_posix != 1 or OS == "mac" or OS == "ios" or OS == "android"
[email protected]4b559b4d2011-04-14 17:37:1452 'sources/': [
53 ['exclude', '_nss\.cc$'],
[email protected]eaa60482011-11-09 05:08:5154 ['include', 'ec_private_key_nss\.cc$'],
[email protected]e4c18472012-01-25 00:56:4355 ['include', 'ec_signature_creator_nss\.cc$'],
[email protected]45a445212012-06-15 08:11:5256 ['include', 'encryptor_nss\.cc$'],
57 ['include', 'hmac_nss\.cc$'],
[email protected]e4c18472012-01-25 00:56:4358 ['include', 'signature_verifier_nss\.cc$'],
[email protected]45a445212012-06-15 08:11:5259 ['include', 'symmetric_key_nss\.cc$'],
[email protected]4b559b4d2011-04-14 17:37:1460 ],
[email protected]9b8c9622011-07-07 13:39:4561 'sources!': [
[email protected]45a445212012-06-15 08:11:5262 'hmac_win.cc',
[email protected]9b8c9622011-07-07 13:39:4563 'openpgp_symmetric_encryption.cc',
[email protected]45a445212012-06-15 08:11:5264 'openpgp_symmetric_encryption.h',
65 'symmetric_key_win.cc',
[email protected]9b8c9622011-07-07 13:39:4566 ],
[email protected]4b559b4d2011-04-14 17:37:1467 }],
[email protected]982f1ab2012-08-30 13:03:4668 [ 'OS != "mac" and OS != "ios"', {
69 'sources!': [
70 'apple_keychain.h',
71 'mock_apple_keychain.cc',
72 'mock_apple_keychain.h',
73 ],
74 }],
[email protected]ae7c9f42011-11-21 11:41:1675 [ 'OS == "android"', {
76 'dependencies': [
[email protected]8e853b142012-05-16 07:40:0177 '../third_party/openssl/openssl.gyp:openssl',
[email protected]ae7c9f42011-11-21 11:41:1678 ],
79 'sources/': [
80 ['exclude', 'ec_private_key_nss\.cc$'],
[email protected]e4c18472012-01-25 00:56:4381 ['exclude', 'ec_signature_creator_nss\.cc$'],
[email protected]45a445212012-06-15 08:11:5282 ['exclude', 'encryptor_nss\.cc$'],
83 ['exclude', 'hmac_nss\.cc$'],
[email protected]e4c18472012-01-25 00:56:4384 ['exclude', 'signature_verifier_nss\.cc$'],
[email protected]45a445212012-06-15 08:11:5285 ['exclude', 'symmetric_key_nss\.cc$'],
[email protected]ae7c9f42011-11-21 11:41:1686 ],
87 }],
[email protected]c48aef92011-11-22 23:41:4588 [ 'os_bsd==1', {
[email protected]4b559b4d2011-04-14 17:37:1489 'link_settings': {
90 'libraries': [
91 '-L/usr/local/lib -lexecinfo',
92 ],
93 },
94 },
95 ],
[email protected]982f1ab2012-08-30 13:03:4696 [ 'OS == "ios"', {
97 'sources!': [
98 # This class is stubbed out on iOS.
99 'rsa_private_key.cc',
100 ],
101 }],
[email protected]4b559b4d2011-04-14 17:37:14102 [ 'OS == "mac"', {
103 'link_settings': {
104 'libraries': [
105 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
106 ],
107 },
108 }, { # OS != "mac"
109 'sources!': [
110 'cssm_init.cc',
111 'cssm_init.h',
112 'mac_security_services_lock.cc',
113 'mac_security_services_lock.h',
114 ],
115 }],
[email protected]271428d2012-08-09 10:24:54116 [ 'OS == "mac" or OS == "ios" or OS == "win"', {
[email protected]56af67212011-06-29 20:53:11117 'dependencies': [
118 '../third_party/nss/nss.gyp:nspr',
119 '../third_party/nss/nss.gyp:nss',
120 ],
[email protected]45a445212012-06-15 08:11:52121 'export_dependent_settings': [
122 '../third_party/nss/nss.gyp:nspr',
123 '../third_party/nss/nss.gyp:nss',
124 ],
[email protected]56af67212011-06-29 20:53:11125 }],
[email protected]3581bac2011-07-12 19:18:54126 [ 'OS != "win"', {
[email protected]56af67212011-06-29 20:53:11127 'sources!': [
128 'capi_util.h',
129 'capi_util.cc',
130 ],
131 }],
[email protected]4b559b4d2011-04-14 17:37:14132 [ 'use_openssl==1', {
133 # TODO(joth): Use a glob to match exclude patterns once the
134 # OpenSSL file set is complete.
135 'sources!': [
[email protected]eaa60482011-11-09 05:08:51136 'ec_private_key_nss.cc',
[email protected]e4c18472012-01-25 00:56:43137 'ec_signature_creator_nss.cc',
[email protected]4b559b4d2011-04-14 17:37:14138 'encryptor_nss.cc',
139 'hmac_nss.cc',
140 'nss_util.cc',
141 'nss_util.h',
[email protected]9b8c9622011-07-07 13:39:45142 'openpgp_symmetric_encryption.cc',
[email protected]4b559b4d2011-04-14 17:37:14143 'rsa_private_key_nss.cc',
144 'secure_hash_default.cc',
145 'signature_creator_nss.cc',
146 'signature_verifier_nss.cc',
147 'symmetric_key_nss.cc',
[email protected]e3ff8ee22011-11-15 01:36:45148 'third_party/nss/chromium-blapi.h',
149 'third_party/nss/chromium-blapit.h',
[email protected]eaa60482011-11-09 05:08:51150 'third_party/nss/chromium-nss.h',
[email protected]e3ff8ee22011-11-15 01:36:45151 'third_party/nss/chromium-sha256.h',
[email protected]eaa60482011-11-09 05:08:51152 'third_party/nss/pk11akey.cc',
[email protected]e4008cc2011-12-02 21:05:29153 'third_party/nss/secsign.cc',
[email protected]4b559b4d2011-04-14 17:37:14154 'third_party/nss/sha512.cc',
155 ],
156 }, {
157 'sources!': [
[email protected]eaa60482011-11-09 05:08:51158 'ec_private_key_openssl.cc',
[email protected]e4c18472012-01-25 00:56:43159 'ec_signature_creator_openssl.cc',
[email protected]4b559b4d2011-04-14 17:37:14160 'encryptor_openssl.cc',
161 'hmac_openssl.cc',
162 'openssl_util.cc',
163 'openssl_util.h',
164 'rsa_private_key_openssl.cc',
165 'secure_hash_openssl.cc',
166 'signature_creator_openssl.cc',
167 'signature_verifier_openssl.cc',
168 'symmetric_key_openssl.cc',
169 ],
170 },],
171 ],
172 'sources': [
[email protected]4a0141b2012-03-27 01:15:30173 # NOTE: all transitive dependencies of HMAC on windows need
174 # to be placed in the source list above.
175 '<@(hmac_win64_related_sources)',
[email protected]982f1ab2012-08-30 13:03:46176 'apple_keychain.h',
177 'apple_keychain_ios.mm',
178 'apple_keychain_mac.mm',
[email protected]4b559b4d2011-04-14 17:37:14179 'capi_util.cc',
180 'capi_util.h',
[email protected]d613a9902011-08-05 20:59:11181 'crypto_export.h',
[email protected]4b559b4d2011-04-14 17:37:14182 'crypto_module_blocking_password_delegate.h',
183 'cssm_init.cc',
184 'cssm_init.h',
[email protected]017105b2012-11-09 19:30:32185 'ghash.cc',
186 'ghash.h',
[email protected]eaa60482011-11-09 05:08:51187 'ec_private_key.h',
188 'ec_private_key_nss.cc',
189 'ec_private_key_openssl.cc',
[email protected]6b2e61f2012-02-28 08:06:54190 'ec_signature_creator.cc',
[email protected]e4c18472012-01-25 00:56:43191 'ec_signature_creator.h',
[email protected]6b2e61f2012-02-28 08:06:54192 'ec_signature_creator_impl.h',
[email protected]e4c18472012-01-25 00:56:43193 'ec_signature_creator_nss.cc',
194 'ec_signature_creator_openssl.cc',
[email protected]2377cdee2011-06-24 20:46:06195 'encryptor.cc',
[email protected]4b559b4d2011-04-14 17:37:14196 'encryptor.h',
[email protected]4b559b4d2011-04-14 17:37:14197 'encryptor_nss.cc',
198 'encryptor_openssl.cc',
[email protected]4b559b4d2011-04-14 17:37:14199 'hmac_nss.cc',
200 'hmac_openssl.cc',
[email protected]4b559b4d2011-04-14 17:37:14201 'mac_security_services_lock.cc',
202 'mac_security_services_lock.h',
[email protected]982f1ab2012-08-30 13:03:46203 'mock_apple_keychain.cc',
204 'mock_apple_keychain.h',
205 'mock_apple_keychain_ios.cc',
206 'mock_apple_keychain_mac.cc',
[email protected]d9a262d2011-11-22 01:29:37207 'p224_spake.cc',
208 'p224_spake.h',
[email protected]4b559b4d2011-04-14 17:37:14209 'nss_util.cc',
210 'nss_util.h',
211 'nss_util_internal.h',
[email protected]9b8c9622011-07-07 13:39:45212 'openpgp_symmetric_encryption.cc',
[email protected]e0faab52011-06-27 20:37:27213 'openpgp_symmetric_encryption.h',
214 'openssl_util.cc',
215 'openssl_util.h',
[email protected]61f7c7d2011-11-07 20:41:06216 'p224.cc',
217 'p224.h',
[email protected]9b205782012-08-02 20:22:25218 'random.h',
219 'random.cc',
[email protected]4b559b4d2011-04-14 17:37:14220 'rsa_private_key.cc',
[email protected]e0faab52011-06-27 20:37:27221 'rsa_private_key.h',
[email protected]1f8cbcb2012-08-20 01:11:49222 'rsa_private_key_ios.cc',
[email protected]4b559b4d2011-04-14 17:37:14223 'rsa_private_key_mac.cc',
224 'rsa_private_key_nss.cc',
225 'rsa_private_key_openssl.cc',
226 'rsa_private_key_win.cc',
227 'scoped_capi_types.h',
228 'scoped_nss_types.h',
229 'secure_hash.h',
230 'secure_hash_default.cc',
231 'secure_hash_openssl.cc',
232 'sha2.cc',
233 'sha2.h',
234 'signature_creator.h',
235 'signature_creator_mac.cc',
236 'signature_creator_nss.cc',
237 'signature_creator_openssl.cc',
238 'signature_creator_win.cc',
239 'signature_verifier.h',
[email protected]4b559b4d2011-04-14 17:37:14240 'signature_verifier_nss.cc',
241 'signature_verifier_openssl.cc',
[email protected]4b559b4d2011-04-14 17:37:14242 'symmetric_key_nss.cc',
243 'symmetric_key_openssl.cc',
[email protected]e3ff8ee22011-11-15 01:36:45244 'third_party/nss/chromium-blapi.h',
245 'third_party/nss/chromium-blapit.h',
[email protected]eaa60482011-11-09 05:08:51246 'third_party/nss/chromium-nss.h',
247 'third_party/nss/pk11akey.cc',
[email protected]e4008cc2011-12-02 21:05:29248 'third_party/nss/secsign.cc',
[email protected]4b559b4d2011-04-14 17:37:14249 ],
250 },
251 {
252 'target_name': 'crypto_unittests',
253 'type': 'executable',
254 'sources': [
255 # Infrastructure files.
256 'run_all_unittests.cc',
257
258 # Tests.
[email protected]eaa60482011-11-09 05:08:51259 'ec_private_key_unittest.cc',
[email protected]e4c18472012-01-25 00:56:43260 'ec_signature_creator_unittest.cc',
[email protected]4b559b4d2011-04-14 17:37:14261 'encryptor_unittest.cc',
[email protected]017105b2012-11-09 19:30:32262 'ghash_unittest.cc',
[email protected]4b559b4d2011-04-14 17:37:14263 'hmac_unittest.cc',
[email protected]ca929ed32011-12-15 20:37:28264 'nss_util_unittest.cc',
[email protected]61f7c7d2011-11-07 20:41:06265 'p224_unittest.cc',
[email protected]d9a262d2011-11-22 01:29:37266 'p224_spake_unittest.cc',
[email protected]9b205782012-08-02 20:22:25267 'random_unittest.cc',
[email protected]4b559b4d2011-04-14 17:37:14268 'rsa_private_key_unittest.cc',
269 'rsa_private_key_nss_unittest.cc',
270 'secure_hash_unittest.cc',
271 'sha2_unittest.cc',
272 'signature_creator_unittest.cc',
273 'signature_verifier_unittest.cc',
274 'symmetric_key_unittest.cc',
[email protected]9b8c9622011-07-07 13:39:45275 'openpgp_symmetric_encryption_unittest.cc',
[email protected]4b559b4d2011-04-14 17:37:14276 ],
277 'dependencies': [
278 'crypto',
279 '../base/base.gyp:base',
280 '../base/base.gyp:test_support_base',
281 '../testing/gmock.gyp:gmock',
282 '../testing/gtest.gyp:gtest',
283 ],
284 'conditions': [
[email protected]271428d2012-08-09 10:24:54285 [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
[email protected]4b559b4d2011-04-14 17:37:14286 'conditions': [
287 [ 'linux_use_tcmalloc==1', {
288 'dependencies': [
289 '../base/allocator/allocator.gyp:allocator',
290 ],
291 },
292 ],
293 ],
294 'dependencies': [
[email protected]638e9df42011-05-31 17:19:30295 '../build/linux/system.gyp:ssl',
[email protected]4b559b4d2011-04-14 17:37:14296 ],
[email protected]271428d2012-08-09 10:24:54297 }, { # os_posix != 1 or OS == "mac" or OS == "android" or OS == "ios"
[email protected]4b559b4d2011-04-14 17:37:14298 'sources!': [
299 'rsa_private_key_nss_unittest.cc',
[email protected]9b8c9622011-07-07 13:39:45300 'openpgp_symmetric_encryption_unittest.cc',
[email protected]4b559b4d2011-04-14 17:37:14301 ]
302 }],
[email protected]271428d2012-08-09 10:24:54303 [ 'OS == "mac" or OS == "ios" or OS == "win"', {
[email protected]4b559b4d2011-04-14 17:37:14304 'dependencies': [
305 '../third_party/nss/nss.gyp:nss',
306 ],
307 }],
[email protected]271428d2012-08-09 10:24:54308 ['OS == "ios"', {
309 'sources!': [
310 # These tests are excluded because they test classes that are not
311 # implemented on iOS.
312 'rsa_private_key_unittest.cc',
313 'signature_creator_unittest.cc',
314 'signature_verifier_unittest.cc',
315 ],
316 }],
[email protected]a4d60842012-03-15 19:07:41317 [ 'OS == "mac"', {
318 'dependencies': [
319 '../third_party/nss/nss.gyp:nspr',
320 ],
321 }],
[email protected]4b559b4d2011-04-14 17:37:14322 [ 'use_openssl==1', {
323 'sources!': [
[email protected]ca929ed32011-12-15 20:37:28324 'nss_util_unittest.cc',
[email protected]9b8c9622011-07-07 13:39:45325 'openpgp_symmetric_encryption_unittest.cc',
[email protected]4b559b4d2011-04-14 17:37:14326 'rsa_private_key_nss_unittest.cc',
327 ],
[email protected]4b559b4d2011-04-14 17:37:14328 }],
329 ],
330 },
331 ],
[email protected]4a0141b2012-03-27 01:15:30332 'conditions': [
333 [ 'OS == "win"', {
334 'targets': [
335 {
336 'target_name': 'crypto_nacl_win64',
[email protected]45a445212012-06-15 08:11:52337 # We do not want nacl_helper to depend on NSS because this would
338 # require including a 64-bit copy of NSS. Thus, use the native APIs
339 # for the helper.
[email protected]4a0141b2012-03-27 01:15:30340 'type': '<(component)',
341 'dependencies': [
342 '../base/base.gyp:base_nacl_win64',
343 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
344 ],
345 'sources': [
346 '<@(hmac_win64_related_sources)',
347 ],
348 'defines': [
349 'CRYPTO_IMPLEMENTATION',
[email protected]45a445212012-06-15 08:11:52350 '<@(nacl_win64_defines)',
[email protected]4a0141b2012-03-27 01:15:30351 ],
352 'msvs_disabled_warnings': [
353 4018,
354 ],
355 'configurations': {
356 'Common_Base': {
357 'msvs_target_platform': 'x64',
358 },
359 },
360 },
361 ],
362 }],
363 ],
[email protected]4b559b4d2011-04-14 17:37:14364}