blob: c8bbf21199fa7dd4f7147c7466c6fe4ceb28cedb [file] [log] [blame]
Brian Silverman7d89e282021-11-17 17:36:54 -08001# Copyright 2018 The Bazel Authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15package(default_visibility = ["//visibility:public"])
16
17COPTS = [
18 "-DL_ENDIAN",
19 "-DOPENSSL_PIC",
20 "-DOPENSSL_CPUID_OBJ",
21 "-DOPENSSL_IA32_SSE2",
22 "-DOPENSSL_BN_ASM_MONT",
23 "-DOPENSSL_BN_ASM_MONT5",
24 "-DOPENSSL_BN_ASM_GF2m",
25 "-DSHA1_ASM",
26 "-DSHA256_ASM",
27 "-DSHA512_ASM",
28 "-DKECCAK1600_ASM",
29 "-DRC4_ASM",
30 "-DMD5_ASM",
31 "-DAES_ASM",
32 "-DVPAES_ASM",
33 "-DBSAES_ASM",
34 "-DGHASH_ASM",
35 "-DECP_NISTZ256_ASM",
36 "-DX25519_ASM",
37 "-DPOLY1305_ASM",
38 "-DOPENSSLDIR=\\\"/usr/local/ssl\\\"",
39 "-DENGINESDIR=\\\"/usr/local/lib/engines-1.1\\\"",
40 "-D_REENTRANT",
41 "-DNDEBUG",
42 "-Wno-unused-command-line-argument",
43]
44
45CONF_FILES = [
46 "crypto/include/internal/bn_conf.h",
47 "crypto/include/internal/dso_conf.h",
48 "include/openssl/opensslconf.h",
49]
50
51genrule(
52 name = "configure",
53 srcs = [("@com_grail_bazel_toolchain//tests/openssl:" + f) for f in CONF_FILES],
54 outs = CONF_FILES,
55 cmd = "\n".join([
56 "cp $(location @com_grail_bazel_toolchain//tests/openssl:{0}) $(location {0})".format(f)
57 for f in CONF_FILES
58 ]),
59 visibility = ["//visibility:private"],
60)
61
62HDRS = glob(["include/**/*.h"]) + ["include/openssl/opensslconf.h"]
63
64genrule(
65 name = "gen-buildinf_h",
66 srcs = ["util/mkbuildinf.pl"],
67 outs = ["crypto/buildinf.h"],
68 cmd = "perl $(location util/mkbuildinf.pl) 'dummy' 'dummy' > $(location crypto/buildinf.h)",
69)
70
71genrule(
72 name = "gen-asm",
73 srcs = [
74 "crypto/aes/asm/aes-x86_64.pl",
75 "crypto/aes/asm/aesni-mb-x86_64.pl",
76 "crypto/aes/asm/aesni-sha1-x86_64.pl",
77 "crypto/aes/asm/aesni-sha256-x86_64.pl",
78 "crypto/aes/asm/aesni-x86_64.pl",
79 "crypto/aes/asm/bsaes-x86_64.pl",
80 "crypto/aes/asm/vpaes-x86_64.pl",
81 "crypto/bn/asm/rsaz-avx2.pl",
82 "crypto/bn/asm/rsaz-x86_64.pl",
83 "crypto/bn/asm/x86_64-gf2m.pl",
84 "crypto/bn/asm/x86_64-mont.pl",
85 "crypto/bn/asm/x86_64-mont5.pl",
86 "crypto/camellia/asm/cmll-x86_64.pl",
87 "crypto/chacha/asm/chacha-x86_64.pl",
88 "crypto/ec/ecp_nistz256_table.c",
89 "crypto/ec/asm/ecp_nistz256-x86_64.pl",
90 "crypto/ec/asm/x25519-x86_64.pl",
91 "crypto/md5/asm/md5-x86_64.pl",
92 "crypto/modes/asm/aesni-gcm-x86_64.pl",
93 "crypto/modes/asm/ghash-x86_64.pl",
94 "crypto/perlasm/x86_64-xlate.pl",
95 "crypto/poly1305/asm/poly1305-x86_64.pl",
96 "crypto/rc4/asm/rc4-md5-x86_64.pl",
97 "crypto/rc4/asm/rc4-x86_64.pl",
98 "crypto/sha/asm/keccak1600-x86_64.pl",
99 "crypto/sha/asm/sha1-mb-x86_64.pl",
100 "crypto/sha/asm/sha1-x86_64.pl",
101 "crypto/sha/asm/sha256-mb-x86_64.pl",
102 "crypto/sha/asm/sha512-x86_64.pl",
103 "crypto/whrlpool/asm/wp-x86_64.pl",
104 "crypto/x86_64cpuid.pl",
105 "engines/asm/e_padlock-x86_64.pl",
106 ],
107 outs = [
108 "crypto/aes/aes-x86_64.s",
109 "crypto/aes/aesni-mb-x86_64.s",
110 "crypto/aes/aesni-sha1-x86_64.s",
111 "crypto/aes/aesni-sha256-x86_64.s",
112 "crypto/aes/aesni-x86_64.s",
113 "crypto/aes/bsaes-x86_64.s",
114 "crypto/aes/vpaes-x86_64.s",
115 "crypto/bn/rsaz-avx2.s",
116 "crypto/bn/rsaz-x86_64.s",
117 "crypto/bn/x86_64-gf2m.s",
118 "crypto/bn/x86_64-mont.s",
119 "crypto/bn/x86_64-mont5.s",
120 "crypto/camellia/cmll-x86_64.s",
121 "crypto/chacha/chacha-x86_64.s",
122 "crypto/ec/ecp_nistz256-x86_64.s",
123 "crypto/ec/x25519-x86_64.s",
124 "crypto/md5/md5-x86_64.s",
125 "crypto/modes/aesni-gcm-x86_64.s",
126 "crypto/modes/ghash-x86_64.s",
127 "crypto/poly1305/poly1305-x86_64.s",
128 "crypto/rc4/rc4-md5-x86_64.s",
129 "crypto/rc4/rc4-x86_64.s",
130 "crypto/sha/keccak1600-x86_64.s",
131 "crypto/sha/sha1-mb-x86_64.s",
132 "crypto/sha/sha1-x86_64.s",
133 "crypto/sha/sha256-mb-x86_64.s",
134 "crypto/sha/sha256-x86_64.s",
135 "crypto/sha/sha512-x86_64.s",
136 "crypto/whrlpool/wp-x86_64.s",
137 "crypto/x86_64cpuid.s",
138 "engines/e_padlock-x86_64.s",
139 ],
140 cmd = "\n".join([
141 "FLAVOR='elf'",
142 "if [[ $$(uname -s) == 'Darwin' ]]; then FLAVOR='macosx'; fi",
143 "perl $(location crypto/aes/asm/aes-x86_64.pl) $$FLAVOR $(location crypto/aes/aes-x86_64.s)",
144 "perl $(location crypto/aes/asm/aesni-mb-x86_64.pl) $$FLAVOR $(location crypto/aes/aesni-mb-x86_64.s)",
145 "perl $(location crypto/aes/asm/aesni-sha1-x86_64.pl) $$FLAVOR $(location crypto/aes/aesni-sha1-x86_64.s)",
146 "perl $(location crypto/aes/asm/aesni-sha256-x86_64.pl) $$FLAVOR $(location crypto/aes/aesni-sha256-x86_64.s)",
147 "perl $(location crypto/aes/asm/aesni-x86_64.pl) $$FLAVOR $(location crypto/aes/aesni-x86_64.s)",
148 "perl $(location crypto/aes/asm/bsaes-x86_64.pl) $$FLAVOR $(location crypto/aes/bsaes-x86_64.s)",
149 "perl $(location crypto/aes/asm/vpaes-x86_64.pl) $$FLAVOR $(location crypto/aes/vpaes-x86_64.s)",
150 "perl $(location crypto/bn/asm/rsaz-avx2.pl) $$FLAVOR $(location crypto/bn/rsaz-avx2.s)",
151 "perl $(location crypto/bn/asm/rsaz-x86_64.pl) $$FLAVOR $(location crypto/bn/rsaz-x86_64.s)",
152 "perl $(location crypto/bn/asm/x86_64-gf2m.pl) $$FLAVOR $(location crypto/bn/x86_64-gf2m.s)",
153 "perl $(location crypto/bn/asm/x86_64-mont.pl) $$FLAVOR $(location crypto/bn/x86_64-mont.s)",
154 "perl $(location crypto/bn/asm/x86_64-mont5.pl) $$FLAVOR $(location crypto/bn/x86_64-mont5.s)",
155 "perl $(location crypto/camellia/asm/cmll-x86_64.pl) $$FLAVOR $(location crypto/camellia/cmll-x86_64.s)",
156 "perl $(location crypto/chacha/asm/chacha-x86_64.pl) $$FLAVOR $(location crypto/chacha/chacha-x86_64.s)",
157 "perl $(location crypto/ec/asm/ecp_nistz256-x86_64.pl) $$FLAVOR $(location crypto/ec/ecp_nistz256-x86_64.s)",
158 "perl $(location crypto/ec/asm/x25519-x86_64.pl) $$FLAVOR $(location crypto/ec/x25519-x86_64.s)",
159 "perl $(location crypto/md5/asm/md5-x86_64.pl) $$FLAVOR $(location crypto/md5/md5-x86_64.s)",
160 "perl $(location crypto/modes/asm/aesni-gcm-x86_64.pl) $$FLAVOR $(location crypto/modes/aesni-gcm-x86_64.s)",
161 "perl $(location crypto/modes/asm/ghash-x86_64.pl) $$FLAVOR $(location crypto/modes/ghash-x86_64.s)",
162 "perl $(location crypto/poly1305/asm/poly1305-x86_64.pl) $$FLAVOR $(location crypto/poly1305/poly1305-x86_64.s)",
163 "perl $(location crypto/rc4/asm/rc4-md5-x86_64.pl) $$FLAVOR $(location crypto/rc4/rc4-md5-x86_64.s)",
164 "perl $(location crypto/rc4/asm/rc4-x86_64.pl) $$FLAVOR $(location crypto/rc4/rc4-x86_64.s)",
165 "perl $(location crypto/sha/asm/keccak1600-x86_64.pl) $$FLAVOR $(location crypto/sha/keccak1600-x86_64.s)",
166 "perl $(location crypto/sha/asm/sha1-mb-x86_64.pl) $$FLAVOR $(location crypto/sha/sha1-mb-x86_64.s)",
167 "perl $(location crypto/sha/asm/sha1-x86_64.pl) $$FLAVOR $(location crypto/sha/sha1-x86_64.s)",
168 "perl $(location crypto/sha/asm/sha256-mb-x86_64.pl) $$FLAVOR $(location crypto/sha/sha256-mb-x86_64.s)",
169 "perl $(location crypto/sha/asm/sha512-x86_64.pl) $$FLAVOR $(location crypto/sha/sha256-x86_64.s)",
170 "perl $(location crypto/sha/asm/sha512-x86_64.pl) $$FLAVOR $(location crypto/sha/sha512-x86_64.s)",
171 "perl $(location crypto/whrlpool/asm/wp-x86_64.pl) $$FLAVOR $(location crypto/whrlpool/wp-x86_64.s)",
172 "perl $(location crypto/x86_64cpuid.pl) $$FLAVOR $(location crypto/x86_64cpuid.s)",
173 "perl $(location engines/asm/e_padlock-x86_64.pl) $$FLAVOR $(location engines/e_padlock-x86_64.s)",
174 ]),
175)
176
177cc_library(
178 name = "libcrypto",
179 srcs = [
180 "crypto/aes/aes-x86_64.s",
181 "crypto/aes/aes_cfb.c",
182 "crypto/aes/aes_ecb.c",
183 "crypto/aes/aes_ige.c",
184 "crypto/aes/aes_misc.c",
185 "crypto/aes/aes_ofb.c",
186 "crypto/aes/aes_wrap.c",
187 "crypto/aes/aesni-mb-x86_64.s",
188 "crypto/aes/aesni-sha1-x86_64.s",
189 "crypto/aes/aesni-sha256-x86_64.s",
190 "crypto/aes/aesni-x86_64.s",
191 "crypto/aes/bsaes-x86_64.s",
192 "crypto/aes/vpaes-x86_64.s",
193 "crypto/aria/aria.c",
194 "crypto/asn1/a_bitstr.c",
195 "crypto/asn1/a_d2i_fp.c",
196 "crypto/asn1/a_digest.c",
197 "crypto/asn1/a_dup.c",
198 "crypto/asn1/a_gentm.c",
199 "crypto/asn1/a_i2d_fp.c",
200 "crypto/asn1/a_int.c",
201 "crypto/asn1/a_mbstr.c",
202 "crypto/asn1/a_object.c",
203 "crypto/asn1/a_octet.c",
204 "crypto/asn1/a_print.c",
205 "crypto/asn1/a_sign.c",
206 "crypto/asn1/a_strex.c",
207 "crypto/asn1/a_strnid.c",
208 "crypto/asn1/a_time.c",
209 "crypto/asn1/a_type.c",
210 "crypto/asn1/a_utctm.c",
211 "crypto/asn1/a_utf8.c",
212 "crypto/asn1/a_verify.c",
213 "crypto/asn1/ameth_lib.c",
214 "crypto/asn1/asn1_err.c",
215 "crypto/asn1/asn1_gen.c",
216 "crypto/asn1/asn1_item_list.c",
217 "crypto/asn1/asn1_lib.c",
218 "crypto/asn1/asn1_par.c",
219 "crypto/asn1/asn_mime.c",
220 "crypto/asn1/asn_moid.c",
221 "crypto/asn1/asn_mstbl.c",
222 "crypto/asn1/asn_pack.c",
223 "crypto/asn1/bio_asn1.c",
224 "crypto/asn1/bio_ndef.c",
225 "crypto/asn1/d2i_pr.c",
226 "crypto/asn1/d2i_pu.c",
227 "crypto/asn1/evp_asn1.c",
228 "crypto/asn1/f_int.c",
229 "crypto/asn1/f_string.c",
230 "crypto/asn1/i2d_pr.c",
231 "crypto/asn1/i2d_pu.c",
232 "crypto/asn1/n_pkey.c",
233 "crypto/asn1/nsseq.c",
234 "crypto/asn1/p5_pbe.c",
235 "crypto/asn1/p5_pbev2.c",
236 "crypto/asn1/p5_scrypt.c",
237 "crypto/asn1/p8_pkey.c",
238 "crypto/asn1/t_bitst.c",
239 "crypto/asn1/t_pkey.c",
240 "crypto/asn1/t_spki.c",
241 "crypto/asn1/tasn_dec.c",
242 "crypto/asn1/tasn_enc.c",
243 "crypto/asn1/tasn_fre.c",
244 "crypto/asn1/tasn_new.c",
245 "crypto/asn1/tasn_prn.c",
246 "crypto/asn1/tasn_scn.c",
247 "crypto/asn1/tasn_typ.c",
248 "crypto/asn1/tasn_utl.c",
249 "crypto/asn1/x_algor.c",
250 "crypto/asn1/x_bignum.c",
251 "crypto/asn1/x_info.c",
252 "crypto/asn1/x_int64.c",
253 "crypto/asn1/x_long.c",
254 "crypto/asn1/x_pkey.c",
255 "crypto/asn1/x_sig.c",
256 "crypto/asn1/x_spki.c",
257 "crypto/asn1/x_val.c",
258 "crypto/async/arch/async_null.c",
259 "crypto/async/arch/async_posix.c",
260 "crypto/async/arch/async_win.c",
261 "crypto/async/async.c",
262 "crypto/async/async_err.c",
263 "crypto/async/async_wait.c",
264 "crypto/bf/bf_cfb64.c",
265 "crypto/bf/bf_ecb.c",
266 "crypto/bf/bf_enc.c",
267 "crypto/bf/bf_ofb64.c",
268 "crypto/bf/bf_skey.c",
269 "crypto/bio/b_addr.c",
270 "crypto/bio/b_dump.c",
271 "crypto/bio/b_print.c",
272 "crypto/bio/b_sock.c",
273 "crypto/bio/b_sock2.c",
274 "crypto/bio/bf_buff.c",
275 "crypto/bio/bf_lbuf.c",
276 "crypto/bio/bf_nbio.c",
277 "crypto/bio/bf_null.c",
278 "crypto/bio/bio_cb.c",
279 "crypto/bio/bio_err.c",
280 "crypto/bio/bio_lib.c",
281 "crypto/bio/bio_meth.c",
282 "crypto/bio/bss_acpt.c",
283 "crypto/bio/bss_bio.c",
284 "crypto/bio/bss_conn.c",
285 "crypto/bio/bss_dgram.c",
286 "crypto/bio/bss_fd.c",
287 "crypto/bio/bss_file.c",
288 "crypto/bio/bss_log.c",
289 "crypto/bio/bss_mem.c",
290 "crypto/bio/bss_null.c",
291 "crypto/bio/bss_sock.c",
292 "crypto/blake2/blake2b.c",
293 "crypto/blake2/blake2s.c",
294 "crypto/blake2/m_blake2b.c",
295 "crypto/blake2/m_blake2s.c",
296 "crypto/bn/asm/x86_64-gcc.c",
297 "crypto/bn/bn_add.c",
298 "crypto/bn/bn_blind.c",
299 "crypto/bn/bn_const.c",
300 "crypto/bn/bn_ctx.c",
301 "crypto/bn/bn_depr.c",
302 "crypto/bn/bn_dh.c",
303 "crypto/bn/bn_div.c",
304 "crypto/bn/bn_err.c",
305 "crypto/bn/bn_exp.c",
306 "crypto/bn/bn_exp2.c",
307 "crypto/bn/bn_gcd.c",
308 "crypto/bn/bn_gf2m.c",
309 "crypto/bn/bn_intern.c",
310 "crypto/bn/bn_kron.c",
311 "crypto/bn/bn_lib.c",
312 "crypto/bn/bn_mod.c",
313 "crypto/bn/bn_mont.c",
314 "crypto/bn/bn_mpi.c",
315 "crypto/bn/bn_mul.c",
316 "crypto/bn/bn_nist.c",
317 "crypto/bn/bn_prime.c",
318 "crypto/bn/bn_print.c",
319 "crypto/bn/bn_rand.c",
320 "crypto/bn/bn_recp.c",
321 "crypto/bn/bn_shift.c",
322 "crypto/bn/bn_sqr.c",
323 "crypto/bn/bn_sqrt.c",
324 "crypto/bn/bn_srp.c",
325 "crypto/bn/bn_word.c",
326 "crypto/bn/bn_x931p.c",
327 "crypto/bn/rsaz-avx2.s",
328 "crypto/bn/rsaz-x86_64.s",
329 "crypto/bn/rsaz_exp.c",
330 "crypto/bn/x86_64-gf2m.s",
331 "crypto/bn/x86_64-mont.s",
332 "crypto/bn/x86_64-mont5.s",
333 "crypto/buffer/buf_err.c",
334 "crypto/buffer/buffer.c",
335 "crypto/camellia/cmll-x86_64.s",
336 "crypto/camellia/cmll_cfb.c",
337 "crypto/camellia/cmll_ctr.c",
338 "crypto/camellia/cmll_ecb.c",
339 "crypto/camellia/cmll_misc.c",
340 "crypto/camellia/cmll_ofb.c",
341 "crypto/cast/c_cfb64.c",
342 "crypto/cast/c_ecb.c",
343 "crypto/cast/c_enc.c",
344 "crypto/cast/c_ofb64.c",
345 "crypto/cast/c_skey.c",
346 "crypto/chacha/chacha-x86_64.s",
347 "crypto/cmac/cm_ameth.c",
348 "crypto/cmac/cm_pmeth.c",
349 "crypto/cmac/cmac.c",
350 "crypto/cms/cms_asn1.c",
351 "crypto/cms/cms_att.c",
352 "crypto/cms/cms_cd.c",
353 "crypto/cms/cms_dd.c",
354 "crypto/cms/cms_enc.c",
355 "crypto/cms/cms_env.c",
356 "crypto/cms/cms_err.c",
357 "crypto/cms/cms_ess.c",
358 "crypto/cms/cms_io.c",
359 "crypto/cms/cms_kari.c",
360 "crypto/cms/cms_lib.c",
361 "crypto/cms/cms_pwri.c",
362 "crypto/cms/cms_sd.c",
363 "crypto/cms/cms_smime.c",
364 "crypto/comp/c_zlib.c",
365 "crypto/comp/comp_err.c",
366 "crypto/comp/comp_lib.c",
367 "crypto/conf/conf_api.c",
368 "crypto/conf/conf_def.c",
369 "crypto/conf/conf_err.c",
370 "crypto/conf/conf_lib.c",
371 "crypto/conf/conf_mall.c",
372 "crypto/conf/conf_mod.c",
373 "crypto/conf/conf_sap.c",
374 "crypto/conf/conf_ssl.c",
375 "crypto/cpt_err.c",
376 "crypto/cryptlib.c",
377 "crypto/ct/ct_b64.c",
378 "crypto/ct/ct_err.c",
379 "crypto/ct/ct_log.c",
380 "crypto/ct/ct_oct.c",
381 "crypto/ct/ct_policy.c",
382 "crypto/ct/ct_prn.c",
383 "crypto/ct/ct_sct.c",
384 "crypto/ct/ct_sct_ctx.c",
385 "crypto/ct/ct_vfy.c",
386 "crypto/ct/ct_x509v3.c",
387 "crypto/ctype.c",
388 "crypto/cversion.c",
389 "crypto/des/cbc_cksm.c",
390 "crypto/des/cbc_enc.c",
391 "crypto/des/cfb64ede.c",
392 "crypto/des/cfb64enc.c",
393 "crypto/des/cfb_enc.c",
394 "crypto/des/des_enc.c",
395 "crypto/des/ecb3_enc.c",
396 "crypto/des/ecb_enc.c",
397 "crypto/des/fcrypt.c",
398 "crypto/des/fcrypt_b.c",
399 "crypto/des/ofb64ede.c",
400 "crypto/des/ofb64enc.c",
401 "crypto/des/ofb_enc.c",
402 "crypto/des/pcbc_enc.c",
403 "crypto/des/qud_cksm.c",
404 "crypto/des/rand_key.c",
405 "crypto/des/set_key.c",
406 "crypto/des/str2key.c",
407 "crypto/des/xcbc_enc.c",
408 "crypto/dh/dh_ameth.c",
409 "crypto/dh/dh_asn1.c",
410 "crypto/dh/dh_check.c",
411 "crypto/dh/dh_depr.c",
412 "crypto/dh/dh_err.c",
413 "crypto/dh/dh_gen.c",
414 "crypto/dh/dh_kdf.c",
415 "crypto/dh/dh_key.c",
416 "crypto/dh/dh_lib.c",
417 "crypto/dh/dh_meth.c",
418 "crypto/dh/dh_pmeth.c",
419 "crypto/dh/dh_prn.c",
420 "crypto/dh/dh_rfc5114.c",
421 "crypto/dh/dh_rfc7919.c",
422 "crypto/dsa/dsa_ameth.c",
423 "crypto/dsa/dsa_asn1.c",
424 "crypto/dsa/dsa_depr.c",
425 "crypto/dsa/dsa_err.c",
426 "crypto/dsa/dsa_gen.c",
427 "crypto/dsa/dsa_key.c",
428 "crypto/dsa/dsa_lib.c",
429 "crypto/dsa/dsa_meth.c",
430 "crypto/dsa/dsa_ossl.c",
431 "crypto/dsa/dsa_pmeth.c",
432 "crypto/dsa/dsa_prn.c",
433 "crypto/dsa/dsa_sign.c",
434 "crypto/dsa/dsa_vrf.c",
435 "crypto/dso/dso_dl.c",
436 "crypto/dso/dso_dlfcn.c",
437 "crypto/dso/dso_err.c",
438 "crypto/dso/dso_lib.c",
439 "crypto/dso/dso_openssl.c",
440 "crypto/dso/dso_vms.c",
441 "crypto/dso/dso_win32.c",
442 "crypto/ebcdic.c",
443 "crypto/ec/curve25519.c",
444 "crypto/ec/curve448/arch_32/f_impl.c",
445 "crypto/ec/curve448/curve448.c",
446 "crypto/ec/curve448/curve448_tables.c",
447 "crypto/ec/curve448/eddsa.c",
448 "crypto/ec/curve448/f_generic.c",
449 "crypto/ec/curve448/scalar.c",
450 "crypto/ec/ec2_oct.c",
451 "crypto/ec/ec2_smpl.c",
452 "crypto/ec/ec_ameth.c",
453 "crypto/ec/ec_asn1.c",
454 "crypto/ec/ec_check.c",
455 "crypto/ec/ec_curve.c",
456 "crypto/ec/ec_cvt.c",
457 "crypto/ec/ec_err.c",
458 "crypto/ec/ec_key.c",
459 "crypto/ec/ec_kmeth.c",
460 "crypto/ec/ec_lib.c",
461 "crypto/ec/ec_mult.c",
462 "crypto/ec/ec_oct.c",
463 "crypto/ec/ec_pmeth.c",
464 "crypto/ec/ec_print.c",
465 "crypto/ec/ecdh_kdf.c",
466 "crypto/ec/ecdh_ossl.c",
467 "crypto/ec/ecdsa_ossl.c",
468 "crypto/ec/ecdsa_sign.c",
469 "crypto/ec/ecdsa_vrf.c",
470 "crypto/ec/eck_prn.c",
471 "crypto/ec/ecp_mont.c",
472 "crypto/ec/ecp_nist.c",
473 "crypto/ec/ecp_nistp224.c",
474 "crypto/ec/ecp_nistp256.c",
475 "crypto/ec/ecp_nistp521.c",
476 "crypto/ec/ecp_nistputil.c",
477 "crypto/ec/ecp_nistz256-x86_64.s",
478 "crypto/ec/ecp_nistz256.c",
479 "crypto/ec/ecp_oct.c",
480 "crypto/ec/ecp_smpl.c",
481 "crypto/ec/ecx_meth.c",
482 "crypto/ec/x25519-x86_64.s",
483 "crypto/engine/eng_all.c",
484 "crypto/engine/eng_cnf.c",
485 "crypto/engine/eng_ctrl.c",
486 "crypto/engine/eng_dyn.c",
487 "crypto/engine/eng_err.c",
488 "crypto/engine/eng_fat.c",
489 "crypto/engine/eng_init.c",
490 "crypto/engine/eng_lib.c",
491 "crypto/engine/eng_list.c",
492 "crypto/engine/eng_openssl.c",
493 "crypto/engine/eng_pkey.c",
494 "crypto/engine/eng_rdrand.c",
495 "crypto/engine/eng_table.c",
496 "crypto/engine/tb_asnmth.c",
497 "crypto/engine/tb_cipher.c",
498 "crypto/engine/tb_dh.c",
499 "crypto/engine/tb_digest.c",
500 "crypto/engine/tb_dsa.c",
501 "crypto/engine/tb_eckey.c",
502 "crypto/engine/tb_pkmeth.c",
503 "crypto/engine/tb_rand.c",
504 "crypto/engine/tb_rsa.c",
505 "crypto/err/err.c",
506 "crypto/err/err_all.c",
507 "crypto/err/err_prn.c",
508 "crypto/evp/bio_b64.c",
509 "crypto/evp/bio_enc.c",
510 "crypto/evp/bio_md.c",
511 "crypto/evp/bio_ok.c",
512 "crypto/evp/c_allc.c",
513 "crypto/evp/c_alld.c",
514 "crypto/evp/cmeth_lib.c",
515 "crypto/evp/digest.c",
516 "crypto/evp/e_aes.c",
517 "crypto/evp/e_aes_cbc_hmac_sha1.c",
518 "crypto/evp/e_aes_cbc_hmac_sha256.c",
519 "crypto/evp/e_aria.c",
520 "crypto/evp/e_bf.c",
521 "crypto/evp/e_camellia.c",
522 "crypto/evp/e_cast.c",
523 "crypto/evp/e_chacha20_poly1305.c",
524 "crypto/evp/e_des.c",
525 "crypto/evp/e_des3.c",
526 "crypto/evp/e_idea.c",
527 "crypto/evp/e_null.c",
528 "crypto/evp/e_old.c",
529 "crypto/evp/e_rc2.c",
530 "crypto/evp/e_rc4.c",
531 "crypto/evp/e_rc4_hmac_md5.c",
532 "crypto/evp/e_rc5.c",
533 "crypto/evp/e_seed.c",
534 "crypto/evp/e_sm4.c",
535 "crypto/evp/e_xcbc_d.c",
536 "crypto/evp/encode.c",
537 "crypto/evp/evp_cnf.c",
538 "crypto/evp/evp_enc.c",
539 "crypto/evp/evp_err.c",
540 "crypto/evp/evp_key.c",
541 "crypto/evp/evp_lib.c",
542 "crypto/evp/evp_pbe.c",
543 "crypto/evp/evp_pkey.c",
544 "crypto/evp/m_md2.c",
545 "crypto/evp/m_md4.c",
546 "crypto/evp/m_md5.c",
547 "crypto/evp/m_md5_sha1.c",
548 "crypto/evp/m_mdc2.c",
549 "crypto/evp/m_null.c",
550 "crypto/evp/m_ripemd.c",
551 "crypto/evp/m_sha1.c",
552 "crypto/evp/m_sha3.c",
553 "crypto/evp/m_sigver.c",
554 "crypto/evp/m_wp.c",
555 "crypto/evp/names.c",
556 "crypto/evp/p5_crpt.c",
557 "crypto/evp/p5_crpt2.c",
558 "crypto/evp/p_dec.c",
559 "crypto/evp/p_enc.c",
560 "crypto/evp/p_lib.c",
561 "crypto/evp/p_open.c",
562 "crypto/evp/p_seal.c",
563 "crypto/evp/p_sign.c",
564 "crypto/evp/p_verify.c",
565 "crypto/evp/pbe_scrypt.c",
566 "crypto/evp/pmeth_fn.c",
567 "crypto/evp/pmeth_gn.c",
568 "crypto/evp/pmeth_lib.c",
569 "crypto/ex_data.c",
570 "crypto/getenv.c",
571 "crypto/hmac/hm_ameth.c",
572 "crypto/hmac/hm_pmeth.c",
573 "crypto/hmac/hmac.c",
574 "crypto/idea/i_cbc.c",
575 "crypto/idea/i_cfb64.c",
576 "crypto/idea/i_ecb.c",
577 "crypto/idea/i_ofb64.c",
578 "crypto/idea/i_skey.c",
579 "crypto/init.c",
580 "crypto/kdf/hkdf.c",
581 "crypto/kdf/kdf_err.c",
582 "crypto/kdf/scrypt.c",
583 "crypto/kdf/tls1_prf.c",
584 "crypto/lhash/lh_stats.c",
585 "crypto/lhash/lhash.c",
586 "crypto/md4/md4_dgst.c",
587 "crypto/md4/md4_one.c",
588 "crypto/md5/md5-x86_64.s",
589 "crypto/md5/md5_dgst.c",
590 "crypto/md5/md5_one.c",
591 "crypto/mdc2/mdc2_one.c",
592 "crypto/mdc2/mdc2dgst.c",
593 "crypto/mem.c",
594 "crypto/mem_dbg.c",
595 "crypto/mem_sec.c",
596 "crypto/modes/aesni-gcm-x86_64.s",
597 "crypto/modes/cbc128.c",
598 "crypto/modes/ccm128.c",
599 "crypto/modes/cfb128.c",
600 "crypto/modes/ctr128.c",
601 "crypto/modes/cts128.c",
602 "crypto/modes/gcm128.c",
603 "crypto/modes/ghash-x86_64.s",
604 "crypto/modes/ocb128.c",
605 "crypto/modes/ofb128.c",
606 "crypto/modes/wrap128.c",
607 "crypto/modes/xts128.c",
608 "crypto/o_dir.c",
609 "crypto/o_fips.c",
610 "crypto/o_fopen.c",
611 "crypto/o_init.c",
612 "crypto/o_str.c",
613 "crypto/o_time.c",
614 "crypto/objects/o_names.c",
615 "crypto/objects/obj_dat.c",
616 "crypto/objects/obj_err.c",
617 "crypto/objects/obj_lib.c",
618 "crypto/objects/obj_xref.c",
619 "crypto/ocsp/ocsp_asn.c",
620 "crypto/ocsp/ocsp_cl.c",
621 "crypto/ocsp/ocsp_err.c",
622 "crypto/ocsp/ocsp_ext.c",
623 "crypto/ocsp/ocsp_ht.c",
624 "crypto/ocsp/ocsp_lib.c",
625 "crypto/ocsp/ocsp_prn.c",
626 "crypto/ocsp/ocsp_srv.c",
627 "crypto/ocsp/ocsp_vfy.c",
628 "crypto/ocsp/v3_ocsp.c",
629 "crypto/pem/pem_all.c",
630 "crypto/pem/pem_err.c",
631 "crypto/pem/pem_info.c",
632 "crypto/pem/pem_lib.c",
633 "crypto/pem/pem_oth.c",
634 "crypto/pem/pem_pk8.c",
635 "crypto/pem/pem_pkey.c",
636 "crypto/pem/pem_sign.c",
637 "crypto/pem/pem_x509.c",
638 "crypto/pem/pem_xaux.c",
639 "crypto/pem/pvkfmt.c",
640 "crypto/pkcs12/p12_add.c",
641 "crypto/pkcs12/p12_asn.c",
642 "crypto/pkcs12/p12_attr.c",
643 "crypto/pkcs12/p12_crpt.c",
644 "crypto/pkcs12/p12_crt.c",
645 "crypto/pkcs12/p12_decr.c",
646 "crypto/pkcs12/p12_init.c",
647 "crypto/pkcs12/p12_key.c",
648 "crypto/pkcs12/p12_kiss.c",
649 "crypto/pkcs12/p12_mutl.c",
650 "crypto/pkcs12/p12_npas.c",
651 "crypto/pkcs12/p12_p8d.c",
652 "crypto/pkcs12/p12_p8e.c",
653 "crypto/pkcs12/p12_sbag.c",
654 "crypto/pkcs12/p12_utl.c",
655 "crypto/pkcs12/pk12err.c",
656 "crypto/pkcs7/bio_pk7.c",
657 "crypto/pkcs7/pk7_asn1.c",
658 "crypto/pkcs7/pk7_attr.c",
659 "crypto/pkcs7/pk7_doit.c",
660 "crypto/pkcs7/pk7_lib.c",
661 "crypto/pkcs7/pk7_mime.c",
662 "crypto/pkcs7/pk7_smime.c",
663 "crypto/pkcs7/pkcs7err.c",
664 "crypto/poly1305/poly1305-x86_64.s",
665 "crypto/poly1305/poly1305.c",
666 "crypto/poly1305/poly1305_ameth.c",
667 "crypto/poly1305/poly1305_pmeth.c",
668 "crypto/rand/drbg_ctr.c",
669 "crypto/rand/drbg_lib.c",
670 "crypto/rand/rand_egd.c",
671 "crypto/rand/rand_err.c",
672 "crypto/rand/rand_lib.c",
673 "crypto/rand/rand_unix.c",
674 "crypto/rand/rand_vms.c",
675 "crypto/rand/rand_win.c",
676 "crypto/rand/randfile.c",
677 "crypto/rc2/rc2_cbc.c",
678 "crypto/rc2/rc2_ecb.c",
679 "crypto/rc2/rc2_skey.c",
680 "crypto/rc2/rc2cfb64.c",
681 "crypto/rc2/rc2ofb64.c",
682 "crypto/rc4/rc4-md5-x86_64.s",
683 "crypto/rc4/rc4-x86_64.s",
684 "crypto/ripemd/rmd_dgst.c",
685 "crypto/ripemd/rmd_one.c",
686 "crypto/rsa/rsa_ameth.c",
687 "crypto/rsa/rsa_asn1.c",
688 "crypto/rsa/rsa_chk.c",
689 "crypto/rsa/rsa_crpt.c",
690 "crypto/rsa/rsa_depr.c",
691 "crypto/rsa/rsa_err.c",
692 "crypto/rsa/rsa_gen.c",
693 "crypto/rsa/rsa_lib.c",
694 "crypto/rsa/rsa_meth.c",
695 "crypto/rsa/rsa_mp.c",
696 "crypto/rsa/rsa_none.c",
697 "crypto/rsa/rsa_oaep.c",
698 "crypto/rsa/rsa_ossl.c",
699 "crypto/rsa/rsa_pk1.c",
700 "crypto/rsa/rsa_pmeth.c",
701 "crypto/rsa/rsa_prn.c",
702 "crypto/rsa/rsa_pss.c",
703 "crypto/rsa/rsa_saos.c",
704 "crypto/rsa/rsa_sign.c",
705 "crypto/rsa/rsa_ssl.c",
706 "crypto/rsa/rsa_x931.c",
707 "crypto/rsa/rsa_x931g.c",
708 "crypto/seed/seed.c",
709 "crypto/seed/seed_cbc.c",
710 "crypto/seed/seed_cfb.c",
711 "crypto/seed/seed_ecb.c",
712 "crypto/seed/seed_ofb.c",
713 "crypto/sha/keccak1600-x86_64.s",
714 "crypto/sha/sha1-mb-x86_64.s",
715 "crypto/sha/sha1-x86_64.s",
716 "crypto/sha/sha1_one.c",
717 "crypto/sha/sha1dgst.c",
718 "crypto/sha/sha256-mb-x86_64.s",
719 "crypto/sha/sha256-x86_64.s",
720 "crypto/sha/sha256.c",
721 "crypto/sha/sha512-x86_64.s",
722 "crypto/sha/sha512.c",
723 "crypto/siphash/siphash.c",
724 "crypto/siphash/siphash_ameth.c",
725 "crypto/siphash/siphash_pmeth.c",
726 "crypto/sm2/sm2_crypt.c",
727 "crypto/sm2/sm2_err.c",
728 "crypto/sm2/sm2_pmeth.c",
729 "crypto/sm2/sm2_sign.c",
730 "crypto/sm3/m_sm3.c",
731 "crypto/sm3/sm3.c",
732 "crypto/sm4/sm4.c",
733 "crypto/srp/srp_lib.c",
734 "crypto/srp/srp_vfy.c",
735 "crypto/stack/stack.c",
736 "crypto/store/loader_file.c",
737 "crypto/store/store_err.c",
738 "crypto/store/store_init.c",
739 "crypto/store/store_lib.c",
740 "crypto/store/store_register.c",
741 "crypto/store/store_strings.c",
742 "crypto/threads_none.c",
743 "crypto/threads_pthread.c",
744 "crypto/threads_win.c",
745 "crypto/ts/ts_asn1.c",
746 "crypto/ts/ts_conf.c",
747 "crypto/ts/ts_err.c",
748 "crypto/ts/ts_lib.c",
749 "crypto/ts/ts_req_print.c",
750 "crypto/ts/ts_req_utils.c",
751 "crypto/ts/ts_rsp_print.c",
752 "crypto/ts/ts_rsp_sign.c",
753 "crypto/ts/ts_rsp_utils.c",
754 "crypto/ts/ts_rsp_verify.c",
755 "crypto/ts/ts_verify_ctx.c",
756 "crypto/txt_db/txt_db.c",
757 "crypto/ui/ui_err.c",
758 "crypto/ui/ui_lib.c",
759 "crypto/ui/ui_null.c",
760 "crypto/ui/ui_openssl.c",
761 "crypto/ui/ui_util.c",
762 "crypto/uid.c",
763 "crypto/whrlpool/wp-x86_64.s",
764 "crypto/whrlpool/wp_dgst.c",
765 "crypto/x509/by_dir.c",
766 "crypto/x509/by_file.c",
767 "crypto/x509/t_crl.c",
768 "crypto/x509/t_req.c",
769 "crypto/x509/t_x509.c",
770 "crypto/x509/x509_att.c",
771 "crypto/x509/x509_cmp.c",
772 "crypto/x509/x509_d2.c",
773 "crypto/x509/x509_def.c",
774 "crypto/x509/x509_err.c",
775 "crypto/x509/x509_ext.c",
776 "crypto/x509/x509_lu.c",
777 "crypto/x509/x509_meth.c",
778 "crypto/x509/x509_obj.c",
779 "crypto/x509/x509_r2x.c",
780 "crypto/x509/x509_req.c",
781 "crypto/x509/x509_set.c",
782 "crypto/x509/x509_trs.c",
783 "crypto/x509/x509_txt.c",
784 "crypto/x509/x509_v3.c",
785 "crypto/x509/x509_vfy.c",
786 "crypto/x509/x509_vpm.c",
787 "crypto/x509/x509cset.c",
788 "crypto/x509/x509name.c",
789 "crypto/x509/x509rset.c",
790 "crypto/x509/x509spki.c",
791 "crypto/x509/x509type.c",
792 "crypto/x509/x_all.c",
793 "crypto/x509/x_attrib.c",
794 "crypto/x509/x_crl.c",
795 "crypto/x509/x_exten.c",
796 "crypto/x509/x_name.c",
797 "crypto/x509/x_pubkey.c",
798 "crypto/x509/x_req.c",
799 "crypto/x509/x_x509.c",
800 "crypto/x509/x_x509a.c",
801 "crypto/x509v3/pcy_cache.c",
802 "crypto/x509v3/pcy_data.c",
803 "crypto/x509v3/pcy_lib.c",
804 "crypto/x509v3/pcy_map.c",
805 "crypto/x509v3/pcy_node.c",
806 "crypto/x509v3/pcy_tree.c",
807 "crypto/x509v3/v3_addr.c",
808 "crypto/x509v3/v3_admis.c",
809 "crypto/x509v3/v3_akey.c",
810 "crypto/x509v3/v3_akeya.c",
811 "crypto/x509v3/v3_alt.c",
812 "crypto/x509v3/v3_asid.c",
813 "crypto/x509v3/v3_bcons.c",
814 "crypto/x509v3/v3_bitst.c",
815 "crypto/x509v3/v3_conf.c",
816 "crypto/x509v3/v3_cpols.c",
817 "crypto/x509v3/v3_crld.c",
818 "crypto/x509v3/v3_enum.c",
819 "crypto/x509v3/v3_extku.c",
820 "crypto/x509v3/v3_genn.c",
821 "crypto/x509v3/v3_ia5.c",
822 "crypto/x509v3/v3_info.c",
823 "crypto/x509v3/v3_int.c",
824 "crypto/x509v3/v3_lib.c",
825 "crypto/x509v3/v3_ncons.c",
826 "crypto/x509v3/v3_pci.c",
827 "crypto/x509v3/v3_pcia.c",
828 "crypto/x509v3/v3_pcons.c",
829 "crypto/x509v3/v3_pku.c",
830 "crypto/x509v3/v3_pmaps.c",
831 "crypto/x509v3/v3_prn.c",
832 "crypto/x509v3/v3_purp.c",
833 "crypto/x509v3/v3_skey.c",
834 "crypto/x509v3/v3_sxnet.c",
835 "crypto/x509v3/v3_tlsf.c",
836 "crypto/x509v3/v3_utl.c",
837 "crypto/x509v3/v3err.c",
838 "crypto/x86_64cpuid.s",
839 ] + CONF_FILES + ["crypto/buildinf.h"] + glob([
840 "*.h",
841 "crypto/**/*.h",
842 "crypto/include/*.h",
843 "include/internal/*.h",
844 ]),
845 hdrs = HDRS + [
846 # These are not independent compile units, but are included in other .c files.
847 "crypto/LPdir_unix.c",
848 "crypto/des/ncbc_enc.c",
849 ],
850 copts = COPTS + [
851 "-isystem external/openssl",
852 "-iquote external/openssl/crypto",
853 "-iquote external/openssl/crypto/include",
854 "-iquote external/openssl/crypto/modes",
855 "-iquote external/openssl/crypto/ec/curve448",
856 "-iquote external/openssl/crypto/ec/curve448/arch_32",
857 "-iquote $(GENDIR)/external/openssl/crypto",
858 "-iquote $(GENDIR)/external/openssl/crypto/include",
859 ],
860 includes = ["include"],
861)
862
863cc_library(
864 name = "libssl",
865 srcs = [
866 "ssl/bio_ssl.c",
867 "ssl/d1_lib.c",
868 "ssl/d1_msg.c",
869 "ssl/d1_srtp.c",
870 "ssl/methods.c",
871 "ssl/packet.c",
872 "ssl/pqueue.c",
873 "ssl/record/dtls1_bitmap.c",
874 "ssl/record/rec_layer_d1.c",
875 "ssl/record/rec_layer_s3.c",
876 "ssl/record/ssl3_buffer.c",
877 "ssl/record/ssl3_record.c",
878 "ssl/record/ssl3_record_tls13.c",
879 "ssl/s3_cbc.c",
880 "ssl/s3_enc.c",
881 "ssl/s3_lib.c",
882 "ssl/s3_msg.c",
883 "ssl/ssl_asn1.c",
884 "ssl/ssl_cert.c",
885 "ssl/ssl_ciph.c",
886 "ssl/ssl_conf.c",
887 "ssl/ssl_err.c",
888 "ssl/ssl_init.c",
889 "ssl/ssl_lib.c",
890 "ssl/ssl_mcnf.c",
891 "ssl/ssl_rsa.c",
892 "ssl/ssl_sess.c",
893 "ssl/ssl_stat.c",
894 "ssl/ssl_txt.c",
895 "ssl/ssl_utst.c",
896 "ssl/statem/extensions.c",
897 "ssl/statem/extensions_clnt.c",
898 "ssl/statem/extensions_cust.c",
899 "ssl/statem/extensions_srvr.c",
900 "ssl/statem/statem.c",
901 "ssl/statem/statem_clnt.c",
902 "ssl/statem/statem_dtls.c",
903 "ssl/statem/statem_lib.c",
904 "ssl/statem/statem_srvr.c",
905 "ssl/t1_enc.c",
906 "ssl/t1_lib.c",
907 "ssl/t1_trce.c",
908 "ssl/tls13_enc.c",
909 "ssl/tls_srp.c",
910 ] + glob([
911 "ssl/**/*.h",
912 ]),
913 hdrs = HDRS,
914 copts = COPTS,
915 deps = [":libcrypto"],
916)