aboutsummaryrefslogtreecommitdiff
path: root/security/wpa_supplicant
diff options
context:
space:
mode:
authorCraig Leres <leres@FreeBSD.org>2020-04-22 03:37:45 +0000
committerCraig Leres <leres@FreeBSD.org>2020-04-22 03:37:45 +0000
commit7b4de10579f1eb21d2eb6e1d96030c3ee68d7e23 (patch)
tree2ade3acded5f9a9ff3a1ec5979bb5ef1c78c6d5c /security/wpa_supplicant
parent58e4e827dfa1f3b0f36dda562cce87d9f88873fa (diff)
downloadports-7b4de10579f1eb21d2eb6e1d96030c3ee68d7e23.tar.gz
ports-7b4de10579f1eb21d2eb6e1d96030c3ee68d7e23.zip
security/wpa_supplicant: Add EAPOL_TEST option
Add an option option to builds and installs the eapol_test program. Update/patch to solve new compilation errors that result with the option enabled. Note: Leaving the changes to Packet32.c out of the PR patch set as it is not needed. PR: 245809 Approved by: cy (maintainer)
Notes
Notes: svn path=/head/; revision=532442
Diffstat (limited to 'security/wpa_supplicant')
-rw-r--r--security/wpa_supplicant/Makefile19
-rw-r--r--security/wpa_supplicant/files/ntddndis.h4
-rw-r--r--security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c67
-rw-r--r--security/wpa_supplicant/pkg-plist1
4 files changed, 85 insertions, 6 deletions
diff --git a/security/wpa_supplicant/Makefile b/security/wpa_supplicant/Makefile
index 33a258b40ef3..e4c8aac050fe 100644
--- a/security/wpa_supplicant/Makefile
+++ b/security/wpa_supplicant/Makefile
@@ -2,7 +2,7 @@
PORTNAME= wpa_supplicant
PORTVERSION= 2.9
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= security net
MASTER_SITES= https://w1.fi/releases/
@@ -39,7 +39,7 @@ OPTIONS_DEFINE= WPS WPS_ER WPS_NOREG WPS_NFC WPS_UPNP PKCS12 SMARTCARD \
HT_OVERRIDES VHT_OVERRIDES TLSV12 IEEE80211W \
IEEE80211R DEBUG_FILE DEBUG_SYSLOG PRIVSEP \
DELAYED_MIC IEEE80211N IEEE80211AC INTERWORKING \
- IEEE8021X_EAPOL \
+ IEEE8021X_EAPOL EAPOL_TEST \
HS20 NO_ROAMING P2P TDLS DBUS DOCS
OPTIONS_DEFAULT= BSD WIRED NDIS \
TLS PEAP TTLS MD5 MSCHAPV2 GTC LEAP OTP PSK \
@@ -63,6 +63,7 @@ IEEE80211N_DESC= High Throughput, AP mode (IEEE 802.11n)
IEEE80211R_DESC= Fast BSS Transition (IEEE 802.11r-2008)
IEEE80211W_DESC= Management Frame Protection (IEEE 802.11w)
IEEE8021X_EAPOL_DESC= EAP over LAN support
+EAPOL_TEST_DESC= Development testing
DEBUG_FILE_DESC= Support for writing debug log to a file
DEBUG_SYSLOG_DESC= Send debug messages to syslog instead of stdout
PRIVSEP_DESC= Privilege separation
@@ -148,7 +149,7 @@ post-patch:
.endif
.for simple in WPS WPS_ER WPS_NFC WPS_UPNP PKCS12 SMARTCARD HT_OVERRIDES \
VHT_OVERRIDES TLSV12 IEEE80211AC IEEE80211N IEEE80211R IEEE80211W \
- IEEE8021X_EAPOL \
+ IEEE8021X_EAPOL EAPOL_TEST \
INTERWORKING DEBUG_FILE DEBUG_SYSLOG HS20 NO_ROAMING PRIVSEP P2P TDLS
. if ${PORT_OPTIONS:M${simple}}
@${ECHO_CMD} CONFIG_${simple}=y >> ${CFG}
@@ -180,12 +181,24 @@ post-patch:
@${ECHO_CMD} CONFIG_L2_PACKET=freebsd >> ${CFG}
@${ECHO_CMD} CONFIG_TLS=openssl >> ${CFG}
+.if ${PORT_OPTIONS:MEAPOL_TEST}
+PLIST_SUB+= EAPOL_TEST=""
+.else
+PLIST_SUB+= EAPOL_TEST="@comment "
+.endif
+
+post-build-EAPOL_TEST-on:
+ cd ${BUILD_WRKSRC} && ${GMAKE} eapol_test
+
do-install:
(cd ${BUILD_WRKSRC} && ${INSTALL_PROGRAM} wpa_supplicant wpa_cli \
wpa_passphrase ${STAGEDIR}${PREFIX}/sbin)
${INSTALL_DATA} ${BUILD_WRKSRC}/wpa_supplicant.conf \
${STAGEDIR}${PREFIX}/etc/wpa_supplicant.conf.sample
+do-install-EAPOL_TEST-on:
+ ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/eapol_test ${STAGEDIR}${PREFIX}/sbin
+
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${BUILD_WRKSRC} && \
diff --git a/security/wpa_supplicant/files/ntddndis.h b/security/wpa_supplicant/files/ntddndis.h
index 0d7cde88e7ca..0af0ce858b03 100644
--- a/security/wpa_supplicant/files/ntddndis.h
+++ b/security/wpa_supplicant/files/ntddndis.h
@@ -11,7 +11,11 @@
#define UCHAR uint8_t
#define LONG int32_t
#define SHORT int16_t
+#if __FreeBSD__
+#define CHAR char
+#else
#define CHAR int8_t
+#endif
#define ULONGLONG uint64_t
#define LONGLONG int64_t
#define BOOLEAN uint8_t
diff --git a/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c b/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
index 56348691d494..5c58337c4b3d 100644
--- a/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
+++ b/security/wpa_supplicant/files/patch-src_drivers_driver__ndis.c
@@ -1,6 +1,67 @@
---- src/drivers/driver_ndis.c.orig 2015-03-15 17:30:39 UTC
+--- src/drivers/driver_ndis.c.orig 2019-08-07 13:25:25 UTC
+++ src/drivers/driver_ndis.c
-@@ -2110,7 +2110,11 @@ static int wpa_driver_ndis_get_names(str
+@@ -504,13 +504,13 @@ static int ndis_get_oid(struct wpa_drive
+ o->Length = len;
+
+ if (!PacketRequest(drv->adapter, FALSE, o)) {
+- wpa_printf(MSG_DEBUG, "%s: oid=0x%x len (%d) failed",
++ wpa_printf(MSG_DEBUG, "%s: oid=0x%x len (%lu) failed",
+ __func__, oid, len);
+ os_free(buf);
+ return -1;
+ }
+ if (o->Length > len) {
+- wpa_printf(MSG_DEBUG, "%s: oid=0x%x Length (%d) > len (%d)",
++ wpa_printf(MSG_DEBUG, "%s: oid=0x%x Length (%d) > len (%lu)",
+ __func__, oid, (unsigned int) o->Length, len);
+ os_free(buf);
+ return -1;
+@@ -573,7 +573,7 @@ static int ndis_set_oid(struct wpa_drive
+ os_memcpy(o->Data, data, len);
+
+ if (!PacketRequest(drv->adapter, TRUE, o)) {
+- wpa_printf(MSG_DEBUG, "%s: oid=0x%x len (%d) failed",
++ wpa_printf(MSG_DEBUG, "%s: oid=0x%x len (%lu) failed",
+ __func__, oid, len);
+ os_free(buf);
+ return -1;
+@@ -1531,7 +1531,7 @@ static void wpa_driver_ndis_event_auth(s
+
+ if (data_len < sizeof(*req)) {
+ wpa_printf(MSG_DEBUG, "NDIS: Too short Authentication Request "
+- "Event (len=%d)", data_len);
++ "Event (len=%lu)", data_len);
+ return;
+ }
+ req = (NDIS_802_11_AUTHENTICATION_REQUEST *) data;
+@@ -1565,7 +1565,7 @@ static void wpa_driver_ndis_event_pmkid(
+
+ if (data_len < 8) {
+ wpa_printf(MSG_DEBUG, "NDIS: Too short PMKID Candidate List "
+- "Event (len=%d)", data_len);
++ "Event (len=%lu)", data_len);
+ return;
+ }
+ pmkid = (NDIS_802_11_PMKID_CANDIDATE_LIST *) data;
+@@ -1587,7 +1587,7 @@ static void wpa_driver_ndis_event_pmkid(
+ os_memset(&event, 0, sizeof(event));
+ for (i = 0; i < pmkid->NumCandidates; i++) {
+ PMKID_CANDIDATE *p = &pmkid->CandidateList[i];
+- wpa_printf(MSG_DEBUG, "NDIS: %d: " MACSTR " Flags 0x%x",
++ wpa_printf(MSG_DEBUG, "NDIS: %lu: " MACSTR " Flags 0x%x",
+ i, MAC2STR(p->BSSID), (int) p->Flags);
+ os_memcpy(event.pmkid_candidate.bssid, p->BSSID, ETH_ALEN);
+ event.pmkid_candidate.index = i;
+@@ -1778,7 +1778,7 @@ static void wpa_driver_ndis_get_capabili
+ "overflow");
+ break;
+ }
+- wpa_printf(MSG_MSGDUMP, "NDIS: %d - auth %d encr %d",
++ wpa_printf(MSG_MSGDUMP, "NDIS: %lu - auth %d encr %d",
+ i, (int) ae->AuthModeSupported,
+ (int) ae->EncryptStatusSupported);
+ switch (ae->AuthModeSupported) {
+@@ -2106,7 +2106,11 @@ static int wpa_driver_ndis_get_names(str
dlen = dpos - desc;
else
dlen = os_strlen(desc);
@@ -13,7 +74,7 @@
os_free(b);
if (drv->adapter_desc == NULL)
return -1;
-@@ -2278,7 +2282,11 @@ static int wpa_driver_ndis_get_names(str
+@@ -2274,7 +2278,11 @@ static int wpa_driver_ndis_get_names(str
} else {
dlen = os_strlen(desc[i]);
}
diff --git a/security/wpa_supplicant/pkg-plist b/security/wpa_supplicant/pkg-plist
index df25d0ff16da..9c7a743d7dea 100644
--- a/security/wpa_supplicant/pkg-plist
+++ b/security/wpa_supplicant/pkg-plist
@@ -1,3 +1,4 @@
+%%EAPOL_TEST%%sbin/eapol_test
sbin/wpa_supplicant
sbin/wpa_passphrase
sbin/wpa_cli