1 # Copyright 2013 The Chromium Authors
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/buildflag_header.gni")
6 import("//build/config/chromeos/ui_mode.gni")
7 import("//components/nacl/toolchain.gni")
8 import("//crypto/features.gni")
9 import("//testing/test.gni")
11 buildflag_header("buildflags") {
12 header = "crypto_buildflags.h"
13 flags = [ "USE_NSS_CERTS=$use_nss_certs" ]
17 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
24 "ec_signature_creator.cc",
25 "ec_signature_creator.h",
26 "ec_signature_creator_impl.cc",
27 "ec_signature_creator_impl.h",
49 "signature_creator.cc",
50 "signature_creator.h",
51 "signature_verifier.cc",
52 "signature_verifier.h",
55 "unexportable_key.cc",
57 "unexportable_key_metrics.cc",
58 "unexportable_key_metrics.h",
59 "unexportable_key_software_unsecure.cc",
62 deps = [ "//base/third_party/dynamic_annotations" ]
67 "//third_party/boringssl",
74 # TODO(brettw): these mocks should be moved to a test_support_crypto
76 "mock_apple_keychain.cc",
77 "mock_apple_keychain.h",
82 "apple_keychain_mac.cc",
84 # TODO(brettw): these mocks should be moved to a test_support_crypto
86 "mock_apple_keychain_mac.cc",
91 "apple_keychain_ios.mm",
93 # TODO(brettw): these mocks should be moved to a test_support_crypto
95 "mock_apple_keychain_ios.cc",
100 "CoreFoundation.framework",
101 "Security.framework",
107 "mac_security_services_lock.cc",
108 "mac_security_services_lock.h",
113 "scoped_capi_types.h",
114 "scoped_cng_types.h",
115 "unexportable_key_win.cc",
117 libs = [ "ncrypt.lib" ]
120 # Some files are built when NSS is used for the platform certificate library.
123 "nss_crypto_module_delegate.h",
128 "nss_util_internal.h",
131 "//build:chromeos_buildflags",
132 "//components/nacl/common:buildflags",
134 configs += [ "//build/config/linux/nss" ]
137 if (is_chromeos_ash && !is_minimal_toolchain) {
138 sources += [ "nss_util_chromeos.cc" ]
141 if (is_chromeos && !is_minimal_toolchain) {
148 defines = [ "CRYPTO_IMPLEMENTATION" ]
151 test("crypto_unittests") {
154 "ec_private_key_unittest.cc",
155 "ec_signature_creator_unittest.cc",
156 "encryptor_unittest.cc",
158 "p224_spake_unittest.cc",
159 "random_unittest.cc",
160 "rsa_private_key_unittest.cc",
161 "secure_hash_unittest.cc",
163 "signature_creator_unittest.cc",
164 "signature_verifier_unittest.cc",
165 "symmetric_key_unittest.cc",
166 "unexportable_key_unittest.cc",
170 sources += [ "unexportable_key_metrics_unittest.cc" ]
173 # Some files are built when NSS is used for the platform certificate library.
176 "nss_key_util_unittest.cc",
177 "nss_util_unittest.cc",
179 configs += [ "//build/config/linux/nss" ]
186 "//base/test:run_all_unittests",
187 "//base/test:test_support",
193 static_library("test_support") {
196 "scoped_mock_unexportable_key_provider.cc",
197 "scoped_mock_unexportable_key_provider.h",
202 "scoped_test_nss_db.cc",
203 "scoped_test_nss_db.h",
205 configs += [ "//build/config/linux/nss" ]
208 if (is_chromeos_ash) {
210 "scoped_test_nss_chromeos_user.cc",
211 "scoped_test_nss_chromeos_user.h",
212 "scoped_test_system_nss_key_slot.cc",
213 "scoped_test_system_nss_key_slot.h",