xref: /freebsd/usr.sbin/wpa/Makefile.crypto (revision 1f4bcc459a76b7aa664f3fd557684cd0ba6da352)
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
24
25.if defined(TLS_FUNCS)
26NEED_TLS_PRF=y
27.if defined(CONFIG_INTERNAL_TLS)
28CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \
29	-DCONFIG_TLS_INTERNAL_CLIENT
30SRCS+=	asn1.c \
31	bignum.c \
32	crypto_internal-cipher.c \
33	crypto_internal-modexp.c \
34	crypto_internal-rsa.c \
35	pkcs1.c \
36	pkcs5.c \
37	pkcs8.c \
38	rsa.c \
39	tls_internal.c \
40	tlsv1_common.c \
41	tlsv1_record.c \
42	tlsv1_cred.c \
43	tlsv1_client.c \
44	tlsv1_client_write.c \
45	tlsv1_client_read.c \
46	x509v3.c
47NEED_DES=y
48NEED_MD4=y
49NEED_RC4=y
50.else
51CFLAGS+=-DEAP_TLS_OPENSSL
52SRCS+=	tls_openssl.c
53.endif
54.endif
55
56.if defined(CONFIG_INTERNAL_AES)
57SRCS+=	aes-unwrap.c aes-wrap.c \
58	aes-internal.c \
59	aes-internal-dec.c \
60	aes-internal-enc.c
61.endif
62
63.if defined(NEED_AES_CBC)
64SRCS+=	aes-cbc.c
65.endif
66
67.if defined(NEED_AES_EAX)
68SRCS+=	aes-eax.c
69NEED_AES_CTR=y
70.endif
71
72.if defined(NEED_AES_CTR)
73SRCS+=	aes-ctr.c
74.endif
75
76.if defined(NEED_AES_ENCBLOCK)
77SRCS+=	aes-encblock.c
78.endif
79
80.if defined(NEED_AES_OMAC1)
81SRCS+=	aes-omac1.c
82.endif
83
84.if defined(NEED_DES)
85.if defined(CONFIG_INTERNAL_DES)
86SRCS+=	des-internal.c
87.endif
88.endif
89
90.if defined(NEED_MD4)
91.if defined(CONFIG_INTERNAL_MD4)
92SRCS+=	md4-internal.c
93.endif
94.endif
95
96.if defined(CONFIG_INTERNAL_MD5)
97SRCS+=	md5.c md5-internal.c
98.endif
99
100.if defined(NEED_FIPS186_2_PRF)
101.if defined(CONFIG_INTERNAL_SHA1)
102SRCS+=	fips_prf_internal.c
103.else
104SRCS+=	fips_prf_openssl.c
105.endif
106.endif
107
108.if defined(CONFIG_INTERNAL_RC4)
109SRCS+=	rc4.c
110.endif
111
112.if defined(CONFIG_INTERNAL_SHA1)
113SRCS+=	sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c
114.endif
115
116.if defined(NEED_SHA256)
117CFLAGS+=-DCONFIG_SHA256
118SRCS+=	sha256.c
119.if defined(CONFIG_INTERNAL_SHA256)
120SRCS+=	sha256-internal.c sha256-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)
129SRCS+=	dh_group5.c
130.endif
131
132.if defined(CONFIG_INTERNAL_DH)
133SRCS+=	dh_groups.c
134.endif
135