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
3 # found in the LICENSE file.
5 import("//build/config/crypto.gni")
8 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
11 "apple_keychain_ios.mm",
12 "apple_keychain_mac.mm",
16 "crypto_module_blocking_password_delegate.h",
23 "ec_private_key_nss.cc",
24 "ec_private_key_openssl.cc",
25 "ec_signature_creator.cc",
26 "ec_signature_creator.h",
27 "ec_signature_creator_impl.h",
28 "ec_signature_creator_nss.cc",
29 "ec_signature_creator_openssl.cc",
33 "encryptor_openssl.cc",
42 "mac_security_services_lock.cc",
43 "mac_security_services_lock.h",
44 # TODO(brettw) these mocks should be moved to a test_support_crypto target
46 "mock_apple_keychain.cc",
47 "mock_apple_keychain.h",
48 "mock_apple_keychain_ios.cc",
49 "mock_apple_keychain_mac.cc",
52 "nss_util_internal.h",
53 "openpgp_symmetric_encryption.cc",
54 "openpgp_symmetric_encryption.h",
65 "rsa_private_key_nss.cc",
66 "rsa_private_key_openssl.cc",
67 "scoped_capi_types.h",
69 "secure_hash_default.cc",
71 "secure_hash_openssl.cc",
76 "signature_creator.h",
77 "signature_creator_nss.cc",
78 "signature_creator_openssl.cc",
79 "signature_verifier.h",
80 "signature_verifier_nss.cc",
81 "signature_verifier_openssl.cc",
83 "symmetric_key_nss.cc",
84 "symmetric_key_openssl.cc",
85 "third_party/nss/chromium-blapi.h",
86 "third_party/nss/chromium-blapit.h",
87 "third_party/nss/chromium-nss.h",
88 "third_party/nss/chromium-sha256.h",
89 "third_party/nss/pk11akey.cc",
90 "third_party/nss/rsawrapr.c",
91 "third_party/nss/secsign.cc",
92 "third_party/nss/sha512.cc",
98 "//base/third_party/dynamic_annotations",
101 if (!is_mac && !is_ios) {
104 "mock_apple_keychain.cc",
105 "mock_apple_keychain.h",
111 "openpgp_symmetric_encryption.cc",
112 "openpgp_symmetric_encryption.h",
114 if (use_nss) { # Removed for non-NSS in all cases below.
116 "openpgp_symmetric_encryption.cc",
117 "openpgp_symmetric_encryption.h",
125 "mac_security_services_lock.cc",
126 "mac_security_services_lock.h",
138 "ec_private_key_nss.cc",
139 "ec_signature_creator_nss.cc",
144 "rsa_private_key_nss.cc",
145 "secure_hash_default.cc",
146 "signature_creator_nss.cc",
147 "signature_verifier_nss.cc",
148 "symmetric_key_nss.cc",
149 "third_party/nss/chromium-blapi.h",
150 "third_party/nss/chromium-blapit.h",
151 "third_party/nss/chromium-nss.h",
152 "third_party/nss/pk11akey.cc",
153 "third_party/nss/rsawrapr.c",
154 "third_party/nss/secsign.cc",
159 "ec_private_key_openssl.cc",
160 "ec_signature_creator_openssl.cc",
161 "encryptor_openssl.cc",
165 "rsa_private_key_openssl.cc",
166 "secure_hash_openssl.cc",
167 "signature_creator_openssl.cc",
168 "signature_verifier_openssl.cc",
169 "symmetric_key_openssl.cc",
173 defines = [ "CRYPTO_IMPLEMENTATION" ]
177 # A minimal crypto subset for hmac-related stuff that small standalone
178 # targets can use to reduce code size on Windows. This does not depend on
179 # OpenSSL/NSS but will use Windows APIs for that functionality.
180 source_set("crypto_minimal_win") {
188 "symmetric_key_win.cc",
189 "third_party/nss/chromium-sha256.h",
190 "third_party/nss/sha512.cc",
195 "//base/third_party/dynamic_annotations",
198 defines = [ "CRYPTO_IMPLEMENTATION" ]
202 test("crypto_unittests") {
205 "curve25519_unittest.cc",
206 "ec_private_key_unittest.cc",
207 "ec_signature_creator_unittest.cc",
208 "encryptor_unittest.cc",
212 "nss_util_unittest.cc",
214 "p224_spake_unittest.cc",
215 "random_unittest.cc",
216 "rsa_private_key_unittest.cc",
217 "rsa_private_key_nss_unittest.cc",
218 "secure_hash_unittest.cc",
220 "signature_creator_unittest.cc",
221 "signature_verifier_unittest.cc",
222 "symmetric_key_unittest.cc",
223 "openpgp_symmetric_encryption_unittest.cc",
228 "nss_util_unittest.cc",
229 "openpgp_symmetric_encryption_unittest.cc",
230 "rsa_private_key_nss_unittest.cc",
234 if (use_openssl || !is_linux) {
236 "rsa_private_key_nss_unittest.cc",
237 "openpgp_symmetric_encryption_unittest.cc",
242 sources -= [ "nss_util_unittest.cc" ]
249 "//base/test:run_all_unittests",
250 "//base/test:test_support",
256 # This is a meta-target that forwards to NSS's SSL library or OpenSSL,
257 # according to the state of the crypto flags. A target just wanting to depend
258 # on the current SSL library should just depend on this.
261 deps = [ "//third_party/openssl" ]
263 deps = [ "//net/third_party/nss/ssl:libssl" ]
265 # On Linux, we use the system NSS (excepting SSL where we always use our
267 direct_dependent_configs = [
268 "//third_party/nss:system_nss_no_ssl_config"
271 # Non-Linux platforms use the hermetic NSS from the tree.
273 "//third_party/nss:nspr",
274 "//third_party/nss:nss",