xref: /dragonfly/usr.sbin/802_11/Makefile.crypto (revision ef3ac1d1)
1# $FreeBSD: head/usr.sbin/wpa/Makefile.crypto 252726 2013-07-04 21:12:58Z rpaulo $
2
3#.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)
4SRCS+=	crypto_openssl.c random.c sha1-prf.c sha256-prf.c
5DPADD+=	${LIBSSL} ${LIBCRYPTO}
6LDADD+=	-lssl -lcrypto
7CFLAGS+= -DCONFIG_SHA256
8#.else
9#CFLAGS+=-DCONFIG_CRYPTO_INTERNAL
10#SRCS+=	crypto_internal.c random.c
11#CONFIG_INTERNAL_AES=y
12#CONFIG_INTERNAL_DES=y
13#CONFIG_INTERNAL_MD4=y
14#CONFIG_INTERNAL_MD5=y
15#CONFIG_INTERNAL_RC4=y
16#CONFIG_INTERNAL_SHA1=y
17#NEED_SHA256=y
18#CONFIG_INTERNAL_SHA256=y
19#CONFIG_INTERNAL_TLS=y
20#CONFIG_INTERNAL_DH5=y
21#CONFIG_INTERNAL_DH=y
22#NEED_AES_ENC=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-internal.c \
58	aes-internal-dec.c \
59	aes-internal-enc.c
60.endif
61
62.if defined(NEED_AES_CBC)
63SRCS+=	aes-cbc.c
64.endif
65
66.if defined(NEED_AES_EAX)
67SRCS+=	aes-eax.c
68NEED_AES_CTR=y
69.endif
70
71.if defined(NEED_AES_CTR)
72SRCS+=	aes-ctr.c
73.endif
74
75.if defined(NEED_AES_ENCBLOCK)
76SRCS+=	aes-encblock.c
77.endif
78
79.if defined(NEED_AES_OMAC1)
80SRCS+=	aes-omac1.c
81.endif
82
83.if defined(NEED_DES)
84.if defined(CONFIG_INTERNAL_DES)
85SRCS+=	des-internal.c
86.endif
87.endif
88
89.if defined(NEED_MD4)
90.if defined(CONFIG_INTERNAL_MD4)
91SRCS+=	md4-internal.c
92.endif
93.endif
94
95.if defined(CONFIG_INTERNAL_MD5)
96SRCS+=	md5-internal.c
97.endif
98
99.if defined(NEED_FIPS186_2_PRF)
100.if defined(CONFIG_INTERNAL_SHA1)
101SRCS+=	fips_prf_internal.c
102.else
103SRCS+=	fips_prf_openssl.c
104.endif
105.endif
106
107.if defined(CONFIG_INTERNAL_RC4)
108SRCS+=	rc4.c
109.endif
110
111.if defined(CONFIG_INTERNAL_SHA1)
112SRCS+=	sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c
113.endif
114
115.if defined(NEED_SHA256)
116CFLAGS+=-DCONFIG_SHA256
117SRCS+=	sha256.c
118.if defined(CONFIG_INTERNAL_SHA256)
119SRCS+=	sha256-internal.c sha256-prf.c
120.endif
121.endif
122
123.if defined(NEED_TLS_PRF)
124SRCS+=	sha1-tlsprf.c
125.endif
126
127.if defined(CONFIG_INTERNAL_DH5)
128SRCS+=	dh_group5.c
129.endif
130
131.if defined(CONFIG_INTERNAL_DH)
132SRCS+=	dh_groups.c
133.endif
134