1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
14 'target_name': 'crypto',
15 'type': '<(component)',
16 'product_name': 'crcrypto', # Avoid colliding with OpenSSL's libcrypto
18 '../base/base.gyp:base',
19 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
22 'CRYPTO_IMPLEMENTATION',
25 [ 'os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
27 '../build/linux/system.gyp:ssl',
29 'export_dependent_settings': [
30 '../build/linux/system.gyp:ssl',
34 'sources/': [ ['include', '_chromeos\\.cc$'] ]
38 }, { # os_posix != 1 or OS == "mac" or OS == "ios" or OS == "android"
41 'symmetric_key_win.cc',
44 [ 'OS != "mac" and OS != "ios"', {
47 'mock_apple_keychain.cc',
48 'mock_apple_keychain.h',
51 [ 'OS == "android"', {
53 '../build/android/ndk.gyp:cpu_features',
59 '-L/usr/local/lib -lexecinfo',
67 '$(SDKROOT)/System/Library/Frameworks/Security.framework',
74 'mac_security_services_lock.cc',
75 'mac_security_services_lock.h',
78 [ 'use_openssl == 0 and (OS == "mac" or OS == "ios" or OS == "win")', {
80 '../third_party/nss/nss.gyp:nspr',
81 '../third_party/nss/nss.gyp:nss',
83 'export_dependent_settings': [
84 '../third_party/nss/nss.gyp:nspr',
85 '../third_party/nss/nss.gyp:nss',
95 'msvs_disabled_warnings': [
96 4267, # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
100 [ 'use_openssl==1', {
102 '../third_party/boringssl/boringssl.gyp:boringssl',
104 # TODO(joth): Use a glob to match exclude patterns once the
105 # OpenSSL file set is complete.
107 'ec_private_key_nss.cc',
108 'ec_signature_creator_nss.cc',
111 'rsa_private_key_nss.cc',
112 'secure_hash_default.cc',
113 'signature_creator_nss.cc',
114 'signature_verifier_nss.cc',
115 'symmetric_key_nss.cc',
116 'third_party/nss/chromium-blapi.h',
117 'third_party/nss/chromium-blapit.h',
118 'third_party/nss/chromium-nss.h',
119 'third_party/nss/chromium-prtypes.h',
120 'third_party/nss/chromium-sha256.h',
121 'third_party/nss/pk11akey.cc',
122 'third_party/nss/rsawrapr.c',
123 'third_party/nss/secsign.cc',
124 'third_party/nss/sha512.cc',
130 'ec_private_key_openssl.cc',
131 'ec_signature_creator_openssl.cc',
132 'encryptor_openssl.cc',
134 'openssl_bio_string.cc',
135 'openssl_bio_string.h',
138 'rsa_private_key_openssl.cc',
139 'secure_hash_openssl.cc',
140 'signature_creator_openssl.cc',
141 'signature_verifier_openssl.cc',
142 'symmetric_key_openssl.cc',
145 [ 'use_openssl==1 and use_nss_certs==0', {
146 # Some files are built when NSS is used at all, either for the
147 # internal crypto library or the platform certificate library.
153 'nss_util_internal.h',
158 '<@(crypto_sources)',
162 'target_name': 'crypto_unittests',
163 'type': 'executable',
165 'aead_openssl_unittest.cc',
166 'curve25519_unittest.cc',
167 'ec_private_key_unittest.cc',
168 'ec_signature_creator_unittest.cc',
169 'encryptor_unittest.cc',
173 'nss_key_util_unittest.cc',
174 'nss_util_unittest.cc',
175 'openssl_bio_string_unittest.cc',
177 'p224_spake_unittest.cc',
178 'random_unittest.cc',
179 'rsa_private_key_unittest.cc',
180 'secure_hash_unittest.cc',
182 'signature_creator_unittest.cc',
183 'signature_verifier_unittest.cc',
184 'symmetric_key_unittest.cc',
188 'crypto_test_support',
189 '../base/base.gyp:base',
190 '../base/base.gyp:run_all_unittests',
191 '../base/base.gyp:test_support_base',
192 '../testing/gmock.gyp:gmock',
193 '../testing/gtest.gyp:gtest',
196 [ 'use_nss_certs == 1', {
198 [ 'use_allocator!="none"', {
200 '../base/allocator/allocator.gyp:allocator',
206 '../build/linux/system.gyp:ssl',
209 [ 'use_openssl == 1 and use_nss_certs == 0', {
210 # Some files are built when NSS is used at all, either for the
211 # internal crypto library or the platform certificate library.
213 'nss_key_util_unittest.cc',
214 'nss_util_unittest.cc',
217 [ 'use_openssl == 0 and (OS == "mac" or OS == "ios" or OS == "win")', {
219 '../third_party/nss/nss.gyp:nspr',
223 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
224 'msvs_disabled_warnings': [4267, ],
226 [ 'use_openssl==1', {
228 '../third_party/boringssl/boringssl.gyp:boringssl',
232 'openssl_bio_string_unittest.cc',
239 ['OS == "win" and target_arch=="ia32"', {
242 'target_name': 'crypto_nacl_win64',
243 # We do not want nacl_helper to depend on NSS because this would
244 # require including a 64-bit copy of NSS. Thus, use the native APIs
246 'type': '<(component)',
248 '../base/base.gyp:base_win64',
249 '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
252 '<@(nacl_win64_sources)',
255 'CRYPTO_IMPLEMENTATION',
256 '<@(nacl_win64_defines)',
258 'msvs_disabled_warnings': [
263 'msvs_target_platform': 'x64',
269 ['use_nss_certs==1', {
272 'target_name': 'crypto_test_support',
273 'type': 'static_library',
275 '../base/base.gyp:base',
279 'scoped_test_nss_db.cc',
280 'scoped_test_nss_db.h',
281 'scoped_test_nss_chromeos_user.cc',
282 'scoped_test_nss_chromeos_user.h',
283 'scoped_test_system_nss_key_slot.cc',
284 'scoped_test_system_nss_key_slot.h',
287 ['use_nss_certs==0', {
289 'scoped_test_nss_db.cc',
290 'scoped_test_nss_db.h',
295 'scoped_test_nss_chromeos_user.cc',
296 'scoped_test_nss_chromeos_user.h',
297 'scoped_test_system_nss_key_slot.cc',
298 'scoped_test_system_nss_key_slot.h',
303 ]}, { # use_nss_certs==0
306 'target_name': 'crypto_test_support',
311 ['test_isolation_mode != "noop"', {
314 'target_name': 'crypto_unittests_run',
320 '../build/isolate.gypi',
323 'crypto_unittests.isolate',