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