xref: /freebsd/usr.sbin/wpa/src/crypto/Makefile (revision 3ff01b231dfa83d518854c63e7c9cd1debd1139e)
1.include <src.opts.mk>
2
3.include "../../Makefile.inc"
4
5.include "../../Makefile.crypto"
6
7LIB=	wpacrypto
8INTERNALLIB=
9
10.PATH:	${WPA_DISTDIR}/src/crypto
11
12.if ${MK_OPENSSL} != "no"
13SRCS=	crypto_openssl.c \
14	random.c \
15	sha1-prf.c \
16	sha256-prf.c \
17	sha256-tlsprf.c \
18	sha512.c
19.else
20SRCS=	crypto_internal.c \
21	random.c
22.endif
23
24.if defined(TLS_FUNCS)
25.if defined(CONFIG_INTERNAL_TLS)
26SRCS+=	crypto_internal-cipher.c \
27	crypto_internal-modexp.c \
28	crypto_internal-rsa.c \
29	tls_internal.c
30.else
31SRCS+=	tls_openssl.c \
32	tls_openssl_ocsp.c
33.endif
34.endif
35
36.if defined(CONFIG_INTERNAL_AES)
37SRCS+=  aes-unwrap.c aes-wrap.c \
38        aes-internal.c \
39        aes-internal-dec.c \
40        aes-internal-enc.c
41.else
42.endif
43
44.if defined(NEED_AES_CBC)
45SRCS+=	aes-cbc.c
46.endif
47
48.if defined(NEED_AES_EAX)
49SRCS+=	aes-eax.c
50.endif
51
52.if defined(NEED_AES_CTR)
53SRCS+=	aes-ctr.c
54.endif
55
56.if defined(NEED_AES_ENCBLOCK)
57SRCS+=	aes-encblock.c
58.endif
59
60.if defined(NEED_AES_OMAC1)
61SRCS+=	aes-omac1.c
62.endif
63
64.if defined(NEED_DES)
65.if defined(CONFIG_INTERNAL_DES)
66SRCS+=	des-internal.c
67.endif
68.endif
69
70.if defined(NEED_MD4)
71.if defined(CONFIG_INTERNAL_MD4)
72SRCS+=	md4-internal.c
73.endif
74.endif
75
76.if defined(CONFIG_INTERNAL_MD5)
77SRCS+=	md5.c \
78	md5-internal.c
79.endif
80
81.if defined(NEED_FIPS186_2_PRF)
82.if defined(CONFIG_INTERNAL_SHA1)
83SRCS+=	fips_prf_internal.c
84.else
85SRCS+=	fips_prf_openssl.c
86.endif
87.endif
88
89.if defined(CONFIG_INTERNAL_RC4)
90SRCS+=	rc4.c
91.endif
92
93.if defined(CONFIG_INTERNAL_SHA1)
94SRCS+=	sha1-internal.c \
95	sha1-pbkdf2.c \
96	sha1.c \
97	sha1-prf.c
98.endif
99
100.if defined(NEED_SHA256)
101SRCS+=	sha256.c
102.if defined(CONFIG_INTERNAL_SHA256)
103SRCS+=	sha256-internal.c \
104	sha256-prf.c
105.endif
106.endif
107
108.if defined(NEED_SHA384)
109SRCS+=	sha384.c
110.if defined(CONFIG_INTERNAL_SHA384)
111SRCS+=	sha384-internal.c \
112	sha384-prf.c
113.endif
114.endif
115
116.if defined(NEED_SHA512)
117SRCS+=	sha512.c
118.if defined(CONFIG_INTERNAL_SHA512)
119SRCS+=	sha512-internal.c \
120	sha512-prf.c
121.endif
122.endif
123
124.if defined(NEED_TLS_PRF)
125SRCS+=	sha1-tlsprf.c
126.endif
127
128.if defined(CONFIG_INTERNAL_DH5)
129.if defined(NEED_DH_GROUPS)
130SRCS+=	dh_group5.c
131.endif
132.endif
133
134.if defined(NEED_DH_GROUPS)
135SRCS+=	dh_groups.c
136.endif
137
138.if ${MK_WPA_SUPPLICANT_EAPOL} != "no"
139CFLAGS+=-DCONFIG_WPS \
140	-DCONFIG_HS20 \
141	-DCONFIG_INTERWORKING \
142	-DEAP_GTC \
143	-DEAP_LEAP \
144	-DEAP_MD5 \
145	-DEAP_MSCHAPv2 \
146	-DEAP_OTP \
147	-DEAP_PEAP \
148	-DEAP_PSK \
149	-DEAP_TLS \
150	-DEAP_TTLS \
151	-DEAP_WSC \
152	-DIEEE8021X_EAPOL
153SRCS+=	ms_funcs.c
154.endif
155
156CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \
157	-DCONFIG_TLS_INTERNAL_CLIENT \
158	-DCONFIG_TLS_INTERNAL_SERVER \
159	-DCONFIG_SHA256 \
160	-DCONFIG_SHA384 \
161	-DCONFIG_HMAC_SHA384_KDF \
162	-DCONFIG_INTERNAL_SHA384
163#CFLAGS+=-DALL_DH_GROUPS
164
165# We are only interested in includes at this point. Not libraries.
166LIBADD=
167
168.include <bsd.lib.mk>
169