xref: /freebsd/usr.sbin/wpa/Makefile.crypto (revision 3110d4ebd6c0848cf5e25890d01791bb407e2a9b)
1# $FreeBSD$
2
3.if ${MK_OPENSSL} != "no"
4SRCS+=	crypto_openssl.c random.c sha1-prf.c sha256-prf.c sha256-tlsprf.c \
5	sha512.c
6LIBADD+=	ssl crypto
7CFLAGS+= -DCONFIG_SHA256
8.else
9CFLAGS+=-DCONFIG_CRYPTO_INTERNAL
10SRCS+=	crypto_internal.c random.c
11CONFIG_INTERNAL_AES=y
12CONFIG_INTERNAL_DES=y
13CONFIG_INTERNAL_MD4=y
14CONFIG_INTERNAL_MD5=y
15CONFIG_INTERNAL_RC4=y
16CONFIG_INTERNAL_SHA1=y
17NEED_SHA256=y
18CONFIG_INTERNAL_SHA256=y
19NEED_SHA384=y
20CONFIG_INTERNAL_SHA384=y
21NEED_SHA512=y
22CONFIG_INTERNAL_SHA512=y
23CONFIG_INTERNAL_TLS=y
24NEED_DH_GROUPS=y
25CONFIG_INTERNAL_DH5=y
26NEED_AES_ENC=true
27NEED_AES_CBC=true
28.endif
29NEED_AES_OMAC1=true
30
31.if defined(TLS_FUNCS)
32NEED_TLS_PRF=y
33.if defined(CONFIG_INTERNAL_TLS)
34CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \
35	-DCONFIG_TLS_INTERNAL_CLIENT
36SRCS+=	asn1.c \
37	bignum.c \
38	crypto_internal-cipher.c \
39	crypto_internal-modexp.c \
40	crypto_internal-rsa.c \
41	pkcs1.c \
42	pkcs5.c \
43	pkcs8.c \
44	rsa.c \
45	tls_internal.c \
46	tlsv1_common.c \
47	tlsv1_record.c \
48	tlsv1_cred.c \
49	tlsv1_client.c \
50	tlsv1_client_write.c \
51	tlsv1_client_read.c \
52	tlsv1_client_ocsp.c \
53	x509v3.c
54NEED_DES=y
55NEED_MD4=y
56NEED_RC4=y
57.else
58CFLAGS+=-DEAP_TLS_OPENSSL
59SRCS+=	tls_openssl.c tls_openssl_ocsp.c
60.endif
61.endif
62
63.if defined(CONFIG_INTERNAL_AES)
64SRCS+=	aes-unwrap.c aes-wrap.c \
65	aes-internal.c \
66	aes-internal-dec.c \
67	aes-internal-enc.c
68.endif
69
70.if defined(NEED_AES_CBC)
71SRCS+=	aes-cbc.c
72.endif
73
74.if defined(NEED_AES_EAX)
75SRCS+=	aes-eax.c
76NEED_AES_CTR=y
77.endif
78
79.if defined(NEED_AES_CTR)
80SRCS+=	aes-ctr.c
81.endif
82
83.if defined(NEED_AES_ENCBLOCK)
84SRCS+=	aes-encblock.c
85.endif
86
87.if defined(NEED_AES_OMAC1)
88SRCS+=	aes-omac1.c
89.endif
90
91.if defined(NEED_DES)
92.if defined(CONFIG_INTERNAL_DES)
93SRCS+=	des-internal.c
94.endif
95.endif
96
97.if defined(NEED_MD4)
98.if defined(CONFIG_INTERNAL_MD4)
99SRCS+=	md4-internal.c
100.endif
101.endif
102
103.if defined(CONFIG_INTERNAL_MD5)
104SRCS+=	md5.c md5-internal.c
105.endif
106
107.if defined(NEED_FIPS186_2_PRF)
108.if defined(CONFIG_INTERNAL_SHA1)
109SRCS+=	fips_prf_internal.c
110.else
111SRCS+=	fips_prf_openssl.c
112.endif
113.endif
114
115.if defined(CONFIG_INTERNAL_RC4)
116SRCS+=	rc4.c
117.endif
118
119.if defined(CONFIG_INTERNAL_SHA1)
120SRCS+=	sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c
121.endif
122
123.if defined(NEED_SHA256)
124CFLAGS+=-DCONFIG_SHA256
125SRCS+=	sha256.c
126.if defined(CONFIG_INTERNAL_SHA256)
127SRCS+=	sha256-internal.c sha256-prf.c
128.endif
129.endif
130
131.if defined(NEED_SHA384)
132CFLAGS+=-DCONFIG_SHA384
133SRCS+=	sha384.c
134.if defined(CONFIG_INTERNAL_SHA384)
135SRCS+=	sha384-internal.c sha384-prf.c
136.endif
137.endif
138
139.if defined(NEED_SHA512)
140CFLAGS+=-DCONFIG_SHA512
141SRCS+=	sha512.c
142.if defined(CONFIG_INTERNAL_SHA512)
143SRCS+=	sha512-internal.c sha512-prf.c
144.endif
145.endif
146
147.if defined(NEED_TLS_PRF)
148SRCS+=	sha1-tlsprf.c
149.endif
150
151.if defined(CONFIG_INTERNAL_DH5)
152.if defined(NEED_DH_GROUPS)
153SRCS+=	dh_group5.c
154.endif
155.endif
156
157.if defined(NEED_DH_GROUPS)
158SRCS+=	dh_groups.c
159.endif
160
161.if defined(NEED_DH_GROUPS_ALL)
162CFLAGS+=-DALL_DH_GROUPS
163.endif
164