From nobody Fri Sep 13 23:06:22 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X590Z2vBmz5WCkP; Fri, 13 Sep 2024 23:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X590Z1G58z4YCv; Fri, 13 Sep 2024 23:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726268782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rt/aISU4L4x/CsA5icNvyRyk1LiphDvDMkU7AlQ5j3U=; b=V0FBqVFlmHxWiWspmCfNAGtCzFysc4uSOuRQkaojc9GngdZP8NMPsnwTHLaVjUH/MPaSlQ mSEnnPFL6N9l98P7nDqhZvLiTN/Imjp9MAb8T/7quo3ZKbrAJVYS67Nr6qI9vB5yDZZ+y7 1TYpVKtHe9YwDPAuT/RYXV1m5b1smoQ2j3Iyq8vRGHsEJIl5uuJYeTJKCn6eRhl557OlVh bK0KrqhBVQNkCkFGFvzpMKitSZ2zlgMUPeNZpn5FbuAzJr7aC6QK3iY6eh5XLSIBsi19JZ 7Ru+0EcOxFKw9IAv/AQMSGSsdMlRMqMbUffH+gQ2xT4hWbOMk0b+vORyS92QgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726268782; a=rsa-sha256; cv=none; b=OGXIL/lsClrqNcp7ciRx3/UHm6NcFy20R3fU7gQBbCvZxraUk4L7ACbZD1d6Vu8t0DKSVO kyeDVtug3UphMWWlHq5rDI9aeBKuV04R9cOb4khtyI5JAIZd2ZapYwlBqyiPkCXUmTEEKr J6jR8QJ7lF7r+2kjdEPuwcGb1ZwzGdbs/OtHp9MxpVxITipbzZFyXvVqBgLd/BIIU8sAVj 2De66yjXF6q2A0gHhsJgpwBxOFwkg0PmUCI5VKQ7EisoxjOngECfq9NbIJeFLBzPdBmmAe osJ84rfroAyt8e+bY3tps0o5fiiMSnZJnzDkHv79d2R8FG29N5TeWXIgcvU4rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726268782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rt/aISU4L4x/CsA5icNvyRyk1LiphDvDMkU7AlQ5j3U=; b=ZfYUwXkFYJJOpSKdDmxNpJIs3pzwHNkNfu10FyjmfTNm3IEoZazW/I3Gvn+Pejf1AhJS5y vE7j8FLWDUAC6qZx9hqoJgCYmf5gtwJCqVB8FQZNHvwSG2jiI4tBHZrO2JlPt0mYsJFYDf Ubn9oIYcIPiwg7z0Xck/SvBzzSWDpL+rFvheu83jl+k5PtVvEjdJBjs26mNjepNXFZ7ZT2 ZCkfnViXz0PvcdBWYxGmUgjLjnBucfenluAplCWpNfcj0pBie8J61lemTGSqG70nWBa6I+ 033DMNSVj7WgnhvXptc+/z/QlSGa5qeUNkysfIRpcrHmQyt637BdIulnDEfBEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X590Z0qqBz12cS; Fri, 13 Sep 2024 23:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48DN6MoW068192; Fri, 13 Sep 2024 23:06:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48DN6M5I068189; Fri, 13 Sep 2024 23:06:22 GMT (envelope-from git) Date: Fri, 13 Sep 2024 23:06:22 GMT Message-Id: <202409132306.48DN6M5I068189@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 6e3f2dcc1080 - main - security/wpa_supplicant-devel: Sync driver_bsd.c with base system List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e3f2dcc1080607a48e5bfff02a940891fb47c63 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=6e3f2dcc1080607a48e5bfff02a940891fb47c63 commit 6e3f2dcc1080607a48e5bfff02a940891fb47c63 Author: Cy Schubert AuthorDate: 2024-09-13 23:03:42 +0000 Commit: Cy Schubert CommitDate: 2024-09-13 23:03:42 +0000 security/wpa_supplicant-devel: Sync driver_bsd.c with base system Replace driver_bsd.c with the one from src. It utilizes facilities and features already in FreeBSD. --- security/wpa_supplicant-devel/Makefile | 1 + .../files/patch-src_drivers_driver__bsd.c | 83 ++++++++-------------- 2 files changed, 30 insertions(+), 54 deletions(-) diff --git a/security/wpa_supplicant-devel/Makefile b/security/wpa_supplicant-devel/Makefile index 64401457be82..cf2d7ba2173d 100644 --- a/security/wpa_supplicant-devel/Makefile +++ b/security/wpa_supplicant-devel/Makefile @@ -1,5 +1,6 @@ PORTNAME= wpa_supplicant PORTVERSION= ${COMMIT_DATE} +PORTREVISION= 1 CATEGORIES= security net PKGNAMESUFFIX= -devel diff --git a/security/wpa_supplicant-devel/files/patch-src_drivers_driver__bsd.c b/security/wpa_supplicant-devel/files/patch-src_drivers_driver__bsd.c index 11c7346d866b..51293391dff4 100644 --- a/security/wpa_supplicant-devel/files/patch-src_drivers_driver__bsd.c +++ b/security/wpa_supplicant-devel/files/patch-src_drivers_driver__bsd.c @@ -1,5 +1,5 @@ ---- src/drivers/driver_bsd.c.orig 2023-09-05 10:38:47.000000000 -0700 -+++ src/drivers/driver_bsd.c 2023-09-10 23:11:53.991722000 -0700 +--- src/drivers/driver_bsd.c.orig 2024-09-01 06:39:57.000000000 -0700 ++++ src/drivers/driver_bsd.c 2024-09-13 15:36:17.326062000 -0700 @@ -14,6 +14,7 @@ #include "driver.h" #include "eloop.h" @@ -19,10 +19,14 @@ struct ifreq ifr; os_memset(&ifr, 0, sizeof(ifr)); -@@ -306,7 +308,34 @@ - return -1; - } - drv->flags = ifr.ifr_flags; +@@ -302,10 +304,37 @@ + + if (ioctl(drv->global->sock, SIOCGIFFLAGS, &ifr) < 0) { + wpa_printf(MSG_ERROR, "ioctl[SIOCGIFFLAGS]: %s", ++ strerror(errno)); ++ return -1; ++ } ++ drv->flags = ifr.ifr_flags; + + + if (enable) { @@ -37,23 +41,22 @@ + + if (ioctl(drv->global->sock, SIOCSIFFLAGS, &ifr) < 0) { + wpa_printf(MSG_ERROR, "ioctl[SIOCSIFFLAGS]: %s", -+ strerror(errno)); -+ return -1; -+ } + strerror(errno)); + return -1; + } + + wpa_printf(MSG_DEBUG, "%s: if %s (changed) enable %d IFF_UP %d ", + __func__, drv->ifname, enable, ((ifr.ifr_flags & IFF_UP) != 0)); + -+ drv->flags = ifr.ifr_flags; - return 0; + drv->flags = ifr.ifr_flags; ++ return 0; + +nochange: + wpa_printf(MSG_DEBUG, "%s: if %s (no change) enable %d IFF_UP %d ", + __func__, drv->ifname, enable, ((ifr.ifr_flags & IFF_UP) != 0)); -+ return 0; + return 0; } - static int @@ -525,7 +554,7 @@ __func__); return -1; @@ -164,7 +167,7 @@ break; case IEEE80211_MODE_AP: mode = IFM_IEEE80211_HOSTAP; -@@ -1251,24 +1317,33 @@ +@@ -1251,22 +1317,31 @@ ret = -1; if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0) ret = -1; @@ -177,6 +180,9 @@ - params->key_mgmt_suite == WPA_KEY_MGMT_NONE && - params->wpa_ie_len == 0); - wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy); +- +- if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) +- return -1; + if (params->wpa_ie_len) { + rsn_ie = get_ie(params->wpa_ie, params->wpa_ie_len, + WLAN_EID_RSN); @@ -196,7 +202,9 @@ + } + } -- if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) +- if (params->wpa_ie_len && +- set80211param(drv, IEEE80211_IOC_WPA, +- params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) + /* + * NB: interface must be marked UP for association + * or scanning (ap_scan=2) @@ -204,14 +212,7 @@ + if (bsd_ctrl_iface(drv, 1) < 0) return -1; -- if (params->wpa_ie_len && -- set80211param(drv, IEEE80211_IOC_WPA, -- params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) -- return -1; -- os_memset(&mlme, 0, sizeof(mlme)); - mlme.im_op = IEEE80211_MLME_ASSOC; - if (params->ssid != NULL) @@ -1311,11 +1386,8 @@ } @@ -225,33 +226,7 @@ #ifdef IEEE80211_IOC_SCAN_MAX_SSID os_memset(&sr, 0, sizeof(sr)); -@@ -1487,6 +1559,17 @@ - if (devcaps.dc_drivercaps & IEEE80211_C_WPA2) - drv->capa.key_mgmt = WPA_DRIVER_CAPA_KEY_MGMT_WPA2 | - WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK; -+#ifdef __FreeBSD__ -+ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 | -+ WPA_DRIVER_CAPA_ENC_WEP104 | -+ WPA_DRIVER_CAPA_ENC_TKIP | -+ WPA_DRIVER_CAPA_ENC_CCMP; -+#else -+ /* -+ * XXX -+ * FreeBSD exports hardware cryptocaps. These have no meaning for wpa -+ * since net80211 performs software crypto. -+ */ - - if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_WEP) - drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 | -@@ -1495,6 +1578,7 @@ - drv->capa.enc |= WPA_DRIVER_CAPA_ENC_TKIP; - if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM) - drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP; -+#endif - - if (devcaps.dc_drivercaps & IEEE80211_C_HOSTAP) - drv->capa.flags |= WPA_DRIVER_FLAGS_AP; -@@ -1547,6 +1631,8 @@ +@@ -1547,6 +1619,8 @@ } if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP) return IEEE80211_M_HOSTAP; @@ -260,7 +235,7 @@ if (ifmr.ifm_current & IFM_IEEE80211_MONITOR) return IEEE80211_M_MONITOR; #ifdef IEEE80211_M_MBSS -@@ -1607,7 +1693,7 @@ +@@ -1607,7 +1681,7 @@ drv->capa.key_mgmt_iftype[i] = drv->capa.key_mgmt; /* Down interface during setup. */ @@ -269,13 +244,13 @@ goto fail; /* Proven to work, lets go! */ -@@ -1630,6 +1716,9 @@ - +@@ -1631,6 +1705,9 @@ if (drv->ifindex != 0 && !drv->if_removed) { wpa_driver_bsd_set_wpa(drv, 0); -+ + + /* NB: mark interface down */ + bsd_ctrl_iface(drv, 0); - ++ wpa_driver_bsd_set_wpa_internal(drv, drv->prev_wpa, drv->prev_privacy); +