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")
6 import("//testing/test.gni")
9 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
14 "apple_keychain_ios.mm",
15 "apple_keychain_mac.mm",
21 "ec_signature_creator.cc",
22 "ec_signature_creator.h",
23 "ec_signature_creator_impl.cc",
24 "ec_signature_creator_impl.h",
31 "mac_security_services_lock.cc",
32 "mac_security_services_lock.h",
34 # TODO(brettw) these mocks should be moved to a test_support_crypto target
36 "mock_apple_keychain.cc",
37 "mock_apple_keychain.h",
38 "mock_apple_keychain_ios.cc",
39 "mock_apple_keychain_mac.cc",
40 "nss_crypto_module_delegate.h",
45 "nss_util_internal.h",
56 "scoped_capi_types.h",
64 "signature_creator.cc",
65 "signature_creator.h",
66 "signature_verifier.cc",
67 "signature_verifier.h",
73 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
74 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
79 "//base/third_party/dynamic_annotations",
83 "//third_party/boringssl",
86 if (!is_mac && !is_ios) {
89 "mock_apple_keychain.cc",
90 "mock_apple_keychain.h",
94 "CoreFoundation.framework",
101 "mac_security_services_lock.cc",
102 "mac_security_services_lock.h",
112 # Some files are built when NSS is used for the platform certificate library.
113 if (!use_nss_certs) {
119 "nss_util_internal.h",
123 defines = [ "CRYPTO_IMPLEMENTATION" ]
126 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]
130 test("crypto_unittests") {
133 "ec_private_key_unittest.cc",
134 "ec_signature_creator_unittest.cc",
135 "encryptor_unittest.cc",
138 "nss_key_util_unittest.cc",
139 "nss_util_unittest.cc",
140 "p224_spake_unittest.cc",
142 "random_unittest.cc",
143 "rsa_private_key_unittest.cc",
144 "secure_hash_unittest.cc",
146 "signature_creator_unittest.cc",
147 "signature_verifier_unittest.cc",
148 "symmetric_key_unittest.cc",
151 # Some files are built when NSS is used for the platform certificate library.
152 if (!use_nss_certs) {
154 "nss_key_util_unittest.cc",
155 "nss_util_unittest.cc",
159 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
166 "//base/test:run_all_unittests",
167 "//base/test:test_support",
173 # This has no sources in some cases so can't be a static library.
174 source_set("test_support") {
180 "scoped_test_nss_db.cc",
181 "scoped_test_nss_db.h",
187 "scoped_test_nss_chromeos_user.cc",
188 "scoped_test_nss_chromeos_user.h",
189 "scoped_test_system_nss_key_slot.cc",
190 "scoped_test_system_nss_key_slot.h",
201 config("platform_config") {
202 if (use_nss_certs && is_clang) {
203 # There is a broken header guard in /usr/include/nss/secmod.h:
204 # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
205 cflags = [ "-Wno-header-guard" ]
209 # This is a meta-target that forwards to NSS's SSL library or OpenSSL,
210 # according to the state of the crypto flags. A target just wanting to depend
211 # on the current SSL library should just depend on this.
214 "//third_party/boringssl",
217 # Link in NSS if it is used for the platform certificate library
220 public_configs = [ ":platform_config" ]
221 public_configs += [ "//third_party/nss:system_nss_no_ssl_config" ]