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