xref: /freebsd/usr.sbin/wpa/Makefile.crypto (revision 7c5a624afae43c44d8e57eb8c5073b9b07f88064)
1d9246288SBernhard Schmidt# $FreeBSD$
2d9246288SBernhard Schmidt
391f5df38SWarner Losh.if ${MK_OPENSSL} != "no"
44bc52338SCy SchubertSRCS+=	crypto_openssl.c random.c sha1-prf.c sha256-prf.c sha256-tlsprf.c \
54bc52338SCy Schubert	sha512.c
6c6db8143SBaptiste DaroussinLIBADD+=	ssl crypto
7f05cddf9SRui PauloCFLAGS+= -DCONFIG_SHA256
8d9246288SBernhard Schmidt.else
9d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_CRYPTO_INTERNAL
10f05cddf9SRui PauloSRCS+=	crypto_internal.c random.c
11d9246288SBernhard SchmidtCONFIG_INTERNAL_AES=y
12d9246288SBernhard SchmidtCONFIG_INTERNAL_DES=y
13d9246288SBernhard SchmidtCONFIG_INTERNAL_MD4=y
14d9246288SBernhard SchmidtCONFIG_INTERNAL_MD5=y
15d9246288SBernhard SchmidtCONFIG_INTERNAL_RC4=y
16d9246288SBernhard SchmidtCONFIG_INTERNAL_SHA1=y
17f05cddf9SRui PauloNEED_SHA256=y
18d9246288SBernhard SchmidtCONFIG_INTERNAL_SHA256=y
19*7c5a624aSAdrian ChaddNEED_SHA384=y
20*7c5a624aSAdrian ChaddCONFIG_INTERNAL_SHA384=y
21*7c5a624aSAdrian ChaddNEED_SHA512=y
22*7c5a624aSAdrian ChaddCONFIG_INTERNAL_SHA512=y
23d9246288SBernhard SchmidtCONFIG_INTERNAL_TLS=y
24*7c5a624aSAdrian ChaddNEED_DH_GROUPS=y
25f05cddf9SRui PauloCONFIG_INTERNAL_DH5=y
26d9246288SBernhard SchmidtNEED_AES_ENC=true
27325151a3SRui PauloNEED_AES_CBC=true
28d9246288SBernhard Schmidt.endif
2985732ac8SCy SchubertNEED_AES_OMAC1=true
30d9246288SBernhard Schmidt
31d9246288SBernhard Schmidt.if defined(TLS_FUNCS)
32d9246288SBernhard SchmidtNEED_TLS_PRF=y
33d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_TLS)
34d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \
35d9246288SBernhard Schmidt	-DCONFIG_TLS_INTERNAL_CLIENT
36d9246288SBernhard SchmidtSRCS+=	asn1.c \
37d9246288SBernhard Schmidt	bignum.c \
38d9246288SBernhard Schmidt	crypto_internal-cipher.c \
39d9246288SBernhard Schmidt	crypto_internal-modexp.c \
40d9246288SBernhard Schmidt	crypto_internal-rsa.c \
41d9246288SBernhard Schmidt	pkcs1.c \
42d9246288SBernhard Schmidt	pkcs5.c \
43d9246288SBernhard Schmidt	pkcs8.c \
44d9246288SBernhard Schmidt	rsa.c \
45d9246288SBernhard Schmidt	tls_internal.c \
46d9246288SBernhard Schmidt	tlsv1_common.c \
47d9246288SBernhard Schmidt	tlsv1_record.c \
48d9246288SBernhard Schmidt	tlsv1_cred.c \
49d9246288SBernhard Schmidt	tlsv1_client.c \
50d9246288SBernhard Schmidt	tlsv1_client_write.c \
51d9246288SBernhard Schmidt	tlsv1_client_read.c \
52*7c5a624aSAdrian Chadd	tlsv1_client_ocsp.c \
53d9246288SBernhard Schmidt	x509v3.c
54d9246288SBernhard SchmidtNEED_DES=y
55d9246288SBernhard SchmidtNEED_MD4=y
56d9246288SBernhard SchmidtNEED_RC4=y
57d9246288SBernhard Schmidt.else
58d9246288SBernhard SchmidtCFLAGS+=-DEAP_TLS_OPENSSL
5985732ac8SCy SchubertSRCS+=	tls_openssl.c tls_openssl_ocsp.c
60d9246288SBernhard Schmidt.endif
61d9246288SBernhard Schmidt.endif
62d9246288SBernhard Schmidt
63d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_AES)
64cd4308d2SRui PauloSRCS+=	aes-unwrap.c aes-wrap.c \
65cd4308d2SRui Paulo	aes-internal.c \
66d9246288SBernhard Schmidt	aes-internal-dec.c \
67d9246288SBernhard Schmidt	aes-internal-enc.c
68d9246288SBernhard Schmidt.endif
69d9246288SBernhard Schmidt
70d9246288SBernhard Schmidt.if defined(NEED_AES_CBC)
71d9246288SBernhard SchmidtSRCS+=	aes-cbc.c
72d9246288SBernhard Schmidt.endif
73d9246288SBernhard Schmidt
74d9246288SBernhard Schmidt.if defined(NEED_AES_EAX)
75d9246288SBernhard SchmidtSRCS+=	aes-eax.c
76d9246288SBernhard SchmidtNEED_AES_CTR=y
77d9246288SBernhard Schmidt.endif
78d9246288SBernhard Schmidt
79d9246288SBernhard Schmidt.if defined(NEED_AES_CTR)
80d9246288SBernhard SchmidtSRCS+=	aes-ctr.c
81d9246288SBernhard Schmidt.endif
82d9246288SBernhard Schmidt
83d9246288SBernhard Schmidt.if defined(NEED_AES_ENCBLOCK)
84d9246288SBernhard SchmidtSRCS+=	aes-encblock.c
85d9246288SBernhard Schmidt.endif
86d9246288SBernhard Schmidt
87d9246288SBernhard Schmidt.if defined(NEED_AES_OMAC1)
88d9246288SBernhard SchmidtSRCS+=	aes-omac1.c
89d9246288SBernhard Schmidt.endif
90d9246288SBernhard Schmidt
91d9246288SBernhard Schmidt.if defined(NEED_DES)
92d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_DES)
93d9246288SBernhard SchmidtSRCS+=	des-internal.c
94d9246288SBernhard Schmidt.endif
95d9246288SBernhard Schmidt.endif
96d9246288SBernhard Schmidt
97d9246288SBernhard Schmidt.if defined(NEED_MD4)
98d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_MD4)
99d9246288SBernhard SchmidtSRCS+=	md4-internal.c
100d9246288SBernhard Schmidt.endif
101d9246288SBernhard Schmidt.endif
102d9246288SBernhard Schmidt
103d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_MD5)
104cd4308d2SRui PauloSRCS+=	md5.c md5-internal.c
105d9246288SBernhard Schmidt.endif
106d9246288SBernhard Schmidt
107d9246288SBernhard Schmidt.if defined(NEED_FIPS186_2_PRF)
108d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA1)
109d9246288SBernhard SchmidtSRCS+=	fips_prf_internal.c
110d9246288SBernhard Schmidt.else
111d9246288SBernhard SchmidtSRCS+=	fips_prf_openssl.c
112d9246288SBernhard Schmidt.endif
113d9246288SBernhard Schmidt.endif
114d9246288SBernhard Schmidt
115d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_RC4)
116d9246288SBernhard SchmidtSRCS+=	rc4.c
117d9246288SBernhard Schmidt.endif
118d9246288SBernhard Schmidt
119d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA1)
120f05cddf9SRui PauloSRCS+=	sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c
121d9246288SBernhard Schmidt.endif
122d9246288SBernhard Schmidt
123d9246288SBernhard Schmidt.if defined(NEED_SHA256)
124d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_SHA256
125d9246288SBernhard SchmidtSRCS+=	sha256.c
126d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA256)
127f05cddf9SRui PauloSRCS+=	sha256-internal.c sha256-prf.c
128d9246288SBernhard Schmidt.endif
129d9246288SBernhard Schmidt.endif
130d9246288SBernhard Schmidt
131*7c5a624aSAdrian Chadd.if defined(NEED_SHA384)
132*7c5a624aSAdrian ChaddCFLAGS+=-DCONFIG_SHA384
133*7c5a624aSAdrian ChaddSRCS+=	sha384.c
134*7c5a624aSAdrian Chadd.if defined(CONFIG_INTERNAL_SHA384)
135*7c5a624aSAdrian ChaddSRCS+=	sha384-internal.c sha384-prf.c
136*7c5a624aSAdrian Chadd.endif
137*7c5a624aSAdrian Chadd.endif
138*7c5a624aSAdrian Chadd
139*7c5a624aSAdrian Chadd.if defined(NEED_SHA512)
140*7c5a624aSAdrian ChaddCFLAGS+=-DCONFIG_SHA512
141*7c5a624aSAdrian ChaddSRCS+=	sha512.c
142*7c5a624aSAdrian Chadd.if defined(CONFIG_INTERNAL_SHA512)
143*7c5a624aSAdrian ChaddSRCS+=	sha512-internal.c sha512-prf.c
144*7c5a624aSAdrian Chadd.endif
145*7c5a624aSAdrian Chadd.endif
146*7c5a624aSAdrian Chadd
147d9246288SBernhard Schmidt.if defined(NEED_TLS_PRF)
148d9246288SBernhard SchmidtSRCS+=	sha1-tlsprf.c
149d9246288SBernhard Schmidt.endif
150f05cddf9SRui Paulo
151f05cddf9SRui Paulo.if defined(CONFIG_INTERNAL_DH5)
152*7c5a624aSAdrian Chadd.if defined(NEED_DH_GROUPS)
153f05cddf9SRui PauloSRCS+=	dh_group5.c
154f05cddf9SRui Paulo.endif
155*7c5a624aSAdrian Chadd.endif
156f05cddf9SRui Paulo
157*7c5a624aSAdrian Chadd.if defined(NEED_DH_GROUPS)
158f05cddf9SRui PauloSRCS+=	dh_groups.c
159f05cddf9SRui Paulo.endif
160*7c5a624aSAdrian Chadd
161*7c5a624aSAdrian Chadd.if defined(NEED_DH_GROUPS_ALL)
162*7c5a624aSAdrian ChaddCFLAGS+=-DALL_DH_GROUPS
163*7c5a624aSAdrian Chadd.endif
164