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