From nobody Mon Jul 15 18:46:38 2024 X-Original-To: dev-commits-src-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 4WNB4Z5VGYz5RSBd; Mon, 15 Jul 2024 18:46:38 +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 4WNB4Z508Rz4QZJ; Mon, 15 Jul 2024 18:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721069198; 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=ofI+1mYPVlBQCzjLcQ+7Nz2nVNQ5QUIDBi6PgiHF5ak=; b=IbyflN9JykeVMpxXlxq/4JDZ6XQwFLkL5afXsSRZnlyUY9PBb6ohLqYYG3sIeloNCR4Zln cTTkUBhFB1kCy4BGkA835yxAt7yYTTxZuFbUhSEWRI7RIsBhvDJAcnRJFX6s13GnUsSXXJ mG5S0iO+SdWrWVP2NReRN7q44UB46torpfbOEpV4emfGZjdS97w6uoeI60Q2DwfAY+91s5 vgrTCBh/U5wNEztY0xTqg3fZsMGXeRXzozPjBY4v5z37yzMvmOII1x5HspGQVKi6U2U2tI YZf3C3Q36G6+c0He/H6aFqeJyhPJlc+5z1I5w0efHPg1r9a4z5/kuCVjfYAhVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721069198; a=rsa-sha256; cv=none; b=j2tK/sUUA7xoHm/KI8FN5eZNVFlmZiX8tEWANtNEJsfSvfAdZ/ilxEc1KmQUapnIsDFwrX hfXH52iu0i4Brj3jSmVUwSukvd0pUXbIO3PxA+BTsznzBHetOJX4WTrRcWMGqO7b3hm6j+ Wiz6Gakd8WKM7dyovoydGoF7Luh7Ly96l3UdyW5+H4hryj3CZxggs/cN1xEO8KflNdsvmG vMTXATGQCUqeZJv8pVT1Gt3baP9Z0+EH2HHF28lLY+GVzD8iW7aOJk/9UDGRDRe8v0w2h3 C8T0K78U5K7KYBfyuO6htT2uKXwf7d+IotiqVQSPbvhoa3oXcYKi4/MuYfjHmA== 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=1721069198; 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=ofI+1mYPVlBQCzjLcQ+7Nz2nVNQ5QUIDBi6PgiHF5ak=; b=f0FNmhn2o26kyTmHqG9Wi5enZDl5sc4L/orJDsUyv5cQL+dOXnV1Sl50SL4MxPB6Q5obRg fD47AN4ty0/g/+J9LuHuRjrG9iLdcKtqcjZtDHuBDKcTU9PP2jmgs2f50k+lQS9/4dTvjS jEW5dclrNO5uPJtchFcuPPNeC+6nrfrzYC0tE7zyfUN38Dg0BWrqmUV7Bjli2iDVMnCn2x r9VJczFrYjPO0uGu7HsCkl83txKtCY66VryIMy5NfrzeT2rq6iFiNk8NN3FWi7KH89g7uY BFFjlnfNJOOmFl7HHh1U7JY8rN2c50Mjolf8y4fYwQsl2ZzEPA2N6doVpnIROg== 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 4WNB4Z4blNz13jm; Mon, 15 Jul 2024 18:46:38 +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 46FIkcWj087693; Mon, 15 Jul 2024 18:46:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FIkc3i087690; Mon, 15 Jul 2024 18:46:38 GMT (envelope-from git) Date: Mon, 15 Jul 2024 18:46:38 GMT Message-Id: <202407151846.46FIkc3i087690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 3ab5e2977883 - main - net80211: fix RSN capability parsing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ab5e29778835065d80cbb6610ece981ac65c4c7 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=3ab5e29778835065d80cbb6610ece981ac65c4c7 commit 3ab5e29778835065d80cbb6610ece981ac65c4c7 Author: Adrian Chadd AuthorDate: 2024-07-09 16:54:21 +0000 Commit: Adrian Chadd CommitDate: 2024-07-15 18:45:40 +0000 net80211: fix RSN capability parsing The RSN capability field may be the last two bytes in the IE. 802.11-2016 9.4.2.25.1 (General) doesn't require anything afterwards - the PMKID/List and Group Management Cipher Suite are optional. Thus having a check of len > 2 will miss the situation where it IS the last field. This showed up when developing MFP, as I'm using optional MFP at home and optional MFP doesn't encrypt group management frames. (It should only add the BIP message integrity check IE in each action frame.) Differential Revision: https://reviews.freebsd.org/D45936 --- sys/net80211/ieee80211_hostap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 82d8f8b2907b..1d741ca4d7bf 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -1539,9 +1539,14 @@ ieee80211_parse_rsn(struct ieee80211vap *vap, const uint8_t *frm, rsn->rsn_keymgmt = RSN_ASE_8021X_PSK; /* optional RSN capabilities */ - if (len > 2) + if (len >= 2) { rsn->rsn_caps = le16dec(frm); - /* XXXPMKID */ + frm += 2, len -= 2; + } + + /* XXX PMK Count / PMKID */ + + /* XXX Group Cipher Management Suite */ return 0; }