xref: /freebsd/usr.sbin/wpa/Makefile.crypto (revision 85732ac8bccbc0adcf5a261ea1ffec8ca7b3a92d)
1d9246288SBernhard Schmidt# $FreeBSD$
2d9246288SBernhard Schmidt
3d9246288SBernhard Schmidt.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)
4325151a3SRui PauloSRCS+=	crypto_openssl.c random.c sha1-prf.c sha256-prf.c sha256-tlsprf.c
5c6db8143SBaptiste DaroussinLIBADD+=	ssl crypto
6f05cddf9SRui PauloCFLAGS+= -DCONFIG_SHA256
7d9246288SBernhard Schmidt.else
8d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_CRYPTO_INTERNAL
9f05cddf9SRui PauloSRCS+=	crypto_internal.c random.c
10d9246288SBernhard SchmidtCONFIG_INTERNAL_AES=y
11d9246288SBernhard SchmidtCONFIG_INTERNAL_DES=y
12d9246288SBernhard SchmidtCONFIG_INTERNAL_MD4=y
13d9246288SBernhard SchmidtCONFIG_INTERNAL_MD5=y
14d9246288SBernhard SchmidtCONFIG_INTERNAL_RC4=y
15d9246288SBernhard SchmidtCONFIG_INTERNAL_SHA1=y
16f05cddf9SRui PauloNEED_SHA256=y
17d9246288SBernhard SchmidtCONFIG_INTERNAL_SHA256=y
18d9246288SBernhard SchmidtCONFIG_INTERNAL_TLS=y
19f05cddf9SRui PauloCONFIG_INTERNAL_DH5=y
20f05cddf9SRui PauloCONFIG_INTERNAL_DH=y
21d9246288SBernhard SchmidtNEED_AES_ENC=true
22325151a3SRui PauloNEED_AES_CBC=true
23d9246288SBernhard Schmidt.endif
24*85732ac8SCy SchubertNEED_AES_OMAC1=true
25d9246288SBernhard Schmidt
26d9246288SBernhard Schmidt.if defined(TLS_FUNCS)
27d9246288SBernhard SchmidtNEED_TLS_PRF=y
28d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_TLS)
29d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \
30d9246288SBernhard Schmidt	-DCONFIG_TLS_INTERNAL_CLIENT
31d9246288SBernhard SchmidtSRCS+=	asn1.c \
32d9246288SBernhard Schmidt	bignum.c \
33d9246288SBernhard Schmidt	crypto_internal-cipher.c \
34d9246288SBernhard Schmidt	crypto_internal-modexp.c \
35d9246288SBernhard Schmidt	crypto_internal-rsa.c \
36d9246288SBernhard Schmidt	pkcs1.c \
37d9246288SBernhard Schmidt	pkcs5.c \
38d9246288SBernhard Schmidt	pkcs8.c \
39d9246288SBernhard Schmidt	rsa.c \
40d9246288SBernhard Schmidt	tls_internal.c \
41d9246288SBernhard Schmidt	tlsv1_common.c \
42d9246288SBernhard Schmidt	tlsv1_record.c \
43d9246288SBernhard Schmidt	tlsv1_cred.c \
44d9246288SBernhard Schmidt	tlsv1_client.c \
45d9246288SBernhard Schmidt	tlsv1_client_write.c \
46d9246288SBernhard Schmidt	tlsv1_client_read.c \
47d9246288SBernhard Schmidt	x509v3.c
48d9246288SBernhard SchmidtNEED_DES=y
49d9246288SBernhard SchmidtNEED_MD4=y
50d9246288SBernhard SchmidtNEED_RC4=y
51d9246288SBernhard Schmidt.else
52d9246288SBernhard SchmidtCFLAGS+=-DEAP_TLS_OPENSSL
53*85732ac8SCy SchubertSRCS+=	tls_openssl.c tls_openssl_ocsp.c
54d9246288SBernhard Schmidt.endif
55d9246288SBernhard Schmidt.endif
56d9246288SBernhard Schmidt
57d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_AES)
58cd4308d2SRui PauloSRCS+=	aes-unwrap.c aes-wrap.c \
59cd4308d2SRui Paulo	aes-internal.c \
60d9246288SBernhard Schmidt	aes-internal-dec.c \
61d9246288SBernhard Schmidt	aes-internal-enc.c
62d9246288SBernhard Schmidt.endif
63d9246288SBernhard Schmidt
64d9246288SBernhard Schmidt.if defined(NEED_AES_CBC)
65d9246288SBernhard SchmidtSRCS+=	aes-cbc.c
66d9246288SBernhard Schmidt.endif
67d9246288SBernhard Schmidt
68d9246288SBernhard Schmidt.if defined(NEED_AES_EAX)
69d9246288SBernhard SchmidtSRCS+=	aes-eax.c
70d9246288SBernhard SchmidtNEED_AES_CTR=y
71d9246288SBernhard Schmidt.endif
72d9246288SBernhard Schmidt
73d9246288SBernhard Schmidt.if defined(NEED_AES_CTR)
74d9246288SBernhard SchmidtSRCS+=	aes-ctr.c
75d9246288SBernhard Schmidt.endif
76d9246288SBernhard Schmidt
77d9246288SBernhard Schmidt.if defined(NEED_AES_ENCBLOCK)
78d9246288SBernhard SchmidtSRCS+=	aes-encblock.c
79d9246288SBernhard Schmidt.endif
80d9246288SBernhard Schmidt
81d9246288SBernhard Schmidt.if defined(NEED_AES_OMAC1)
82d9246288SBernhard SchmidtSRCS+=	aes-omac1.c
83d9246288SBernhard Schmidt.endif
84d9246288SBernhard Schmidt
85d9246288SBernhard Schmidt.if defined(NEED_DES)
86d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_DES)
87d9246288SBernhard SchmidtSRCS+=	des-internal.c
88d9246288SBernhard Schmidt.endif
89d9246288SBernhard Schmidt.endif
90d9246288SBernhard Schmidt
91d9246288SBernhard Schmidt.if defined(NEED_MD4)
92d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_MD4)
93d9246288SBernhard SchmidtSRCS+=	md4-internal.c
94d9246288SBernhard Schmidt.endif
95d9246288SBernhard Schmidt.endif
96d9246288SBernhard Schmidt
97d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_MD5)
98cd4308d2SRui PauloSRCS+=	md5.c md5-internal.c
99d9246288SBernhard Schmidt.endif
100d9246288SBernhard Schmidt
101d9246288SBernhard Schmidt.if defined(NEED_FIPS186_2_PRF)
102d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA1)
103d9246288SBernhard SchmidtSRCS+=	fips_prf_internal.c
104d9246288SBernhard Schmidt.else
105d9246288SBernhard SchmidtSRCS+=	fips_prf_openssl.c
106d9246288SBernhard Schmidt.endif
107d9246288SBernhard Schmidt.endif
108d9246288SBernhard Schmidt
109d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_RC4)
110d9246288SBernhard SchmidtSRCS+=	rc4.c
111d9246288SBernhard Schmidt.endif
112d9246288SBernhard Schmidt
113d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA1)
114f05cddf9SRui PauloSRCS+=	sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c
115d9246288SBernhard Schmidt.endif
116d9246288SBernhard Schmidt
117d9246288SBernhard Schmidt.if defined(NEED_SHA256)
118d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_SHA256
119d9246288SBernhard SchmidtSRCS+=	sha256.c
120d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA256)
121f05cddf9SRui PauloSRCS+=	sha256-internal.c sha256-prf.c
122d9246288SBernhard Schmidt.endif
123d9246288SBernhard Schmidt.endif
124d9246288SBernhard Schmidt
125d9246288SBernhard Schmidt.if defined(NEED_TLS_PRF)
126d9246288SBernhard SchmidtSRCS+=	sha1-tlsprf.c
127d9246288SBernhard Schmidt.endif
128f05cddf9SRui Paulo
129f05cddf9SRui Paulo.if defined(CONFIG_INTERNAL_DH5)
130f05cddf9SRui PauloSRCS+=	dh_group5.c
131f05cddf9SRui Paulo.endif
132f05cddf9SRui Paulo
133f05cddf9SRui Paulo.if defined(CONFIG_INTERNAL_DH)
134f05cddf9SRui PauloSRCS+=	dh_groups.c
135f05cddf9SRui Paulo.endif
136