1# Copyright (c) 2011 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. 4 5{ 6 'variables': { 7 'chromium_code': 1, 8 }, 9 'targets': [ 10 { 11 'target_name': 'crypto', 12 'product_name': 'crcrypto', # Avoid colliding with OpenSSL's libcrypto 13 'type': '<(library)', 14 'dependencies': [ 15 '../base/base.gyp:base', 16 ], 17 'msvs_disabled_warnings': [ 18 4018, 19 ], 20 'conditions': [ 21 [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', { 22 'conditions': [ 23 [ 'chromeos==1', { 24 'sources/': [ ['include', '_chromeos\\.cc$'] ] 25 }, 26 ], 27 [ 'use_openssl==1', { 28 'dependencies': [ 29 '../third_party/openssl/openssl.gyp:openssl', 30 ], 31 }, { # use_openssl==0 32 'dependencies': [ 33 '../build/linux/system.gyp:nss', 34 ], 35 'export_dependent_settings': [ 36 '../build/linux/system.gyp:nss', 37 ], 38 } 39 ], 40 ], 41 }, { # OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris" 42 'sources/': [ 43 ['exclude', '_nss\.cc$'], 44 ], 45 }], 46 [ 'OS == "freebsd" or OS == "openbsd"', { 47 'link_settings': { 48 'libraries': [ 49 '-L/usr/local/lib -lexecinfo', 50 ], 51 }, 52 }, 53 ], 54 [ 'OS == "mac"', { 55 'link_settings': { 56 'libraries': [ 57 '$(SDKROOT)/System/Library/Frameworks/Security.framework', 58 ], 59 }, 60 }, { # OS != "mac" 61 'sources!': [ 62 'cssm_init.cc', 63 'cssm_init.h', 64 'mac_security_services_lock.cc', 65 'mac_security_services_lock.h', 66 ], 67 }], 68 [ 'OS == "mac" or OS == "win"', { 69 'dependencies': [ 70 '../third_party/nss/nss.gyp:nss', 71 ], 72 },], 73 [ 'OS != "win"', { 74 'sources!': [ 75 'capi_util.h', 76 'capi_util.cc', 77 ], 78 },], 79 [ 'use_openssl==1', { 80 # TODO(joth): Use a glob to match exclude patterns once the 81 # OpenSSL file set is complete. 82 'sources!': [ 83 'encryptor_nss.cc', 84 'hmac_nss.cc', 85 'nss_util.cc', 86 'nss_util.h', 87 'rsa_private_key_nss.cc', 88 'secure_hash_default.cc', 89 'signature_creator_nss.cc', 90 'signature_verifier_nss.cc', 91 'symmetric_key_nss.cc', 92 'third_party/nss/blapi.h', 93 'third_party/nss/blapit.h', 94 'third_party/nss/sha256.h', 95 'third_party/nss/sha512.cc', 96 ], 97 }, { 98 'sources!': [ 99 'encryptor_openssl.cc', 100 'hmac_openssl.cc', 101 'openssl_util.cc', 102 'openssl_util.h', 103 'rsa_private_key_openssl.cc', 104 'secure_hash_openssl.cc', 105 'signature_creator_openssl.cc', 106 'signature_verifier_openssl.cc', 107 'symmetric_key_openssl.cc', 108 ], 109 },], 110 ], 111 'sources': [ 112 'capi_util.cc', 113 'capi_util.h', 114 'crypto_module_blocking_password_delegate.h', 115 'cssm_init.cc', 116 'cssm_init.h', 117 'encryptor.h', 118 'encryptor_mac.cc', 119 'encryptor_nss.cc', 120 'encryptor_openssl.cc', 121 'encryptor_win.cc', 122 'hmac.h', 123 'hmac_mac.cc', 124 'hmac_nss.cc', 125 'hmac_openssl.cc', 126 'hmac_win.cc', 127 'mac_security_services_lock.cc', 128 'mac_security_services_lock.h', 129 'openssl_util.cc', 130 'openssl_util.h', 131 'nss_util.cc', 132 'nss_util.h', 133 'nss_util_internal.h', 134 'rsa_private_key.h', 135 'rsa_private_key.cc', 136 'rsa_private_key_mac.cc', 137 'rsa_private_key_nss.cc', 138 'rsa_private_key_openssl.cc', 139 'rsa_private_key_win.cc', 140 'scoped_capi_types.h', 141 'scoped_nss_types.h', 142 'secure_hash.h', 143 'secure_hash_default.cc', 144 'secure_hash_openssl.cc', 145 'sha2.cc', 146 'sha2.h', 147 'signature_creator.h', 148 'signature_creator_mac.cc', 149 'signature_creator_nss.cc', 150 'signature_creator_openssl.cc', 151 'signature_creator_win.cc', 152 'signature_verifier.h', 153 'signature_verifier_mac.cc', 154 'signature_verifier_nss.cc', 155 'signature_verifier_openssl.cc', 156 'signature_verifier_win.cc', 157 'symmetric_key.h', 158 'symmetric_key_mac.cc', 159 'symmetric_key_nss.cc', 160 'symmetric_key_openssl.cc', 161 'symmetric_key_win.cc', 162 'third_party/nss/blapi.h', 163 'third_party/nss/blapit.h', 164 'third_party/nss/sha256.h', 165 'third_party/nss/sha512.cc', 166 ], 167 }, 168 { 169 'target_name': 'crypto_unittests', 170 'type': 'executable', 171 'sources': [ 172 # Infrastructure files. 173 'run_all_unittests.cc', 174 175 # Tests. 176 'encryptor_unittest.cc', 177 'hmac_unittest.cc', 178 'rsa_private_key_unittest.cc', 179 'rsa_private_key_nss_unittest.cc', 180 'secure_hash_unittest.cc', 181 'sha2_unittest.cc', 182 'signature_creator_unittest.cc', 183 'signature_verifier_unittest.cc', 184 'symmetric_key_unittest.cc', 185 ], 186 'dependencies': [ 187 'crypto', 188 '../base/base.gyp:base', 189 '../base/base.gyp:test_support_base', 190 '../testing/gmock.gyp:gmock', 191 '../testing/gtest.gyp:gtest', 192 ], 193 'conditions': [ 194 [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', { 195 'conditions': [ 196 [ 'linux_use_tcmalloc==1', { 197 'dependencies': [ 198 '../base/allocator/allocator.gyp:allocator', 199 ], 200 }, 201 ], 202 ], 203 'dependencies': [ 204 '../build/linux/system.gyp:nss', 205 ], 206 }, { # OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris" 207 'sources!': [ 208 'rsa_private_key_nss_unittest.cc', 209 ] 210 }], 211 [ 'OS == "mac" or OS == "win"', { 212 'dependencies': [ 213 '../third_party/nss/nss.gyp:nss', 214 ], 215 }], 216 [ 'use_openssl==1', { 217 'sources!': [ 218 'rsa_private_key_nss_unittest.cc', 219 ], 220 }], 221 ], 222 }, 223 ], 224} 225