git: d3564c5610c4 - main - security/wpa_supplicant: Update to 2.10

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Mon, 17 Jan 2022 17:01:08 UTC
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d3564c5610c4d94d97971a6b7e45a7c3e45454ee

commit d3564c5610c4d94d97971a6b7e45a7c3e45454ee
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-01-17 16:14:05 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-01-17 17:00:45 +0000

    security/wpa_supplicant: Update to 2.10
    
    The long awaited hostapd 2.10 is finally here.
---
 security/wpa_supplicant/Makefile                   | 10 +----
 security/wpa_supplicant/distinfo                   | 14 ++-----
 .../files/patch-src_drivers_driver__bsd.c          | 45 +++++++++-------------
 .../files/patch-src_radius_radius__client.c        | 12 ------
 security/wpa_supplicant/files/patch-src_utils_os.h | 17 ++++++++
 .../wpa_supplicant/files/patch-src_wps_wps__upnp.c | 34 +++-------------
 .../files/patch-wpa__supplicant_pasn__supplicant.c | 14 +++++++
 7 files changed, 59 insertions(+), 87 deletions(-)

diff --git a/security/wpa_supplicant/Makefile b/security/wpa_supplicant/Makefile
index 7b23c34cd7cb..31acd83f3c14 100644
--- a/security/wpa_supplicant/Makefile
+++ b/security/wpa_supplicant/Makefile
@@ -1,16 +1,8 @@
 PORTNAME=	wpa_supplicant
-PORTVERSION=	2.9
-PORTREVISION=	11
+PORTVERSION=	2.10
 CATEGORIES=	security net
 MASTER_SITES=	https://w1.fi/releases/
 
-PATCH_SITES=	https://w1.fi/security/2020-1/ \
-		https://w1.fi/security/2021-1/
-PATCHFILES=	0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch:-p1 \
-		0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch:-p1 \
-		0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch:-p1 \
-		0001-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch:-p1
-
 MAINTAINER=	cy@FreeBSD.org
 COMMENT=	Supplicant (client) for WPA/802.1x protocols
 
diff --git a/security/wpa_supplicant/distinfo b/security/wpa_supplicant/distinfo
index ecea4c5cfca6..5cdea91002ec 100644
--- a/security/wpa_supplicant/distinfo
+++ b/security/wpa_supplicant/distinfo
@@ -1,11 +1,3 @@
-TIMESTAMP = 1615939959
-SHA256 (wpa_supplicant-2.9.tar.gz) = fcbdee7b4a64bea8177973299c8c824419c413ec2e3a95db63dd6a5dc3541f17
-SIZE (wpa_supplicant-2.9.tar.gz) = 3231785
-SHA256 (0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch) = 2d9a5b9d616f1b4aa4a22b967cee866e2f69b798b0b46803a7928c8559842bd7
-SIZE (0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch) = 5909
-SHA256 (0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch) = 49feb35a5276279b465f6836d6fa2c6b34d94dc979e8b840d1918865c04260de
-SIZE (0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch) = 2284
-SHA256 (0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch) = a8212a2d89a5bab2824d22b6047e7740553df163114fcec94832bfa9c5c5d78a
-SIZE (0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch) = 1553
-SHA256 (0001-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch) = 7f40cfec5faf5e927ea9028ab9392cd118685bde7229ad24210caf0a8f6e9611
-SIZE (0001-P2P-Fix-a-corner-case-in-peer-addition-based-on-PD-R.patch) = 1751
+TIMESTAMP = 1642435837
+SHA256 (wpa_supplicant-2.10.tar.gz) = 20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f
+SIZE (wpa_supplicant-2.10.tar.gz) = 3511622
diff --git a/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c b/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c
index 7c452ece7476..702e60d3b95c 100644
--- a/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c
+++ b/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c
@@ -1,30 +1,6 @@
---- src/drivers/driver_bsd.c.orig	2019-08-07 06:25:25.000000000 -0700
-+++ src/drivers/driver_bsd.c	2021-06-13 23:07:14.016849000 -0700
-@@ -649,7 +649,7 @@
- 		len = 2048;
- 	}
- 
--	return len;
-+	return (len == 0) ? 2048 : len;
- }
- 
- #ifdef HOSTAPD
-@@ -1080,7 +1080,14 @@
- 		mode = 0 /* STA */;
- 		break;
- 	case IEEE80211_MODE_IBSS:
-+		/*
-+		 * Ref bin/203086 - FreeBSD's net80211 currently uses
-+		 * IFM_IEEE80211_ADHOC.
-+		 */
-+#if 0
- 		mode = IFM_IEEE80211_IBSS;
-+#endif
-+		mode = IFM_IEEE80211_ADHOC;
- 		break;
- 	case IEEE80211_MODE_AP:
- 		mode = IFM_IEEE80211_HOSTAP;
-@@ -1336,14 +1343,18 @@
+--- src/drivers/driver_bsd.c.orig	2021-06-02 14:11:18.000000000 -0700
++++ src/drivers/driver_bsd.c	2021-06-13 23:08:54.275496000 -0700
+@@ -853,14 +853,18 @@
  		drv = bsd_get_drvindex(global, ifm->ifm_index);
  		if (drv == NULL)
  			return;
@@ -46,3 +22,18 @@
  			wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP",
  				   drv->ifname);
  			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,
+@@ -1220,7 +1224,14 @@
+ 		mode = 0 /* STA */;
+ 		break;
+ 	case IEEE80211_MODE_IBSS:
++		/*
++		 * Ref bin/203086 - FreeBSD's net80211 currently uses
++		 * IFM_IEEE80211_ADHOC.
++		 */
++#if 0
+ 		mode = IFM_IEEE80211_IBSS;
++#endif
++		mode = IFM_IEEE80211_ADHOC;
+ 		break;
+ 	case IEEE80211_MODE_AP:
+ 		mode = IFM_IEEE80211_HOSTAP;
diff --git a/security/wpa_supplicant/files/patch-src_radius_radius__client.c b/security/wpa_supplicant/files/patch-src_radius_radius__client.c
deleted file mode 100644
index de86947f57b2..000000000000
--- a/security/wpa_supplicant/files/patch-src_radius_radius__client.c
+++ /dev/null
@@ -1,12 +0,0 @@
---- src/radius/radius_client.c.orig	2019-08-07 06:25:25.000000000 -0700
-+++ src/radius/radius_client.c	2021-01-11 08:35:20.860835000 -0800
-@@ -814,6 +814,9 @@
- {
- 	struct radius_client_data *radius = eloop_ctx;
- 	struct hostapd_radius_servers *conf = radius->conf;
-+#if defined(__clang_major__) && __clang_major__ >= 11
-+#pragma GCC diagnostic ignored "-Wvoid-pointer-to-enum-cast"
-+#endif
- 	RadiusType msg_type = (RadiusType) sock_ctx;
- 	int len, roundtrip;
- 	unsigned char buf[3000];
diff --git a/security/wpa_supplicant/files/patch-src_utils_os.h b/security/wpa_supplicant/files/patch-src_utils_os.h
new file mode 100644
index 000000000000..e92661256d5f
--- /dev/null
+++ b/security/wpa_supplicant/files/patch-src_utils_os.h
@@ -0,0 +1,17 @@
+--- src/utils/os.h.orig	2016-09-17 20:36:13 UTC
++++ src/utils/os.h
+@@ -246,12 +246,14 @@ char * os_readfile(const char *name, siz
+  */
+ int os_file_exists(const char *fname);
+ 
++#if !defined __FreeBSD__ && !defined __DragonFly__
+ /**
+  * os_fdatasync - Sync a file's (for a given stream) state with storage device
+  * @stream: the stream to be flushed
+  * Returns: 0 if the operation succeeded or -1 on failure
+  */
+ int os_fdatasync(FILE *stream);
++#endif
+ 
+ /**
+  * os_zalloc - Allocate and zero memory
diff --git a/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c b/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
index 1c7035e9a77d..ee10b79e48aa 100644
--- a/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
+++ b/security/wpa_supplicant/files/patch-src_wps_wps__upnp.c
@@ -1,34 +1,12 @@
---- src/wps/wps_upnp.c.orig	2020-06-08 14:40:50.402529000 -0700
-+++ src/wps/wps_upnp.c	2020-06-08 15:48:08.294830000 -0700
-@@ -861,7 +861,8 @@
- }
- 
- 
--#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
-+ || defined(__DragonFly__)
- #include <sys/sysctl.h>
- #include <net/route.h>
- #include <net/if_dl.h>
-@@ -950,7 +951,11 @@
- 				   errno, strerror(errno));
- 			goto fail;
- 		}
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+		addr = (struct sockaddr_in *) &req.ifr_addr;
-+#else
- 		addr = (struct sockaddr_in *) &req.ifr_netmask;
-+#endif
- 		netmask->s_addr = addr->sin_addr.s_addr;
- 	}
- 
-@@ -962,7 +967,8 @@
+--- src/wps/wps_upnp.c.orig	2021-03-16 13:50:10.000000000 -0700
++++ src/wps/wps_upnp.c	2021-03-18 12:49:19.537874000 -0700
+@@ -963,7 +963,8 @@
  		goto fail;
  	}
  	os_memcpy(mac, req.ifr_addr.sa_data, 6);
--#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
-+   || defined(__DragonFly__)
+-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) \
++	|| defined(__DragonFly__)
  	if (eth_get(net_if, mac) < 0) {
  		wpa_printf(MSG_ERROR, "WPS UPnP: Failed to get MAC address");
  		goto fail;
diff --git a/security/wpa_supplicant/files/patch-wpa__supplicant_pasn__supplicant.c b/security/wpa_supplicant/files/patch-wpa__supplicant_pasn__supplicant.c
new file mode 100644
index 000000000000..f8a71213a120
--- /dev/null
+++ b/security/wpa_supplicant/files/patch-wpa__supplicant_pasn__supplicant.c
@@ -0,0 +1,14 @@
+--- wpa_supplicant/pasn_supplicant.c.orig	2021-04-10 02:48:08.000000000 -0700
++++ wpa_supplicant/pasn_supplicant.c	2021-04-12 10:44:14.939212000 -0700
+@@ -1079,7 +1079,11 @@
+ 	pasn->group = group;
+ 	pasn->freq = freq;
+ 
++#ifdef CONFIG_TESTING_OPTIONS
+ 	if (wpa_s->conf->force_kdk_derivation ||
++#else
++	if (
++#endif
+ 	    (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_LTF &&
+ 	     ieee802_11_rsnx_capab(beacon_rsnxe, WLAN_RSNX_CAPAB_SECURE_LTF)))
+ 		pasn->kdk_len = WPA_KDK_MAX_LEN;