git: 25ecdc7d5277 - main - wpa: Restructure wpa build
Cy Schubert
cy at FreeBSD.org
Tue Jun 1 02:40:17 UTC 2021
The branch main has been updated by cy:
URL: https://cgit.FreeBSD.org/src/commit/?id=25ecdc7d52770caf1c9b44b5ec11f468f6b636f3
commit 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3
Author: Cy Schubert <cy at FreeBSD.org>
AuthorDate: 2021-05-20 21:28:17 +0000
Commit: Cy Schubert <cy at FreeBSD.org>
CommitDate: 2021-06-01 02:39:16 +0000
wpa: Restructure wpa build
The current WPA build assumes a flat namespace. However the latest sources
from w1.fi now have a duplicate config.c, in two separate subdirectories.
The flat namespace will overwrite config.o with the output from the most
recently modified config.c, of which there are two of them.
This commit resolves this problem by building each component in
wpa's src subdirectory tree into its own .a archive, just as the w1.fi
upstream build as used by the port does. The advantages of this approach
are:
1. Duplicate source file names, i.e. config.c in the wpa_supplicant
direcory and another config.c in src/utils in the next wpa
will result in both compiles writing to the same .o file.
2. This restructure simplifies maintanence. A develper needs only to add
new files as identified by git status in the vendor branch to the
appropriate Makefile within the usr.sbin/wpa tree. This also reduces
time required to prepare a new import and should reduce error.
3. The new wpa build structure more closely represents the build as
performed by the upstream tarball.
This is in preparation for the next wpa update from w1.fi.
Reviewed by: philip
Tested by: philip
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D30372
---
share/mk/src.libnames.mk | 62 +++++++++++++-
usr.sbin/wpa/Makefile | 9 ++-
usr.sbin/wpa/Makefile.crypto | 104 ------------------------
usr.sbin/wpa/Makefile.inc | 92 +++++++++++++++++----
usr.sbin/wpa/hostapd/Makefile | 153 ++---------------------------------
usr.sbin/wpa/hostapd_cli/Makefile | 10 +--
usr.sbin/wpa/src/Makefile | 19 +++++
usr.sbin/wpa/src/ap/Makefile | 59 ++++++++++++++
usr.sbin/wpa/src/common/Makefile | 27 +++++++
usr.sbin/wpa/src/crypto/Makefile | 63 +++++++++++++++
usr.sbin/wpa/src/drivers/Makefile | 21 +++++
usr.sbin/wpa/src/eap_common/Makefile | 25 ++++++
usr.sbin/wpa/src/eap_peer/Makefile | 33 ++++++++
usr.sbin/wpa/src/eap_server/Makefile | 34 ++++++++
usr.sbin/wpa/src/eapol_auth/Makefile | 18 +++++
usr.sbin/wpa/src/eapol_supp/Makefile | 19 +++++
usr.sbin/wpa/src/l2_packet/Makefile | 19 +++++
usr.sbin/wpa/src/radius/Makefile | 24 ++++++
usr.sbin/wpa/src/rsn_supp/Makefile | 26 ++++++
usr.sbin/wpa/src/tls/Makefile | 38 +++++++++
usr.sbin/wpa/src/utils/Makefile | 32 ++++++++
usr.sbin/wpa/src/wps/Makefile | 39 +++++++++
usr.sbin/wpa/wpa_cli/Makefile | 33 ++++----
usr.sbin/wpa/wpa_passphrase/Makefile | 7 +-
usr.sbin/wpa/wpa_priv/Makefile | 9 +--
usr.sbin/wpa/wpa_supplicant/Makefile | 91 ++++++---------------
26 files changed, 700 insertions(+), 366 deletions(-)
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index 75eafa374245..db76fdd0486c 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -64,7 +64,22 @@ _INTERNALLIBS= \
smdb \
smutil \
telnet \
- vers
+ vers \
+ wpaap \
+ wpacommon \
+ wpacrypto \
+ wpadrivers \
+ wpaeap_common \
+ wpaeap_peer \
+ wpaeap_server \
+ wpaeapol_auth \
+ wpaeapol_supp \
+ wpal2_packet \
+ wparadius \
+ wparsn_supp \
+ wpatls \
+ wpautils \
+ wpawps
_LIBRARIES= \
${_PRIVATELIBS} \
@@ -583,6 +598,51 @@ LIBBE?= ${LIBBEDIR}/libbe${PIE_SUFFIX}.a
LIBPMCSTATDIR= ${_LIB_OBJTOP}/lib/libpmcstat
LIBPMCSTAT?= ${LIBPMCSTATDIR}/libpmcstat${PIE_SUFFIX}.a
+LIBWPAAPDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/ap
+LIBWPAAP?= ${LIBWPAAPDIR}/libwpaap${PIE_SUFFIX}.a
+
+LIBWPACOMMONDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/common
+LIBWPACOMMON?= ${LIBWPACOMMONDIR}/libwpacommon${PIE_SUFFIX}.a
+
+LIBWPACRYPTODIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/crypto
+LIBWPACRYPTO?= ${LIBWPACRYPTODIR}/libwpacrypto${PIE_SUFFIX}.a
+
+LIBWPADRIVERSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/drivers
+LIBWPADRIVERS?= ${LIBWPADRIVERSDIR}/libwpadrivers${PIE_SUFFIX}.a
+
+LIBWPAEAP_COMMONDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_common
+LIBWPAEAP_COMMON?= ${LIBWPAEAP_COMMONDIR}/libwpaeap_common${PIE_SUFFIX}.a
+
+LIBWPAEAP_PEERDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_peer
+LIBWPAEAP_PEER?= ${LIBWPAEAP_PEERDIR}/libwpaeap_peer${PIE_SUFFIX}.a
+
+LIBWPAEAP_SERVERDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_server
+LIBWPAEAP_SERVER?= ${LIBWPAEAP_SERVERDIR}/libwpaeap_server${PIE_SUFFIX}.a
+
+LIBWPAEAPOL_AUTHDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eapol_auth
+LIBWPAEAPOL_AUTH?= ${LIBWPAEAPOL_AUTHDIR}/libwpaeapol_auth${PIE_SUFFIX}.a
+
+LIBWPAEAPOL_SUPPDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/eapol_supp
+LIBWPAEAPOL_SUPP?= ${LIBWPAEAPOL_SUPPDIR}/libwpaeapol_supp${PIE_SUFFIX}.a
+
+LIBWPAL2_PACKETDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/l2_packet
+LIBWPAL2_PACKET?= ${LIBWPAL2_PACKETDIR}/libwpal2_packet${PIE_SUFFIX}.a
+
+LIBWPARADIUSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/radius
+LIBWPARADIUS?= ${LIBWPARADIUSDIR}/libwparadius${PIE_SUFFIX}.a
+
+LIBWPARSN_SUPPDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/rsn_supp
+LIBWPARSN_SUPP?= ${LIBWPARSN_SUPPDIR}/libwparsn_supp${PIE_SUFFIX}.a
+
+LIBWPATLSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/tls
+LIBWPATLS?= ${LIBWPATLSDIR}/libwpatls${PIE_SUFFIX}.a
+
+LIBWPAUTILSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/utils
+LIBWPAUTILS?= ${LIBWPAUTILSDIR}/libwpautils${PIE_SUFFIX}.a
+
+LIBWPAWPSDIR= ${_LIB_OBJTOP}/usr.sbin/wpa/src/wps
+LIBWPAWPS?= ${LIBWPAWPSDIR}/libwpawps${PIE_SUFFIX}.a
+
LIBC_NOSSP_PICDIR= ${_LIB_OBJTOP}/lib/libc
LIBC_NOSSP_PIC?= ${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a
diff --git a/usr.sbin/wpa/Makefile b/usr.sbin/wpa/Makefile
index 451c4c3b17a6..fe8fb60b1dc2 100644
--- a/usr.sbin/wpa/Makefile
+++ b/usr.sbin/wpa/Makefile
@@ -1,7 +1,12 @@
# $FreeBSD$
-SUBDIR= wpa_supplicant wpa_cli wpa_passphrase
-SUBDIR+= hostapd hostapd_cli
+SUBDIR= src .WAIT \
+ wpa_supplicant \
+ wpa_cli \
+ wpa_passphrase \
+ hostapd \
+ hostapd_cli \
+
SUBDIR_PARALLEL=
.include <bsd.subdir.mk>
diff --git a/usr.sbin/wpa/Makefile.crypto b/usr.sbin/wpa/Makefile.crypto
index bed452bf8592..a7ddb917ac6d 100644
--- a/usr.sbin/wpa/Makefile.crypto
+++ b/usr.sbin/wpa/Makefile.crypto
@@ -1,13 +1,10 @@
# $FreeBSD$
.if ${MK_OPENSSL} != "no"
-SRCS+= crypto_openssl.c random.c sha1-prf.c sha256-prf.c sha256-tlsprf.c \
- sha512.c
LIBADD+= ssl crypto
CFLAGS+= -DCONFIG_SHA256
.else
CFLAGS+=-DCONFIG_CRYPTO_INTERNAL
-SRCS+= crypto_internal.c random.c
CONFIG_INTERNAL_AES=y
CONFIG_INTERNAL_DES=y
CONFIG_INTERNAL_MD4=y
@@ -33,129 +30,28 @@ NEED_TLS_PRF=y
.if defined(CONFIG_INTERNAL_TLS)
CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \
-DCONFIG_TLS_INTERNAL_CLIENT
-SRCS+= asn1.c \
- bignum.c \
- crypto_internal-cipher.c \
- crypto_internal-modexp.c \
- crypto_internal-rsa.c \
- pkcs1.c \
- pkcs5.c \
- pkcs8.c \
- rsa.c \
- tls_internal.c \
- tlsv1_common.c \
- tlsv1_record.c \
- tlsv1_cred.c \
- tlsv1_client.c \
- tlsv1_client_write.c \
- tlsv1_client_read.c \
- tlsv1_client_ocsp.c \
- x509v3.c
NEED_DES=y
NEED_MD4=y
NEED_RC4=y
.else
CFLAGS+=-DEAP_TLS_OPENSSL
-SRCS+= tls_openssl.c tls_openssl_ocsp.c
.endif
.endif
-.if defined(CONFIG_INTERNAL_AES)
-SRCS+= aes-unwrap.c aes-wrap.c \
- aes-internal.c \
- aes-internal-dec.c \
- aes-internal-enc.c
-.endif
-
-.if defined(NEED_AES_CBC)
-SRCS+= aes-cbc.c
-.endif
-
.if defined(NEED_AES_EAX)
-SRCS+= aes-eax.c
NEED_AES_CTR=y
.endif
-.if defined(NEED_AES_CTR)
-SRCS+= aes-ctr.c
-.endif
-
-.if defined(NEED_AES_ENCBLOCK)
-SRCS+= aes-encblock.c
-.endif
-
-.if defined(NEED_AES_OMAC1)
-SRCS+= aes-omac1.c
-.endif
-
-.if defined(NEED_DES)
-.if defined(CONFIG_INTERNAL_DES)
-SRCS+= des-internal.c
-.endif
-.endif
-
-.if defined(NEED_MD4)
-.if defined(CONFIG_INTERNAL_MD4)
-SRCS+= md4-internal.c
-.endif
-.endif
-
-.if defined(CONFIG_INTERNAL_MD5)
-SRCS+= md5.c md5-internal.c
-.endif
-
-.if defined(NEED_FIPS186_2_PRF)
-.if defined(CONFIG_INTERNAL_SHA1)
-SRCS+= fips_prf_internal.c
-.else
-SRCS+= fips_prf_openssl.c
-.endif
-.endif
-
-.if defined(CONFIG_INTERNAL_RC4)
-SRCS+= rc4.c
-.endif
-
-.if defined(CONFIG_INTERNAL_SHA1)
-SRCS+= sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c
-.endif
-
.if defined(NEED_SHA256)
CFLAGS+=-DCONFIG_SHA256
-SRCS+= sha256.c
-.if defined(CONFIG_INTERNAL_SHA256)
-SRCS+= sha256-internal.c sha256-prf.c
-.endif
.endif
.if defined(NEED_SHA384)
CFLAGS+=-DCONFIG_SHA384
-SRCS+= sha384.c
-.if defined(CONFIG_INTERNAL_SHA384)
-SRCS+= sha384-internal.c sha384-prf.c
-.endif
.endif
.if defined(NEED_SHA512)
CFLAGS+=-DCONFIG_SHA512
-SRCS+= sha512.c
-.if defined(CONFIG_INTERNAL_SHA512)
-SRCS+= sha512-internal.c sha512-prf.c
-.endif
-.endif
-
-.if defined(NEED_TLS_PRF)
-SRCS+= sha1-tlsprf.c
-.endif
-
-.if defined(CONFIG_INTERNAL_DH5)
-.if defined(NEED_DH_GROUPS)
-SRCS+= dh_group5.c
-.endif
-.endif
-
-.if defined(NEED_DH_GROUPS)
-SRCS+= dh_groups.c
.endif
.if defined(NEED_DH_GROUPS_ALL)
diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc
index 0a69ca08166b..87a1d6c23bbc 100644
--- a/usr.sbin/wpa/Makefile.inc
+++ b/usr.sbin/wpa/Makefile.inc
@@ -1,5 +1,7 @@
# $FreeBSD$
+.include <src.opts.mk>
+
BINDIR?= /usr/sbin
WARNS?= 0
@@ -8,18 +10,7 @@ WPA_DISTDIR?= ${SRCTOP}/contrib/wpa/
WPA_SUPPLICANT_DISTDIR?=${WPA_DISTDIR}/wpa_supplicant
HOSTAPD_DISTDIR?= ${WPA_DISTDIR}/hostapd
-.PATH.c:${.CURDIR:H} \
- ${WPA_DISTDIR}/src/common \
- ${WPA_DISTDIR}/src/crypto \
- ${WPA_DISTDIR}/src/eapol_auth \
- ${WPA_DISTDIR}/src/eap_common \
- ${WPA_DISTDIR}/src/eapol_supp \
- ${WPA_DISTDIR}/src/l2_packet \
- ${WPA_DISTDIR}/src/radius \
- ${WPA_DISTDIR}/src/rsn_supp \
- ${WPA_DISTDIR}/src/tls \
- ${WPA_DISTDIR}/src/utils \
- ${WPA_DISTDIR}/src/wps
+.PATH.c:${.CURDIR:H}
CFLAGS+=-I${.CURDIR}
CFLAGS+=-I${HOSTAPD_DISTDIR}
@@ -31,9 +22,78 @@ CFLAGS+=-I${WPA_DISTDIR}/src/l2_packet
CFLAGS+=-I${WPA_DISTDIR}/src/utils
CFLAGS+=-I${WPA_DISTDIR}/src/wps
-CFLAGS+= -DCONFIG_CTRL_IFACE
-CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
-CFLAGS+= -DNEED_AP_MLME
-CFLAGS+= -DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\"
+CFLAGS+=-DCONFIG_DRIVER_BSD
+CFLAGS+=-DCONFIG_DRIVER_WIRED
+CFLAGS+=-DCONFIG_DRIVER_RADIUS_ACL
+CFLAGS+=-DCONFIG_CTRL_IFACE
+CFLAGS+=-DCONFIG_CTRL_IFACE_UNIX
+CFLAGS+=-DCONFIG_IEEE80211AC
+CFLAGS+=-DCONFIG_IEEE80211N
+CFLAGS+=-DCONFIG_IEEE80211R
+CFLAGS+=-DCONFIG_IEEE80211W
+CFLAGS+=-DCONFIG_IEEE80211AX
+CFLAGS+=-DNEED_AP_MLME
+CFLAGS+=-DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\"
+CFLAGS+=-DCONFIG_DEBUG_SYSLOG
+CFLAGS+=-DCONFIG_WPS
+CFLAGS+=-DCONFIG_WPS2
+CFLAGS+=-DCONFIG_WPS_UPNP
+CFLAGS+=-DCONFIG_WPS_OOB
+CFLAGS+=-DCONFIG_INTERWORKING
+CFLAGS+=-DPKCS12_FUNCS
+CFLAGS+=-DCONFIG_GAS
+CFLAGS+=-DCONFIG_PEERKEY
+CFLAGS+=-DCONFIG_PRIVSEP
+CFLAGS+=-DCONFIG_SMARTCARD
+CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF
+CFLAGS+=-DCONFIG_TLS=openssl
+CFLAGS+=-DCONFIG_MATCH_IFACE
+CFLAGS+=-DEAP_SERVER
+CFLAGS+=-DEAP_SERVER_GTC
+CFLAGS+=-DEAP_SERVER_IDENTITY
+CFLAGS+=-DEAP_SERVER_MD5
+CFLAGS+=-DEAP_SERVER_MSCHAPV2
+CFLAGS+=-DEAP_SERVER_PEAP
+CFLAGS+=-DEAP_SERVER_TLS
+CFLAGS+=-DEAP_SERVER_TTLS
+CFLAGS+=-DEAP_SERVER_WSC
+CFLAGS+=-DEAP_TLS_FUNCS
+
+.if ${MK_WPA_SUPPLICANT_EAPOL} != "no"
+CFLAGS+=-DCONFIG_HS20 \
+ -DEAP_GTC \
+ -DEAP_LEAP \
+ -DEAP_MD5 \
+ -DEAP_MSCHAPv2 \
+ -DEAP_OTP \
+ -DEAP_PEAP \
+ -DEAP_PSK \
+ -DEAP_TLS \
+ -DEAP_TTLS \
+ -DEAP_WSC \
+ -DIEEE8021X_EAPOL
+NEED_AES_EAX=y
+NEED_AES_ENCBLOCK=y
+NEED_AES_OMAC1=y
+.endif
+
+.if !empty(CFLAGS:M*-DEAP_AKA)
+NEED_SIM_COMMON=y
+NEED_AES_CBC=y
+.endif
+
+.if !empty(CFLAGS:M*-DEAP_SIM)
+NEED_SIM_COMMON=y
+NEED_AES_CBC=y
+.endif
+
+.if defined(NEED_SIM_COMMON)
+NEED_FIPS186_2_PRF=y
+.endif
+
+.if !empty(CFLAGS:M*-DEAP_GPSK)
+CFLAGS+=-DEAP_GPSK_SHA256
+NEED_AES_OMAC1=y
+.endif
.include <bsd.own.mk>
diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile
index 579694046989..6e026babae1a 100644
--- a/usr.sbin/wpa/hostapd/Makefile
+++ b/usr.sbin/wpa/hostapd/Makefile
@@ -3,96 +3,14 @@
.include <src.opts.mk>
.include "../Makefile.inc"
-.PATH.c:${HOSTAPD_DISTDIR} \
- ${WPA_DISTDIR}/src/ap \
- ${WPA_DISTDIR}/src/eap_server \
- ${WPA_DISTDIR}/src/eap_peer \
- ${WPA_DISTDIR}/src/drivers \
- ${WPA_DISTDIR}/wpa_supplicant
+.PATH.c:${HOSTAPD_DISTDIR}
PACKAGE= hostapd
PROG= hostapd
-SRCS= accounting.c \
- ap_config.c \
- ap_drv_ops.c \
- ap_list.c \
- ap_mlme.c \
- authsrv.c \
- base64.c \
- beacon.c \
- bss_load.c \
- chap.c \
- common.c \
- config_file.c \
+SRCS= config_file.c \
ctrl_iface.c \
- ctrl_iface_ap.c \
- ctrl_iface_common.c \
- dfs.c \
- driver_bsd.c \
- driver_common.c \
- drivers.c \
- drv_callbacks.c \
- eloop.c \
- gas.c \
- gas_serv.c \
- http_client.c \
- http_server.c \
- httpread.c \
- hostapd.c \
- hs20.c \
- hw_features.c \
- hw_features_common.c \
- ieee802_11.c \
- ieee802_11_auth.c \
- ieee802_11_common.c \
- ieee802_11_he.c \
- ieee802_11_ht.c \
- ieee802_11_shared.c \
- ieee802_11_vht.c \
- ieee802_1x.c \
- ip_addr.c \
- l2_packet_freebsd.c \
- main.c \
- mbo_ap.c \
- ms_funcs.c \
- neighbor_db.c \
- os_unix.c \
- pmksa_cache_auth.c \
- preauth_auth.c \
- radius.c \
- radius_client.c \
- radius_das.c \
- rrm.c \
- sta_info.c \
- tkip_countermeasures.c \
- upnp_xml.c \
- utils.c \
- uuid.c \
- vlan.c \
- vlan_ifconfig.c \
- vlan_init.c \
- wmm.c \
- wpa_auth.c \
- wpa_auth_glue.c \
- wpa_auth_ie.c \
- wpa_common.c \
- wpa_ctrl.c \
- wpa_debug.c \
- wpabuf.c \
- wps.c \
- wps_attr_build.c \
- wps_attr_process.c \
- wps_attr_parse.c \
- wps_common.c \
- wps_dev_attr.c \
- wps_enrollee.c \
- wps_hostapd.c \
- wps_registrar.c \
- wps_upnp.c \
- wps_upnp_ap.c \
- wps_upnp_event.c \
- wps_upnp_ssdp.c \
- wps_upnp_web.c
+ eap_register.c \
+ main.c
MAN= hostapd.8 hostapd.conf.5
@@ -104,26 +22,17 @@ FILES= hostapd.conf hostapd.eap_user hostapd.wpa_psk
CFLAGS+=-I${.CURDIR:H}/wpa_supplicant \
-I${WPA_DISTDIR}/src/eap_peer \
- -DCONFIG_DRIVER_BSD \
- -DCONFIG_DRIVER_RADIUS_ACL \
- -DCONFIG_HS20 \
-DCONFIG_MBO \
- -DCONFIG_IEEE80211N \
- -DCONFIG_IEEE80211W \
- -DCONFIG_IEEE80211AC \
- -DCONFIG_IEEE80211AX \
- -DCONFIG_INTERWORKING \
- -DCONFIG_PEERKEY \
-DCONFIG_RSN_PREAUTH \
- -DCONFIG_WPS \
- -DCONFIG_WPS2 \
- -DCONFIG_WPS_UPNP \
-DHOSTAPD
.if ${MK_INET6} != "no"
CFLAGS+= -DCONFIG_IPV6
.endif
#CFLAGS+= -g
-LIBADD+= pcap util
+LIBADD+= pcap util wpaap wpacommon wpacrypto \
+ wpadrivers wpal2_packet wpaeap_common wpaeap_server \
+ wpaeapol_auth \
+ wparadius wpatls wpautils wpawps
# User customizations for wpa_supplicant/hostapd build environment
CFLAGS+=${HOSTAPD_CFLAGS}
@@ -131,36 +40,6 @@ CFLAGS+=${HOSTAPD_CFLAGS}
LDADD+=${HOSTAPD_LDADD}
#LDFLAGS+=${HOSTAPD_LDFLAGS}
-CFLAGS+=-DDPKCS12_FUNCS \
- -DEAP_SERVER \
- -DEAP_SERVER_GTC \
- -DEAP_SERVER_IDENTITY \
- -DEAP_SERVER_MD5 \
- -DEAP_SERVER_MSCHAPV2 \
- -DEAP_SERVER_PEAP \
- -DEAP_SERVER_TLS \
- -DEAP_SERVER_TTLS \
- -DEAP_SERVER_WSC \
- -DEAP_TLS_FUNCS
-
-SRCS+= eap_server_gtc.c \
- eap_common.c \
- eap_peap_common.c \
- eap_register.c \
- eap_server.c \
- eap_server_identity.c \
- eap_server_md5.c \
- eap_server_methods.c \
- eap_server_mschapv2.c \
- eap_server_peap.c \
- eap_server_tls.c \
- eap_server_tls_common.c \
- eap_server_ttls.c \
- eap_server_wsc.c \
- eap_user_db.c \
- eap_wsc_common.c \
- eapol_auth_dump.c \
- eapol_auth_sm.c
TLS_FUNCS=y
# For WPS, EAP modes, etc
@@ -172,38 +51,22 @@ NEED_SIM_COMMON=y
.endif
.if !empty(CFLAGS:M*-DEAP_SERVER_AKA)
-SRCS+= eap_server_aka.c
NEED_SIM_COMMON=y
.endif
.if !empty(CFLAGS:M*-DEAP_SERVER_SIM)
-SRCS+= eap_server_sim.c
NEED_SIM_COMMON=y
.endif
.if defined(NEED_SIM_COMMON)
-SRCS+= eap_sim_common.c \
- eap_sim_db.c
NEED_FIPS186_2_PRF=y
.endif
.if !empty(CFLAGS:M*-DEAP_SERVER_GPSK)
CFLAGS+=-DEAP_GPSK_SHA256
-SRCS+= eap_server_gpsk.c \
- eap_gpsk_common.c
NEED_AES_OMAC1=y
.endif
-.if !empty(CFLAGS:M*-DEAP_SERVER_PAX)
-SRCS+= eap_server_pax.c \
- eap_pax_common.c
-.endif
-
-.if !empty(CFLAGS:M*-DEAP_SERVER_SAKE)
-SRCS+= eap_server_sake.c \
- eap_sake_common.c
-.endif
-
.include "../Makefile.crypto"
.include <bsd.prog.mk>
diff --git a/usr.sbin/wpa/hostapd_cli/Makefile b/usr.sbin/wpa/hostapd_cli/Makefile
index eda50e222d2e..276e25058298 100644
--- a/usr.sbin/wpa/hostapd_cli/Makefile
+++ b/usr.sbin/wpa/hostapd_cli/Makefile
@@ -6,14 +6,12 @@
PACKAGE= hostapd
PROG= hostapd_cli
-SRCS= cli.c common.c edit.c eloop.c hostapd_cli.c os_unix.c \
- wpa_ctrl.c wpa_debug.c
+SRCS= hostapd_cli.c
-CFLAGS+= -DCONFIG_CTRL_IFACE
-CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
-
-LIBADD+= util
+LIBADD+= util wpacommon wpautils
MAN= hostapd_cli.8
+.include "../Makefile.crypto"
+
.include <bsd.prog.mk>
diff --git a/usr.sbin/wpa/src/Makefile b/usr.sbin/wpa/src/Makefile
new file mode 100644
index 000000000000..f21856ad23a2
--- /dev/null
+++ b/usr.sbin/wpa/src/Makefile
@@ -0,0 +1,19 @@
+SUBDIR= ap \
+ common \
+ crypto \
+ drivers \
+ eap_common \
+ eap_peer \
+ eap_server \
+ eapol_auth \
+ eapol_supp \
+ l2_packet \
+ radius \
+ rsn_supp \
+ tls \
+ utils \
+ wps
+
+SUBDIR_PARALLEL=
+
+.include <bsd.subdir.mk>
diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile
new file mode 100644
index 000000000000..edb2f1e9d089
--- /dev/null
+++ b/usr.sbin/wpa/src/ap/Makefile
@@ -0,0 +1,59 @@
+.include <src.opts.mk>
+
+.include "../../Makefile.inc"
+
+LIB= wpaap
+INTERNALLIB=
+
+.PATH: ${WPA_DISTDIR}/src/ap
+
+SRCS= accounting.c \
+ ap_config.c \
+ ap_drv_ops.c \
+ ap_list.c \
+ ap_mlme.c \
+ authsrv.c \
+ beacon.c \
+ bss_load.c \
+ ctrl_iface_ap.c \
+ dfs.c \
+ drv_callbacks.c \
+ eap_user_db.c \
+ gas_serv.c \
+ hostapd.c \
+ hs20.c \
+ hw_features.c \
+ ieee802_11.c \
+ ieee802_11_auth.c \
+ ieee802_11_he.c \
+ ieee802_11_ht.c \
+ ieee802_11_shared.c \
+ ieee802_11_vht.c \
+ ieee802_1x.c \
+ mbo_ap.c \
+ neighbor_db.c \
+ pmksa_cache_auth.c \
+ preauth_auth.c \
+ rrm.c \
+ sta_info.c \
+ tkip_countermeasures.c \
+ utils.c \
+ vlan.c \
+ vlan_ifconfig.c \
+ vlan_init.c \
+ wmm.c \
+ wpa_auth.c \
+ wpa_auth_glue.c \
+ wpa_auth_ie.c \
+ wps_hostapd.c
+
+CFLAGS+=-DCONFIG_MBO \
+ -DCONFIG_RSN_PREAUTH \
+ -DHOSTAPD
+
+.include "../../Makefile.crypto"
+
+# We are only interested in includes at this point. Not libraries.
+LIBADD=
+
+.include <bsd.lib.mk>
diff --git a/usr.sbin/wpa/src/common/Makefile b/usr.sbin/wpa/src/common/Makefile
new file mode 100644
index 000000000000..28c16ff9d31a
--- /dev/null
+++ b/usr.sbin/wpa/src/common/Makefile
@@ -0,0 +1,27 @@
+.include <src.opts.mk>
+
+.include "../../Makefile.inc"
+
+LIB= wpacommon
+INTERNALLIB=
+
+.PATH: ${WPA_DISTDIR}/src/common
+
+SRCS= cli.c \
+ ctrl_iface_common.c \
+ gas.c \
+ hw_features_common.c \
+ ieee802_11_common.c \
+ wpa_common.c \
+ wpa_ctrl.c
+
+CFLAGS+=-DCONFIG_SAE \
+ -DCONFIG_SUITE \
+ -DCONFIG_SUITEB
+
+.include "../../Makefile.crypto"
+
+# We are only interested in includes at this point. Not libraries.
+LIBADD=
+
+.include <bsd.lib.mk>
diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile
new file mode 100644
index 000000000000..d7e1304dc95e
--- /dev/null
+++ b/usr.sbin/wpa/src/crypto/Makefile
@@ -0,0 +1,63 @@
+.include <src.opts.mk>
+
+.include "../../Makefile.inc"
+
+LIB= wpacrypto
+INTERNALLIB=
+
+.PATH: ${WPA_DISTDIR}/src/crypto
+
+SRCS= aes-cbc.c \
+ aes-ctr.c \
+ aes-eax.c \
+ aes-encblock.c \
+ aes-internal.c \
+ aes-internal-dec.c \
+ aes-internal-enc.c \
+ aes-omac1.c \
+ aes-unwrap.c \
+ aes-wrap.c \
+ crypto_internal.c \
+ crypto_internal-cipher.c \
+ crypto_internal-modexp.c \
+ crypto_internal-rsa.c \
+ des-internal.c \
+ dh_group5.c \
+ dh_groups.c \
+ fips_prf_internal.c \
+ md4-internal.c \
+ md5.c \
+ md5-internal.c \
+ ms_funcs.c \
+ random.c \
+ rc4.c \
+ sha1.c \
+ sha1-internal.c \
+ sha1-pbkdf2.c \
+ sha1-prf.c \
+ sha1-tlsprf.c \
+ sha256.c \
+ sha256-prf.c \
+ sha256-tlsprf.c \
+ sha256-internal.c \
+ sha384.c \
+ sha384-prf.c \
+ sha384-internal.c \
+ sha512-internal.c \
+ tls_internal.c
+
+CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \
+ -DCONFIG_TLS_INTERNAL_CLIENT \
+ -DCONFIG_TLS_INTERNAL_SERVER \
+ -DCONFIG_SHA256 \
+ -DCONFIG_SHA384 \
+ -DCONFIG_HMAC_SHA384_KDF \
+ -DCONFIG_INTERNAL_SHA384
+#CFLAGS+=-DALL_DH_GROUPS
+
+.include "../../Makefile.crypto"
+
+# We are only interested in includes at this point. Not libraries.
+LIBADD=
+
+.include <bsd.lib.mk>
diff --git a/usr.sbin/wpa/src/drivers/Makefile b/usr.sbin/wpa/src/drivers/Makefile
new file mode 100644
index 000000000000..1800b651885f
--- /dev/null
+++ b/usr.sbin/wpa/src/drivers/Makefile
@@ -0,0 +1,21 @@
+.include <src.opts.mk>
+
+.include "../../Makefile.inc"
+
+LIB= wpadrivers
+INTERNALLIB=
+
+.PATH: ${WPA_DISTDIR}/src/drivers
+
+SRCS= drivers.c \
+ driver_bsd.c \
+ driver_common.c \
+ driver_wired.c \
+ driver_wired_common.c
+
+.include "../../Makefile.crypto"
+
+# We are only interested in includes at this point. Not libraries.
+LIBADD=
+
+.include <bsd.lib.mk>
diff --git a/usr.sbin/wpa/src/eap_common/Makefile b/usr.sbin/wpa/src/eap_common/Makefile
new file mode 100644
index 000000000000..4da89b221b36
--- /dev/null
+++ b/usr.sbin/wpa/src/eap_common/Makefile
@@ -0,0 +1,25 @@
+.include <src.opts.mk>
+
+.include "../../Makefile.inc"
+
+LIB= wpaeap_common
+INTERNALLIB=
+
+.PATH: ${WPA_DISTDIR}/src/eap_common
+
+SRCS= chap.c \
+ eap_common.c \
+ eap_gpsk_common.c \
+ eap_pax_common.c \
+ eap_peap_common.c \
+ eap_psk_common.c \
+ eap_sake_common.c \
+ eap_sim_common.c \
+ eap_wsc_common.c
+
+.include "../../Makefile.crypto"
+
+# We are only interested in includes at this point. Not libraries.
+LIBADD=
+
+.include <bsd.lib.mk>
diff --git a/usr.sbin/wpa/src/eap_peer/Makefile b/usr.sbin/wpa/src/eap_peer/Makefile
new file mode 100644
index 000000000000..524c7cf6c6f1
--- /dev/null
+++ b/usr.sbin/wpa/src/eap_peer/Makefile
@@ -0,0 +1,33 @@
+.include <src.opts.mk>
+
+.include "../../Makefile.inc"
+
+LIB= wpaeap_peer
+INTERNALLIB=
+
+.PATH: ${WPA_DISTDIR}/src/eap_peer
+
+SRCS= eap.c \
+ eap_gtc.c \
+ eap_leap.c \
+ eap_md5.c \
+ eap_methods.c \
+ eap_mschapv2.c \
+ eap_otp.c \
+ eap_peap.c \
+ eap_psk.c \
+ eap_tls.c \
+ eap_tls_common.c \
+ eap_ttls.c \
+ eap_wsc.c \
+ eap_methods.c \
+ mschapv2.c
+
+CFLAGS+=-DIEEE8021X_EAPOL
+
+.include "../../Makefile.crypto"
+
+# We are only interested in includes at this point. Not libraries.
+LIBADD=
+
+.include <bsd.lib.mk>
diff --git a/usr.sbin/wpa/src/eap_server/Makefile b/usr.sbin/wpa/src/eap_server/Makefile
new file mode 100644
index 000000000000..c5a4566bb444
--- /dev/null
+++ b/usr.sbin/wpa/src/eap_server/Makefile
@@ -0,0 +1,34 @@
+.include <src.opts.mk>
+
+.include "../../Makefile.inc"
+
+LIB= wpaeap_server
+INTERNALLIB=
+
+.PATH: ${WPA_DISTDIR}/src/eap_server
+
+SRCS= eap_server.c \
+ eap_server_aka.c \
+ eap_server_gpsk.c \
+ eap_server_gtc.c \
+ eap_server_identity.c \
+ eap_server_md5.c \
+ eap_server_methods.c \
+ eap_server_mschapv2.c \
+ eap_server_pax.c \
+ eap_server_peap.c \
+ eap_server_pwd.c \
+ eap_server_sake.c \
+ eap_server_sim.c \
+ eap_server_tls.c \
+ eap_server_tls_common.c \
+ eap_server_ttls.c \
+ eap_server_wsc.c \
*** 502 LINES SKIPPED ***
More information about the dev-commits-src-main
mailing list