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