| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/crypto.gni") | 5 import("//build/config/crypto.gni") |
| 6 | 6 |
| 7 component("crypto") { | 7 component("crypto") { |
| 8 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto. | 8 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto. |
| 9 sources = [ | 9 sources = [ |
| 10 "apple_keychain.h", | 10 "apple_keychain.h", |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 sources -= [ | 117 sources -= [ |
| 118 "capi_util.cc", | 118 "capi_util.cc", |
| 119 "capi_util.h", | 119 "capi_util.h", |
| 120 ] | 120 ] |
| 121 } | 121 } |
| 122 | 122 |
| 123 if (is_android) { | 123 if (is_android) { |
| 124 deps += [ "//third_party/android_tools:cpu_features" ] | 124 deps += [ "//third_party/android_tools:cpu_features" ] |
| 125 } | 125 } |
| 126 | 126 |
| 127 if (is_win) { | |
| 128 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | |
| 129 cflags = [ "/wd4267" ] | |
| 130 } | |
| 131 | |
| 132 if (use_openssl) { | 127 if (use_openssl) { |
| 133 # Remove NSS files when using OpenSSL | 128 # Remove NSS files when using OpenSSL |
| 134 sources -= [ | 129 sources -= [ |
| 135 "ec_private_key_nss.cc", | 130 "ec_private_key_nss.cc", |
| 136 "ec_signature_creator_nss.cc", | 131 "ec_signature_creator_nss.cc", |
| 137 "encryptor_nss.cc", | 132 "encryptor_nss.cc", |
| 138 "hmac_nss.cc", | 133 "hmac_nss.cc", |
| 139 "nss_util.cc", | 134 "nss_util.cc", |
| 140 "nss_util.h", | 135 "nss_util.h", |
| 141 "nss_util_internal.h", | 136 "nss_util_internal.h", |
| (...skipping 24 matching lines...) Expand all Loading... |
| 166 "secure_hash_openssl.cc", | 161 "secure_hash_openssl.cc", |
| 167 "signature_creator_openssl.cc", | 162 "signature_creator_openssl.cc", |
| 168 "signature_verifier_openssl.cc", | 163 "signature_verifier_openssl.cc", |
| 169 "symmetric_key_openssl.cc", | 164 "symmetric_key_openssl.cc", |
| 170 ] | 165 ] |
| 171 } | 166 } |
| 172 | 167 |
| 173 defines = [ "CRYPTO_IMPLEMENTATION" ] | 168 defines = [ "CRYPTO_IMPLEMENTATION" ] |
| 174 } | 169 } |
| 175 | 170 |
| 176 if (is_win) { | 171 # TODO(GYP): TODO(dpranke), fix the compile errors for this stuff |
| 172 # and make it work. |
| 173 if (false && is_win) { |
| 177 # A minimal crypto subset for hmac-related stuff that small standalone | 174 # 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 | 175 # 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. | 176 # OpenSSL/NSS but will use Windows APIs for that functionality. |
| 180 source_set("crypto_minimal_win") { | 177 source_set("crypto_minimal_win") { |
| 181 sources = [ | 178 sources = [ |
| 182 "crypto_export.h", | 179 "crypto_export.h", |
| 183 "hmac.cc", | 180 "hmac.cc", |
| 184 "hmac.h", | 181 "hmac.h", |
| 185 "hmac_win.cc", | 182 "hmac_win.cc", |
| 186 "scoped_capi_types.h", | 183 "scoped_capi_types.h", |
| 187 "scoped_nss_types.h", | 184 "scoped_nss_types.h", |
| 188 "secure_util.cc", | 185 "secure_util.cc", |
| 189 "secure_util.h", | 186 "secure_util.h", |
| 190 "symmetric_key.h", | 187 "symmetric_key.h", |
| 191 "symmetric_key_win.cc", | 188 "symmetric_key_win.cc", |
| 192 "third_party/nss/chromium-blapi.h", | 189 "third_party/nss/chromium-blapi.h", |
| 193 "third_party/nss/chromium-sha256.h", | 190 "third_party/nss/chromium-sha256.h", |
| 194 "third_party/nss/sha512.cc", | 191 "third_party/nss/sha512.cc", |
| 195 ] | 192 ] |
| 196 | 193 |
| 197 deps = [ | 194 deps = [ |
| 198 "//base", | 195 "//base", |
| 199 "//base/third_party/dynamic_annotations", | 196 "//base/third_party/dynamic_annotations", |
| 200 ] | 197 ] |
| 201 | 198 |
| 202 defines = [ "CRYPTO_IMPLEMENTATION" ] | 199 defines = [ "CRYPTO_IMPLEMENTATION" ] |
| 203 } | 200 } |
| 204 } | 201 } |
| 205 | 202 |
| 206 test("crypto_unittests") { | 203 # TODO(GYP): Make this link on win as well. |
| 207 sources = [ | 204 if (!is_win) { |
| 208 # Tests. | 205 test("crypto_unittests") { |
| 209 "curve25519_unittest.cc", | 206 sources = [ |
| 210 "ec_private_key_unittest.cc", | 207 # Tests. |
| 211 "ec_signature_creator_unittest.cc", | 208 "curve25519_unittest.cc", |
| 212 "encryptor_unittest.cc", | 209 "ec_private_key_unittest.cc", |
| 213 "ghash_unittest.cc", | 210 "ec_signature_creator_unittest.cc", |
| 214 "hkdf_unittest.cc", | 211 "encryptor_unittest.cc", |
| 215 "hmac_unittest.cc", | 212 "ghash_unittest.cc", |
| 216 "nss_util_unittest.cc", | 213 "hkdf_unittest.cc", |
| 217 "openssl_bio_string_unittest.cc", | 214 "hmac_unittest.cc", |
| 218 "p224_unittest.cc", | 215 "nss_util_unittest.cc", |
| 219 "p224_spake_unittest.cc", | 216 "openssl_bio_string_unittest.cc", |
| 220 "random_unittest.cc", | 217 "p224_unittest.cc", |
| 221 "rsa_private_key_unittest.cc", | 218 "p224_spake_unittest.cc", |
| 222 "rsa_private_key_nss_unittest.cc", | 219 "random_unittest.cc", |
| 223 "secure_hash_unittest.cc", | 220 "rsa_private_key_unittest.cc", |
| 224 "sha2_unittest.cc", | 221 "rsa_private_key_nss_unittest.cc", |
| 225 "signature_creator_unittest.cc", | 222 "secure_hash_unittest.cc", |
| 226 "signature_verifier_unittest.cc", | 223 "sha2_unittest.cc", |
| 227 "symmetric_key_unittest.cc", | 224 "signature_creator_unittest.cc", |
| 228 ] | 225 "signature_verifier_unittest.cc", |
| 226 "symmetric_key_unittest.cc", |
| 227 ] |
| 229 | 228 |
| 230 if (use_openssl || !is_linux) { | 229 if (use_openssl || !is_linux) { |
| 231 sources -= [ | 230 sources -= [ |
| 232 "rsa_private_key_nss_unittest.cc", | 231 "rsa_private_key_nss_unittest.cc", |
| 232 ] |
| 233 } |
| 234 |
| 235 if (use_openssl) { |
| 236 sources -= [ "nss_util_unittest.cc" ] |
| 237 } else { |
| 238 sources -= [ "openssl_bio_string_unittest.cc" ] |
| 239 } |
| 240 |
| 241 deps = [ |
| 242 ":crypto", |
| 243 ":platform", |
| 244 ":test_support", |
| 245 "//base", |
| 246 "//base/test:run_all_unittests", |
| 247 "//base/test:test_support", |
| 248 "//testing/gmock", |
| 249 "//testing/gtest", |
| 233 ] | 250 ] |
| 234 } | 251 } |
| 235 | |
| 236 if (use_openssl) { | |
| 237 sources -= [ "nss_util_unittest.cc" ] | |
| 238 } else { | |
| 239 sources -= [ "openssl_bio_string_unittest.cc" ] | |
| 240 } | |
| 241 | |
| 242 deps = [ | |
| 243 ":crypto", | |
| 244 ":platform", | |
| 245 ":test_support", | |
| 246 "//base", | |
| 247 "//base/test:run_all_unittests", | |
| 248 "//base/test:test_support", | |
| 249 "//testing/gmock", | |
| 250 "//testing/gtest", | |
| 251 ] | |
| 252 } | 252 } |
| 253 | 253 |
| 254 source_set("test_support") { | 254 source_set("test_support") { |
| 255 sources = [ | 255 sources = [ |
| 256 "scoped_test_nss_db.cc", | 256 "scoped_test_nss_db.cc", |
| 257 "scoped_test_nss_db.h", | 257 "scoped_test_nss_db.h", |
| 258 "scoped_test_nss_chromeos_user.cc", | 258 "scoped_test_nss_chromeos_user.cc", |
| 259 "scoped_test_nss_chromeos_user.h", | 259 "scoped_test_nss_chromeos_user.h", |
| 260 "scoped_test_system_nss_key_slot.cc", | 260 "scoped_test_system_nss_key_slot.cc", |
| 261 "scoped_test_system_nss_key_slot.h", | 261 "scoped_test_system_nss_key_slot.h", |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 ] | 307 ] |
| 308 } else { | 308 } else { |
| 309 # Non-Linux platforms use the hermetic NSS from the tree. | 309 # Non-Linux platforms use the hermetic NSS from the tree. |
| 310 deps += [ | 310 deps += [ |
| 311 "//third_party/nss:nspr", | 311 "//third_party/nss:nspr", |
| 312 "//third_party/nss:nss", | 312 "//third_party/nss:nss", |
| 313 ] | 313 ] |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 } | 316 } |
| OLD | NEW |