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