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