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