forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBUILD.gn
221 lines (197 loc) · 5.02 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/crypto.gni")
import("//testing/test.gni")
component("crypto") {
output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
sources = [
"aead.cc",
"aead.h",
"crypto_export.h",
"ec_private_key.cc",
"ec_private_key.h",
"ec_signature_creator.cc",
"ec_signature_creator.h",
"ec_signature_creator_impl.cc",
"ec_signature_creator_impl.h",
"encryptor.cc",
"encryptor.h",
"hkdf.cc",
"hkdf.h",
"hmac.cc",
"hmac.h",
"openssl_util.cc",
"openssl_util.h",
"p224_spake.cc",
"p224_spake.h",
"random.cc",
"random.h",
"rsa_private_key.cc",
"rsa_private_key.h",
"scoped_capi_types.h",
"scoped_nss_types.h",
"secure_hash.cc",
"secure_hash.h",
"secure_util.cc",
"secure_util.h",
"sha2.cc",
"sha2.h",
"signature_creator.cc",
"signature_creator.h",
"signature_verifier.cc",
"signature_verifier.h",
"symmetric_key.cc",
"symmetric_key.h",
"unexportable_key.cc",
"unexportable_key.h",
]
deps = [
":platform",
"//base",
"//base/third_party/dynamic_annotations",
]
public_deps = [ "//third_party/boringssl" ]
if (is_apple) {
sources += [
"apple_keychain.h",
# TODO(brettw): these mocks should be moved to a test_support_crypto
# target if possible.
"mock_apple_keychain.cc",
"mock_apple_keychain.h",
]
if (is_mac) {
sources += [
"apple_keychain_mac.mm",
# TODO(brettw): these mocks should be moved to a test_support_crypto
# target if possible.
"mock_apple_keychain_mac.cc",
]
}
if (is_ios) {
sources += [
"apple_keychain_ios.mm",
# TODO(brettw): these mocks should be moved to a test_support_crypto
# target if possible.
"mock_apple_keychain_ios.cc",
]
}
frameworks = [
"CoreFoundation.framework",
"Security.framework",
]
}
if (is_mac) {
sources += [
"mac_security_services_lock.cc",
"mac_security_services_lock.h",
]
}
if (is_win) {
sources += [
"capi_util.cc",
"capi_util.h",
"unexportable_key_win.cc",
]
libs = [ "ncrypt.lib" ]
}
# Some files are built when NSS is used for the platform certificate library.
if (use_nss_certs) {
sources += [
"nss_crypto_module_delegate.h",
"nss_key_util.cc",
"nss_key_util.h",
"nss_util.cc",
"nss_util.h",
"nss_util_internal.h",
]
deps += [ "//build:chromeos_buildflags" ]
}
if (is_chromeos_ash) {
sources += [ "nss_util_chromeos.cc" ]
}
if (is_chromeos || is_chromeos_lacros) {
sources += [
"chaps_support.cc",
"chaps_support.h",
]
}
defines = [ "CRYPTO_IMPLEMENTATION" ]
}
test("crypto_unittests") {
sources = [
"aead_unittest.cc",
"ec_private_key_unittest.cc",
"ec_signature_creator_unittest.cc",
"encryptor_unittest.cc",
"hmac_unittest.cc",
"p224_spake_unittest.cc",
"random_unittest.cc",
"rsa_private_key_unittest.cc",
"secure_hash_unittest.cc",
"sha2_unittest.cc",
"signature_creator_unittest.cc",
"signature_verifier_unittest.cc",
"symmetric_key_unittest.cc",
"unexportable_key_unittest.cc",
]
# Some files are built when NSS is used for the platform certificate library.
if (use_nss_certs) {
sources += [
"nss_key_util_unittest.cc",
"nss_util_unittest.cc",
]
}
deps = [
":crypto",
":platform",
":test_support",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}
static_library("test_support") {
testonly = true
sources = [
"scoped_mock_unexportable_key_provider.cc",
"scoped_mock_unexportable_key_provider.h",
]
if (use_nss_certs) {
sources += [
"scoped_test_nss_db.cc",
"scoped_test_nss_db.h",
]
}
if (is_chromeos_ash) {
sources += [
"scoped_test_nss_chromeos_user.cc",
"scoped_test_nss_chromeos_user.h",
"scoped_test_system_nss_key_slot.cc",
"scoped_test_system_nss_key_slot.h",
]
}
deps = [
":crypto",
":platform",
"//base",
]
}
# This target historically abstracted between different cryptography and TLS
# libraries. Now we always use //third_party/boringssl for cryptography and TLS.
# On Linux and Chrome OS, we additionally use //build/config/linux/nss for some
# certificate-related platform integration points. Depend on one or both of the
# individual targets instead of this one.
#
# TODO(https://crbug.com/1275165): Remove this target.
group("platform") {
public_deps = [ "//third_party/boringssl" ]
# Link in NSS if it is used for the platform certificate library
# (use_nss_certs).
if (use_nss_certs) {
public_configs = [ "//build/config/linux/nss" ]
}
}