xref: /freebsd/secure/lib/libcrypto/Makefile (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1
2SHLIBDIR?=	/lib
3SUBDIR=		engines modules
4
5.include <bsd.own.mk>
6.include <src.opts.mk>
7
8PACKAGE=	openssl-lib
9LIB=		crypto
10SHLIB_MAJOR=	30
11VERSION_MAP=	${.CURDIR}/Version.map
12
13NO_LINT=
14PCFILES=	libcrypto.pc
15
16.include "Makefile.man"
17.include "Makefile.inc"
18
19SRCS=	asn1_dsa.c bsearch.c cpt_err.c context.c core_algorithm.c core_fetch.c core_namemap.c cpuid.c cryptlib.c ctype.c
20SRCS+=	cversion.c der_writer.c ebcdic.c ex_data.c getenv.c info.c init.c initthread.c
21SRCS+=	mem.c mem_sec.c o_dir.c o_fopen.c o_init.c o_str.c o_time.c packet.c
22SRCS+=	param_build.c param_build_set.c params.c params_dup.c params_from_text.c
23SRCS+=	passphrase.c provider.c provider_child.c provider_conf.c provider_core.c provider_predefined.c punycode.c self_test_core.c sparse_array.c threads_lib.c threads_none.c threads_pthread.c trace.c uid.c
24.if defined(ASM_aarch64)
25SRCS+=	arm64cpuid.S armcap.c
26ACFLAGS.arm64cpuid.S=	-march=armv8-a+crypto
27.elif defined(ASM_amd64)
28SRCS+=	x86_64cpuid.S
29.elif defined(ASM_arm)
30SRCS+=	armv4cpuid.S armcap.c
31.elif defined(ASM_i386)
32SRCS+=	x86cpuid.S
33.elif defined(ASM_powerpc)
34SRCS+=	ppccpuid.S ppccap.c
35.elif defined(ASM_powerpc64)
36SRCS+=	ppccpuid.S ppccap.c
37.elif defined(ASM_powerpc64le)
38SRCS+=	ppccpuid.S ppccap.c
39.else
40SRCS+=	mem_clr.c
41.endif
42
43# aes
44SRCS+=	aes_cbc.c aes_cfb.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c
45.if defined(ASM_aarch64)
46SRCS+=	aes_core.c aesv8-armx.S vpaes-armv8.S
47ACFLAGS.aesv8-armx.S=	-march=armv8-a+crypto
48.elif defined(ASM_amd64)
49SRCS+=	aes_core.c aesni-mb-x86_64.S aesni-sha1-x86_64.S aesni-sha256-x86_64.S
50SRCS+=	aesni-x86_64.S vpaes-x86_64.S
51.elif defined(ASM_arm)
52SRCS+=	aes-armv4.S aesv8-armx.S bsaes-armv7.S
53.elif defined(ASM_i386)
54SRCS+=	aes_core.c aesni-x86.S vpaes-x86.S
55.elif defined(ASM_powerpc)
56SRCS+=	aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S
57.elif defined(ASM_powerpc64)
58SRCS+=	aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S
59.elif defined(ASM_powerpc64le)
60SRCS+=	aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S
61.else
62SRCS+=	aes_core.c
63.endif
64
65# asn1
66SRCS+=	a_bitstr.c a_d2i_fp.c a_digest.c a_dup.c a_gentm.c a_i2d_fp.c
67SRCS+=	a_int.c a_mbstr.c a_object.c a_octet.c a_print.c a_sign.c a_strex.c
68SRCS+=	a_strnid.c a_time.c a_type.c a_utctm.c a_utf8.c a_verify.c
69SRCS+=	ameth_lib.c asn1_err.c asn1_gen.c asn1_item_list.c asn1_lib.c
70SRCS+=	asn1_parse.c asn_mime.c asn_moid.c asn_mstbl.c asn_pack.c bio_asn1.c
71SRCS+=	bio_ndef.c d2i_param.c d2i_pr.c d2i_pu.c evp_asn1.c f_int.c f_string.c
72SRCS+=	i2d_evp.c n_pkey.c nsseq.c p5_pbe.c p5_pbev2.c p5_scrypt.c p8_pkey.c
73SRCS+=	t_bitst.c t_pkey.c t_spki.c tasn_dec.c tasn_enc.c tasn_fre.c
74SRCS+=	tasn_new.c tasn_prn.c tasn_scn.c tasn_typ.c tasn_utl.c x_algor.c
75SRCS+=	x_bignum.c x_info.c x_int64.c x_long.c x_pkey.c x_sig.c x_spki.c
76SRCS+=	x_val.c
77
78# async
79SRCS+=	async.c async_err.c async_posix.c async_wait.c
80
81# bf
82SRCS+=	bf_cfb64.c bf_ecb.c bf_ofb64.c bf_prefix.c bf_readbuff.c bf_skey.c
83.if defined(ASM_i386)
84SRCS+=	bf-586.S
85.else
86SRCS+=	bf_enc.c
87.endif
88
89# bio
90SRCS+=	bio_addr.c bio_dump.c bio_print.c bio_sock.c bio_sock2.c bf_buff.c
91SRCS+=	bf_lbuf.c bf_nbio.c bf_null.c bio_cb.c bio_err.c bio_lib.c bio_meth.c
92SRCS+=	bss_acpt.c bss_bio.c bss_conn.c bss_core.c bss_dgram.c bss_fd.c
93SRCS+=	bss_file.c bss_log.c bss_mem.c bss_null.c bss_sock.c ossl_core_bio.c
94
95# bn
96SRCS+=	bn_add.c bn_blind.c bn_const.c bn_conv.c bn_ctx.c bn_depr.c bn_dh.c
97SRCS+=	bn_div.c bn_err.c bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_intern.c
98SRCS+=	bn_kron.c bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c
99SRCS+=	bn_prime.c bn_print.c bn_rand.c bn_recp.c bn_rsa_fips186_4.c bn_shift.c
100SRCS+=	bn_sqr.c bn_sqrt.c bn_srp.c bn_word.c bn_x931p.c
101.if defined(ASM_aarch64)
102SRCS+=	armv8-mont.S bn_asm.c
103.elif defined(ASM_amd64)
104SRCS+=	rsaz-avx2.S rsaz-avx512.S rsaz-x86_64.S rsaz_exp.c rsaz_exp_x2.c
105SRCS+=	x86_64-gcc.c x86_64-gf2m.S x86_64-mont.S x86_64-mont5.S
106.elif defined(ASM_arm)
107SRCS+=	armv4-gf2m.S armv4-mont.S bn_asm.c
108.elif defined(ASM_i386)
109SRCS+=	bn-586.S co-586.S x86-gf2m.S x86-mont.S
110.elif defined(ASM_powerpc)
111SRCS+=	bn_ppc.c bn-ppc.S ppc-mont.S
112.elif defined(ASM_powerpc64)
113SRCS+=	bn_ppc.c bn-ppc.S ppc-mont.S
114.elif defined(ASM_powerpc64le)
115SRCS+=	bn_ppc.c bn-ppc.S ppc-mont.S
116.else
117SRCS+=	bn_asm.c
118.endif
119
120# Full of strict aliasing violations that LLVM has been seen to break with
121# optimisations, which can lead to ECDSA signatures not working. See
122# https://github.com/openssl/openssl/issues/12247 for the upstream bug report.
123CFLAGS.bn_nist.c+=	-fno-strict-aliasing
124
125# buffer
126SRCS+=	buf_err.c buffer.c
127
128# camellia
129SRCS+=	cmll_cfb.c cmll_ctr.c cmll_ecb.c cmll_ofb.c
130.if defined(ASM_amd64)
131SRCS+=	cmll-x86_64.S cmll_misc.c
132.elif defined(ASM_i386)
133SRCS+=	cmll-x86.S
134.else
135SRCS+=	camellia.c cmll_cbc.c cmll_misc.c
136.endif
137
138# cast
139SRCS+=	c_cfb64.c c_ecb.c c_enc.c c_ofb64.c c_skey.c
140
141# chacha
142.if defined(ASM_aarch64)
143SRCS+=	chacha-armv8.S
144.elif defined(ASM_amd64)
145SRCS+=	chacha-x86_64.S
146.elif defined(ASM_arm)
147SRCS+=	chacha-armv4.S
148.elif defined(ASM_i386)
149SRCS+=	chacha-x86.S
150.elif defined(ASM_powerpc)
151SRCS+=	chacha_ppc.c chacha-ppc.S
152.elif defined(ASM_powerpc64)
153SRCS+=	chacha_ppc.c chacha-ppc.S
154.elif defined(ASM_powerpc64le)
155SRCS+=	chacha_ppc.c chacha-ppc.S
156.else
157SRCS+=	chacha_enc.c
158.endif
159
160# cmac
161SRCS+=	cmac.c
162
163# cmp
164SRCS+=	cmp_asn.c cmp_client.c cmp_ctx.c cmp_err.c cmp_hdr.c cmp_http.c
165SRCS+=	cmp_msg.c cmp_protect.c cmp_server.c cmp_status.c cmp_util.c cmp_vfy.c
166
167# cms
168SRCS+=	cms_asn1.c cms_att.c cms_cd.c cms_dd.c cms_dh.c cms_ec.c cms_enc.c
169SRCS+=	cms_env.c cms_err.c cms_ess.c cms_io.c cms_kari.c cms_lib.c cms_pwri.c
170SRCS+=	cms_rsa.c cms_sd.c cms_smime.c
171
172# comp
173SRCS+=	c_zlib.c comp_err.c comp_lib.c
174
175# conf
176SRCS+=	conf_api.c conf_def.c conf_err.c conf_lib.c conf_mall.c conf_mod.c
177SRCS+=	conf_sap.c conf_ssl.c
178
179# crmf
180SRCS+=	crmf_asn.c crmf_err.c crmf_lib.c crmf_pbm.c
181
182# ct
183SRCS+=	ct_b64.c ct_err.c ct_log.c ct_oct.c ct_policy.c ct_prn.c ct_sct.c
184SRCS+=	ct_sct_ctx.c ct_vfy.c ct_x509v3.c
185
186# des
187SRCS+=	cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c ecb3_enc.c
188SRCS+=	ecb_enc.c fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c
189SRCS+=	qud_cksm.c rand_key.c set_key.c str2key.c xcbc_enc.c
190.if defined(ASM_i386)
191SRCS+=	crypt586.S des-586.S
192.else
193SRCS+=	des_enc.c fcrypt_b.c
194.endif
195
196# dh
197SRCS+=	dh_ameth.c dh_asn1.c dh_backend.c dh_check.c dh_err.c dh_gen.c
198SRCS+=	dh_group_params.c dh_kdf.c dh_key.c dh_lib.c dh_meth.c dh_pmeth.c
199SRCS+=	dh_prn.c dh_rfc5114.c
200
201# dsa
202SRCS+=	dsa_ameth.c dsa_asn1.c dsa_backend.c dsa_check.c dsa_err.c dsa_gen.c
203SRCS+=	dsa_key.c dsa_lib.c dsa_meth.c dsa_ossl.c dsa_pmeth.c dsa_prn.c
204SRCS+=	dsa_sign.c dsa_vrf.c
205
206# dso
207SRCS+=	dso_dlfcn.c dso_err.c dso_lib.c
208
209# ec
210SRCS+=	curve25519.c curve448.c curve448_tables.c ec2_oct.c ec2_smpl.c
211SRCS+=	ec_ameth.c ec_asn1.c ec_backend.c ec_check.c ec_curve.c ec_cvt.c
212SRCS+=	ec_deprecated.c ec_err.c ec_key.c ec_kmeth.c ec_lib.c ec_mult.c ec_oct.c
213SRCS+=	ec_pmeth.c ec_print.c ecdh_kdf.c ecdh_ossl.c ecdsa_ossl.c ecdsa_sign.c
214SRCS+=	ecdsa_vrf.c eck_prn.c ecp_mont.c ecp_nist.c
215SRCS+=	ecp_oct.c ecp_smpl.c ecx_backend.c ecx_key.c ecx_meth.c eddsa.c
216SRCS+=	f_generic.c f_impl32.c f_impl64.c scalar.c
217# see OPENSSL_NO_EC_NISTP_64_GCC_128 in configuration.h
218.if ${MACHINE_ABI:Mlittle-endian} && ${MACHINE_ABI:Mlong64}
219SRCS+=	ecp_nistp224.c ecp_nistp256.c ecp_nistp521.c ecp_nistputil.c
220.endif
221.if defined(ASM_aarch64)
222SRCS+=	ecp_nistz256-armv8.S ecp_nistz256.c
223.elif defined(ASM_amd64)
224SRCS+=	ecp_nistz256-x86_64.S ecp_nistz256.c x25519-x86_64.S
225.elif defined(ASM_arm)
226SRCS+=	ecp_nistz256-armv4.S ecp_nistz256.c
227.elif defined(ASM_i386)
228SRCS+=	ecp_nistz256-x86.S ecp_nistz256.c
229.elif defined(ASM_powerpc64)
230SRCS+=	ecp_nistp521-ppc64.S ecp_nistz256-ppc64.S ecp_nistz256.c ecp_ppc.c x25519-ppc64.S
231.elif defined(ASM_powerpc64le)
232SRCS+=	ecp_nistp521-ppc64.S ecp_nistz256-ppc64.S ecp_nistz256.c ecp_ppc.c x25519-ppc64.S
233.endif
234
235# encode_decode
236SRCS+=	decoder_err.c decoder_lib.c decoder_meth.c decoder_pkey.c
237SRCS+=	encoder_err.c encoder_lib.c encoder_meth.c encoder_pkey.c
238
239# engine
240SRCS+=	eng_all.c eng_cnf.c eng_ctrl.c eng_dyn.c eng_err.c
241SRCS+=	eng_fat.c eng_init.c eng_lib.c eng_list.c eng_openssl.c eng_pkey.c
242SRCS+=	eng_rdrand.c eng_table.c tb_asnmth.c tb_cipher.c tb_dh.c tb_digest.c
243SRCS+=	tb_dsa.c tb_eckey.c tb_pkmeth.c tb_rand.c tb_rsa.c
244
245# err
246SRCS+=	err.c err_all.c err_all_legacy.c err_blocks.c err_prn.c
247
248# ess
249SRCS+=	ess_asn1.c ess_err.c ess_lib.c
250
251# evp
252SRCS+=	asymcipher.c bio_b64.c bio_enc.c bio_md.c bio_ok.c c_allc.c c_alld.c cmeth_lib.c
253SRCS+=	ctrl_params_translate.c dh_ctrl.c dh_support.c digest.c dsa_ctrl.c e_aes.c e_aes_cbc_hmac_sha1.c
254SRCS+=	e_aes_cbc_hmac_sha256.c e_aria.c e_bf.c e_camellia.c e_cast.c
255SRCS+=	e_chacha20_poly1305.c e_des.c e_des3.c e_idea.c e_null.c e_old.c
256SRCS+=	e_rc2.c e_rc4.c e_rc4_hmac_md5.c e_rc5.c e_seed.c e_sm4.c e_xcbc_d.c ec_ctrl.c ec_support.c
257SRCS+=	encode.c evp_cnf.c evp_enc.c evp_err.c evp_fetch.c evp_key.c evp_lib.c evp_pbe.c
258SRCS+=	evp_pkey.c evp_rand.c evp_utils.c exchange.c kdf_lib.c kdf_meth.c kem.c keymgmt_lib.c keymgmt_meth.c
259SRCS+=	legacy_blake2.c legacy_md4.c legacy_md5.c legacy_md5_sha1.c m_null.c
260SRCS+=	legacy_ripemd.c legacy_sha.c legacy_wp.c m_sigver.c mac_lib.c mac_meth.c names.c p5_crpt.c
261SRCS+=	p5_crpt2.c p_dec.c p_enc.c p_legacy.c p_lib.c  p_open.c p_seal.c p_sign.c
262SRCS+=	p_verify.c pbe_scrypt.c pmeth_check.c pmeth_gn.c pmeth_lib.c signature.c
263
264# ffc
265SRCS+=	ffc_backend.c ffc_dh.c ffc_key_generate.c ffc_key_validate.c
266SRCS+=	ffc_params.c ffc_params_generate.c ffc_params_validate.c
267
268# hmac
269SRCS+=	hmac.c
270
271# http
272SRCS+=	http_client.c http_err.c http_lib.c
273
274# kdf
275SRCS+=	kdf_err.c
276
277# lhash
278SRCS+=	lh_stats.c lhash.c
279
280# md4
281SRCS+=	md4_dgst.c md4_one.c
282
283# md5
284SRCS+=	md5_dgst.c md5_one.c md5_sha1.c
285.if defined(ASM_amd64)
286SRCS+=	md5-x86_64.S
287.elif defined(ASM_i386)
288SRCS+=	md5-586.S
289.endif
290
291# modes
292SRCS+=	cbc128.c ccm128.c cfb128.c ctr128.c cts128.c gcm128.c ocb128.c
293SRCS+=	ofb128.c siv128.c wrap128.c xts128.c
294.if defined(ASM_aarch64)
295SRCS+=	ghashv8-armx.S aes-gcm-armv8_64.S
296ACFLAGS.ghashv8-armx.S=	-march=armv8-a+crypto
297.elif defined(ASM_amd64)
298SRCS+=	aesni-gcm-x86_64.S ghash-x86_64.S
299.elif defined(ASM_arm)
300SRCS+=	ghash-armv4.S ghashv8-armx.S
301.elif defined(ASM_i386)
302SRCS+=	ghash-x86.S
303.elif defined(ASM_powerpc)
304SRCS+=	ghashp8-ppc.S
305.elif defined(ASM_powerpc64)
306SRCS+=	ghashp8-ppc.S
307.elif defined(ASM_powerpc64le)
308SRCS+=	ghashp8-ppc.S
309.endif
310
311# objects
312SRCS+=	o_names.c obj_dat.c obj_err.c obj_lib.c obj_xref.c
313
314# ocsp
315SRCS+=	ocsp_asn.c ocsp_cl.c ocsp_err.c ocsp_ext.c ocsp_http.c ocsp_lib.c
316SRCS+=	ocsp_prn.c ocsp_srv.c ocsp_vfy.c v3_ocsp.c
317
318# pem
319SRCS+=	pem_all.c pem_err.c pem_info.c pem_lib.c pem_oth.c pem_pk8.c
320SRCS+=	pem_pkey.c pem_sign.c pem_x509.c pem_xaux.c pvkfmt.c
321
322# pkcs12
323SRCS+=	p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c p12_decr.c
324SRCS+=	p12_init.c p12_key.c p12_kiss.c p12_mutl.c p12_npas.c p12_p8d.c
325SRCS+=	p12_p8e.c p12_sbag.c p12_utl.c pk12err.c
326
327# pkcs7
328SRCS+=	bio_pk7.c pk7_asn1.c pk7_attr.c pk7_doit.c pk7_lib.c pk7_mime.c
329SRCS+=	pk7_smime.c pkcs7err.c
330
331# poly1305
332SRCS+=	poly1305.c
333.if defined(ASM_aarch64)
334SRCS+=	poly1305-armv8.S
335.elif defined(ASM_amd64)
336SRCS+=	poly1305-x86_64.S
337.elif defined(ASM_arm)
338SRCS+=	poly1305-armv4.S
339.elif defined(ASM_i386)
340SRCS+=	poly1305-x86.S
341.elif defined(ASM_powerpc)
342SRCS+=	poly1305_ppc.c poly1305-ppc.S poly1305-ppcfp.S
343.elif defined(ASM_powerpc64)
344SRCS+=	poly1305_ppc.c poly1305-ppc.S poly1305-ppcfp.S
345.elif defined(ASM_powerpc64le)
346SRCS+=	poly1305_ppc.c poly1305-ppc.S poly1305-ppcfp.S
347.endif
348
349# property
350SRCS+=	defn_cache.c property.c property_err.c property_parse.c property_query.c
351SRCS+=	property_string.c
352
353# providers
354SRCS+=	baseprov.c defltprov.c nullprov.c prov_running.c
355
356# providers/common
357SRCS+=	bio_prov.c capabilities.c digest_to_nid.c provider_ctx.c provider_err.c
358SRCS+=	provider_seeding.c provider_util.c securitycheck.c
359SRCS+=	securitycheck_default.c
360
361# providers/common/der
362SRCS+=	der_rsa_gen.c der_rsa_key.c der_rsa_sig.c
363SRCS+=	der_digests_gen.c
364SRCS+=	der_wrap_gen.c
365SRCS+=	der_dsa_gen.c der_dsa_key.c der_dsa_sig.c
366SRCS+=	der_ec_gen.c der_ec_key.c der_ec_sig.c
367SRCS+=	der_ecx_gen.c der_ecx_key.c
368
369# providers/implementations/asymciphers
370SRCS+=	rsa_enc.c
371
372# providers/implementations/ciphers
373SRCS+=	ciphercommon.c ciphercommon_hw.c ciphercommon_block.c \
374        ciphercommon_gcm.c ciphercommon_gcm_hw.c \
375        ciphercommon_ccm.c ciphercommon_ccm_hw.c
376SRCS+=	cipher_aes.c cipher_aes_hw.c \
377        cipher_aes_xts.c cipher_aes_xts_hw.c \
378        cipher_aes_gcm.c cipher_aes_gcm_hw.c \
379        cipher_aes_ccm.c cipher_aes_ccm_hw.c \
380        cipher_aes_wrp.c \
381        cipher_aes_cbc_hmac_sha.c \
382        cipher_aes_cbc_hmac_sha256_hw.c cipher_aes_cbc_hmac_sha1_hw.c \
383        cipher_cts.c
384SRCS+=	cipher_aes_ocb.c cipher_aes_ocb_hw.c
385SRCS+=	cipher_aes_xts_fips.c
386SRCS+=	cipher_aes_siv.c cipher_aes_siv_hw.c
387SRCS+=	cipher_blowfish.c cipher_blowfish_hw.c
388SRCS+=	cipher_camellia.c cipher_camellia_hw.c
389SRCS+=	cipher_cast5.c cipher_cast5_hw.c
390SRCS+=	cipher_chacha20.c cipher_chacha20_hw.c
391SRCS+=	cipher_chacha20_poly1305.c cipher_chacha20_poly1305_hw.c
392SRCS+=	cipher_des.c cipher_des_hw.c
393SRCS+=	cipher_desx.c cipher_desx_hw.c
394SRCS+=	cipher_null.c
395SRCS+=	cipher_rc4.c cipher_rc4_hw.c
396SRCS+=	cipher_rc4_hmac_md5.c cipher_rc4_hmac_md5_hw.c
397SRCS+=	cipher_seed.c cipher_seed_hw.c
398SRCS+=	cipher_tdes.c cipher_tdes_common.c cipher_tdes_hw.c
399SRCS+=	cipher_tdes_default.c cipher_tdes_default_hw.c \
400	cipher_tdes_wrap.c cipher_tdes_wrap_hw.c
401
402# providers/implementations/digests
403SRCS+=	digestcommon.c
404SRCS+=	blake2_prov.c blake2b_prov.c blake2s_prov.c
405SRCS+=	md4_prov.c
406SRCS+=	md5_prov.c md5_sha1_prov.c
407SRCS+=	null_prov.c
408SRCS+=	ripemd_prov.c
409SRCS+=	sha2_prov.c sha3_prov.c
410SRCS+=	wp_prov.c
411
412# providers/implementations/encode_decode
413SRCS+=	decode_der2key.c decode_epki2pki.c decode_msblob2key.c decode_pvk2key.c
414SRCS+=	decode_pem2der.c decode_spki2typespki.c
415SRCS+=	encode_key2any.c encode_key2blob.c encode_key2ms.c encode_key2text.c
416SRCS+=	endecoder_common.c
417
418# providers/implementations/exchange
419SRCS+=	dh_exch.c
420SRCS+=	ecx_exch.c ecdh_exch.c
421SRCS+=	kdf_exch.c
422
423# providers/implementations/kdfs
424SRCS+=	hkdf.c kbkdf.c krb5kdf.c pbkdf1.c pbkdf2.c pbkdf2_fips.c
425SRCS+=	pkcs12kdf.c scrypt.c sskdf.c sshkdf.c tls1_prf.c x942kdf.c
426
427# providers/implementations/kem
428SRCS+=	rsa_kem.c
429
430# providers/implementations/keymgmt
431SRCS+=	dh_kmgmt.c dsa_kmgmt.c ec_kmgmt.c ecx_kmgmt.c kdf_legacy_kmgmt.c
432SRCS+=	mac_legacy_kmgmt.c rsa_kmgmt.c
433
434# providers/implementations/macs
435SRCS+=	gmac_prov.c hmac_prov.c kmac_prov.c
436SRCS+=	blake2b_mac.c blake2s_mac.c
437SRCS+=	cmac_prov.c
438SRCS+=	poly1305_prov.c
439SRCS+=	siphash_prov.c
440
441# providers/implementations/rands
442SRCS+=	crngt.c drbg.c drbg_ctr.c drbg_hash.c drbg_hmac.c test_rng.c
443SRCS+=	seed_src.c
444
445# providers/implementations/rands/seeding
446SRCS+=	rand_cpu_x86.c rand_tsc.c rand_unix.c rand_win.c
447
448# providers/implementations/signature
449SRCS+=	dsa_sig.c eddsa_sig.c ecdsa_sig.c mac_legacy_sig.c rsa_sig.c
450
451# providers/implementations/storemgmt
452SRCS+=	file_store.c file_store_any2obj.c
453
454# rand
455SRCS+=	prov_seed.c rand_deprecated.c rand_egd.c rand_err.c rand_lib.c
456SRCS+=	rand_meth.c rand_pool.c randfile.c
457
458# rc2
459SRCS+=	rc2_cbc.c rc2_ecb.c rc2_skey.c rc2cfb64.c rc2ofb64.c
460
461# rc4
462.if defined(ASM_amd64)
463SRCS+=	rc4-md5-x86_64.S rc4-x86_64.S
464.elif defined(ASM_i386)
465SRCS+=	rc4-586.S
466.else
467SRCS+=	rc4_enc.c rc4_skey.c
468.endif
469
470# ripemd
471SRCS+=	rmd_dgst.c rmd_one.c
472.if defined(ASM_i386)
473SRCS+=	rmd-586.S
474.endif
475
476# rsa
477SRCS+=	rsa_ameth.c rsa_asn1.c rsa_backend.c rsa_chk.c rsa_crpt.c rsa_depr.c
478SRCS+=	rsa_err.c rsa_gen.c rsa_lib.c rsa_meth.c rsa_mp.c rsa_mp_names.c
479SRCS+=	rsa_none.c rsa_oaep.c rsa_ossl.c rsa_pk1.c rsa_pmeth.c rsa_prn.c
480SRCS+=	rsa_pss.c rsa_saos.c rsa_schemes.c rsa_sign.c rsa_sp800_56b_check.c
481SRCS+=	rsa_sp800_56b_gen.c rsa_x931.c rsa_x931g.c
482
483# seed
484SRCS+=	seed.c seed_cbc.c seed_cfb.c seed_ecb.c seed_ofb.c
485
486# sha
487SRCS+=	sha1_one.c sha1dgst.c sha256.c sha3.c sha512.c
488.if defined(ASM_aarch64)
489SRCS+=	keccak1600-armv8.S sha1-armv8.S sha256-armv8.S sha512-armv8.S
490.elif defined(ASM_amd64)
491SRCS+=	keccak1600-x86_64.S sha1-mb-x86_64.S sha1-x86_64.S
492SRCS+=	sha256-mb-x86_64.S sha256-x86_64.S sha512-x86_64.S
493.elif defined(ASM_arm)
494SRCS+=	keccak1600-armv4.S sha1-armv4-large.S sha256-armv4.S sha512-armv4.S
495.elif defined(ASM_i386)
496SRCS+=	keccak1600.c sha1-586.S sha256-586.S sha512-586.S
497.elif defined(ASM_powerpc)
498SRCS+=	keccak1600.c sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S
499.elif defined(ASM_powerpc64)
500SRCS+=	keccak1600-ppc64.S sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S
501.elif defined(ASM_powerpc64le)
502SRCS+=	keccak1600-ppc64.S sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p8-ppc.S sha512p8-ppc.S
503.else
504SRCS+=	keccak1600.c
505.endif
506
507# siphash
508SRCS+=	siphash.c
509
510# srp
511SRCS+=	srp_lib.c srp_vfy.c
512
513# ssl
514SRCS+=	s3_cbc.c
515
516# ssl/record
517SRCS+=	tls_pad.c
518
519# stack
520SRCS+=	stack.c
521
522# store
523SRCS+=	store_err.c store_init.c store_lib.c store_meth.c store_register.c
524SRCS+=	store_result.c store_strings.c
525
526# ts
527SRCS+=	ts_asn1.c ts_conf.c ts_err.c ts_lib.c ts_req_print.c ts_req_utils.c
528SRCS+=	ts_rsp_print.c ts_rsp_sign.c ts_rsp_utils.c ts_rsp_verify.c
529SRCS+=	ts_verify_ctx.c
530
531# txt_db
532SRCS+=	txt_db.c
533
534# ui
535SRCS+=	ui_err.c ui_lib.c ui_null.c ui_openssl.c ui_util.c
536
537# whrlpool
538SRCS+=	wp_dgst.c
539.if defined(ASM_amd64)
540SRCS+=	wp-x86_64.S
541.elif defined(ASM_i386)
542SRCS+=	wp-mmx.S wp_block.c
543.else
544SRCS+=	wp_block.c
545.endif
546
547# x509
548SRCS+=	by_dir.c by_file.c by_store.c
549SRCS+=	pcy_cache.c pcy_data.c pcy_lib.c pcy_map.c pcy_node.c pcy_tree.c
550SRCS+=	t_crl.c t_req.c t_x509.c
551SRCS+=	v3_addr.c v3_admis.c v3_akeya.c v3_akid.c v3_asid.c
552SRCS+=	v3_bcons.c v3_bitst.c v3_conf.c v3_cpols.c v3_crld.c v3_enum.c
553SRCS+=	v3_extku.c v3_genn.c v3_ia5.c v3_info.c v3_int.c v3_ist.c v3_lib.c v3_ncons.c
554SRCS+=	v3_pci.c v3_pcia.c v3_pcons.c v3_pku.c v3_pmaps.c v3_prn.c v3_purp.c
555SRCS+=	v3_san.c v3_skid.c v3_sxnet.c v3_tlsf.c v3_utf8.c v3_utl.c v3err.c
556SRCS+=	x509_att.c x509_cmp.c x509_d2.c x509_def.c x509_err.c x509_ext.c x509_lu.c x509_meth.c
557SRCS+=	x509_obj.c x509_r2x.c x509_req.c x509_set.c x509_trust.c x509_txt.c
558SRCS+=	x509_v3.c x509_vfy.c x509_vpm.c x509cset.c x509name.c x509rset.c
559SRCS+=	x509spki.c x509type.c x_all.c x_attrib.c x_crl.c x_exten.c x_name.c
560SRCS+=	x_pubkey.c x_req.c x_x509.c x_x509a.c
561
562INCS=	aes.h asn1.h asn1_mac.h asn1err.h asn1t.h async.h asyncerr.h bio.h
563INCS+=	bioerr.h blowfish.h bn.h bnerr.h buffer.h buffererr.h camellia.h
564INCS+=	cast.h cmac.h cmp.h cmp_util.h cmperr.h cms.h cmserr.h comp.h comperr.h conf.h conf_api.h
565INCS+=	conferr.h configuration.h conftypes.h core.h core_dispatch.h core_names.h core_object.h
566INCS+=	crmf.h crmferr.h crypto.h cryptoerr.h cryptoerr_legacy.h ct.h cterr.h
567INCS+=	decoder.h decodererr.h des.h dh.h dherr.h dsa.h
568INCS+=	dsaerr.h dtls1.h e_os2.h ebcdic.h ec.h ecdh.h ecdsa.h ecerr.h encoder.h encodererr.h
569INCS+=	engine.h engineerr.h err.h ess.h esserr.h evp.h evperr.h fips_names.h fipskey.h hmac.h http.h httperr.h idea.h kdf.h
570INCS+=	kdferr.h lhash.h macros.h md2.h md4.h md5.h mdc2.h modes.h obj_mac.h
571INCS+=	objects.h objectserr.h ocsp.h ocsperr.h opensslconf.h opensslv.h
572INCS+=	ossl_typ.h param_build.h params.h pem.h pem2.h pemerr.h pkcs12.h pkcs12err.h pkcs7.h
573INCS+=	pkcs7err.h prov_ssl.h proverr.h provider.h rand.h randerr.h rc2.h rc4.h rc5.h ripemd.h
574INCS+=	rsa.h rsaerr.h safestack.h seed.h self_test.h sha.h srp.h srtp.h ssl.h ssl2.h
575INCS+=	ssl3.h sslerr.h sslerr_legacy.h stack.h store.h storeerr.h symhacks.h tls1.h trace.h ts.h
576INCS+=	tserr.h txt_db.h types.h ui.h uierr.h whrlpool.h x509.h x509_vfy.h x509err.h
577INCS+=	x509v3.h x509v3err.h
578
579INCSDIR=	${INCLUDEDIR}/openssl
580
581LIBADD=	pthread
582
583SRCS+=	buildinf.h
584
585CLEANDIRS=	openssl
586CLEANFILES=	buildinf.h
587
588.if defined(ASM_${MACHINE_CPUARCH}) || defined(ASM_${MACHINE_ARCH})
589_cmd1=/%%NO_ASM%%/d
590.else
591_cmd1=s/%%NO_ASM%%//
592.endif
593.if ${MK_OPENSSL_KTLS} != "no"
594_cmd2=/%%NO_KTLS%%/d
595.else
596_cmd2=s/%%NO_KTLS%%//
597.endif
598
599buildinf.h: Makefile
600	( echo "/*"; \
601	echo " * WARNING: do not edit!"; \
602	echo " * Generated by ${.ALLSRC}"; \
603	echo " */"; \
604	echo "#define PLATFORM \"platform: FreeBSD-${MACHINE_ARCH}\""; \
605	echo "#define DATE \"built on: reproducible build, date unspecified\""; \
606	echo "static const char compiler_flags[] = \"compiler: ${COMPILER_TYPE}\";" ) \
607	> ${.TARGET}
608
609.include <bsd.lib.mk>
610
611PICFLAG+=	-DOPENSSL_PIC
612
613.if defined(ASM_${MACHINE_CPUARCH})
614.PATH:	${SRCTOP}/secure/lib/libcrypto/arch/${MACHINE_CPUARCH}
615.if defined(ASM_amd64)
616.PATH:	${LCRYPTO_SRC}/crypto/bn/asm
617.endif
618.elif defined(ASM_${MACHINE_ARCH})
619.PATH:	${SRCTOP}/secure/lib/libcrypto/arch/${MACHINE_ARCH}
620.endif
621
622.PATH:	${LCRYPTO_SRC}/crypto \
623	${LCRYPTO_SRC}/crypto/aes \
624	${LCRYPTO_SRC}/crypto/aria \
625	${LCRYPTO_SRC}/crypto/asn1 \
626	${LCRYPTO_SRC}/crypto/async \
627	${LCRYPTO_SRC}/crypto/async/arch \
628	${LCRYPTO_SRC}/crypto/bf \
629	${LCRYPTO_SRC}/crypto/bio \
630	${LCRYPTO_SRC}/crypto/bn \
631	${LCRYPTO_SRC}/crypto/buffer \
632	${LCRYPTO_SRC}/crypto/camellia \
633	${LCRYPTO_SRC}/crypto/cast \
634	${LCRYPTO_SRC}/crypto/chacha \
635	${LCRYPTO_SRC}/crypto/cmac \
636	${LCRYPTO_SRC}/crypto/cmp \
637	${LCRYPTO_SRC}/crypto/cms \
638	${LCRYPTO_SRC}/crypto/comp \
639	${LCRYPTO_SRC}/crypto/conf \
640	${LCRYPTO_SRC}/crypto/crmf \
641	${LCRYPTO_SRC}/crypto/ct \
642	${LCRYPTO_SRC}/crypto/des \
643	${LCRYPTO_SRC}/crypto/dh \
644	${LCRYPTO_SRC}/crypto/dsa \
645	${LCRYPTO_SRC}/crypto/dso \
646	${LCRYPTO_SRC}/crypto/ec \
647	${LCRYPTO_SRC}/crypto/ec/curve448 \
648	${LCRYPTO_SRC}/crypto/ec/curve448/arch_32 \
649	${LCRYPTO_SRC}/crypto/ec/curve448/arch_64 \
650	${LCRYPTO_SRC}/crypto/encode_decode \
651	${LCRYPTO_SRC}/crypto/engine \
652	${LCRYPTO_SRC}/crypto/err \
653	${LCRYPTO_SRC}/crypto/ess \
654	${LCRYPTO_SRC}/crypto/evp \
655	${LCRYPTO_SRC}/crypto/ffc \
656	${LCRYPTO_SRC}/crypto/hmac \
657	${LCRYPTO_SRC}/crypto/http \
658	${LCRYPTO_SRC}/crypto/idea \
659	${LCRYPTO_SRC}/crypto/kdf \
660	${LCRYPTO_SRC}/crypto/lhash \
661	${LCRYPTO_SRC}/crypto/md4 \
662	${LCRYPTO_SRC}/crypto/md5 \
663	${LCRYPTO_SRC}/crypto/mdc2 \
664	${LCRYPTO_SRC}/crypto/modes \
665	${LCRYPTO_SRC}/crypto/objects \
666	${LCRYPTO_SRC}/crypto/ocsp \
667	${LCRYPTO_SRC}/crypto/pem \
668	${LCRYPTO_SRC}/crypto/pkcs12 \
669	${LCRYPTO_SRC}/crypto/pkcs7 \
670	${LCRYPTO_SRC}/crypto/poly1305 \
671	${LCRYPTO_SRC}/crypto/property \
672	${LCRYPTO_SRC}/crypto/rand \
673	${LCRYPTO_SRC}/crypto/rc2 \
674	${LCRYPTO_SRC}/crypto/rc4 \
675	${LCRYPTO_SRC}/crypto/rc5 \
676	${LCRYPTO_SRC}/crypto/ripemd \
677	${LCRYPTO_SRC}/crypto/rsa \
678	${LCRYPTO_SRC}/crypto/seed \
679	${LCRYPTO_SRC}/crypto/sha \
680	${LCRYPTO_SRC}/crypto/siphash \
681	${LCRYPTO_SRC}/crypto/sm2 \
682	${LCRYPTO_SRC}/crypto/sm3 \
683	${LCRYPTO_SRC}/crypto/sm4 \
684	${LCRYPTO_SRC}/crypto/srp \
685	${LCRYPTO_SRC}/crypto/stack \
686	${LCRYPTO_SRC}/crypto/store \
687	${LCRYPTO_SRC}/crypto/ts \
688	${LCRYPTO_SRC}/crypto/txt_db \
689	${LCRYPTO_SRC}/crypto/ui \
690	${LCRYPTO_SRC}/crypto/whrlpool \
691	${LCRYPTO_SRC}/crypto/x509 \
692	${LCRYPTO_SRC}/crypto/x509v3 \
693	${LCRYPTO_SRC}/include/openssl \
694	${LCRYPTO_SRC}/providers \
695	${LCRYPTO_SRC}/providers/common \
696	${LCRYPTO_SRC}/providers/common/der \
697	${LCRYPTO_SRC}/providers/implementations/asymciphers \
698	${LCRYPTO_SRC}/providers/implementations/ciphers \
699	${LCRYPTO_SRC}/providers/implementations/digests \
700	${LCRYPTO_SRC}/providers/implementations/encode_decode \
701	${LCRYPTO_SRC}/providers/implementations/exchange \
702	${LCRYPTO_SRC}/providers/implementations/kdfs \
703	${LCRYPTO_SRC}/providers/implementations/kem \
704	${LCRYPTO_SRC}/providers/implementations/keymgmt \
705	${LCRYPTO_SRC}/providers/implementations/macs \
706	${LCRYPTO_SRC}/providers/implementations/rands \
707	${LCRYPTO_SRC}/providers/implementations/rands/seeding \
708	${LCRYPTO_SRC}/providers/implementations/signature \
709	${LCRYPTO_SRC}/providers/implementations/storemgmt \
710	${LCRYPTO_SRC}/ssl \
711	${LCRYPTO_SRC}/ssl/record
712