From patchwork Fri Oct 21 19:12:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015292 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9BE63D60 for ; Fri, 21 Oct 2022 19:13:28 +0000 (UTC) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1322fa1cf6fso4734271fac.6 for ; Fri, 21 Oct 2022 12:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BvKparpnqvtlI4sRbU8mDai6LxgQBlWgu6knBjgz+jc=; b=Jb898tm3NGAkBvkNp2fwWHODgh2GcxMO6Szb6NxNdXmN/JdOYl7fn+kIHRg0gkHwuX uKvKiR8UNbzMXfjZKSICsNBlFTdp48UwFOynL7C4z9F7/gkZ7358SHygovImPpZB3PMO cq5i62EJiBmUEl8qNxNLWTGHeGb7/nblNtR7TTvAJPum0NSehDsNL3Z7tSQiePK7VR2l 7RoZfq423PlzW44TYRJRhFnECjKpfzSWp3H34OIR+b7p6xPnUiL8iEhBqT35f8T6FZ87 BKsgUZb54iH22b19gd9IHblWAV0NTZFxPw2+CZAOnRYbB4rdtOSmmu6tO3WH309NoRc6 qYAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BvKparpnqvtlI4sRbU8mDai6LxgQBlWgu6knBjgz+jc=; b=4pQxm9bWzAKmynca0BaoRe7AMvvUEf5ErS0Gq3CHkwKCHmoMc3gE/2A7f2BAXoDtlc lRAVszeuv7gIw3GAUIvve2pmqkDcp7h15vjK5v83DQI6ZSo+n+45oosD/eRR0au50nOl lwtLAJCIoNBzvZ1SbVe64CWAVLRwRLIB6ER3BGZC/1CJyqD2L8CSDsm3pkMn6J8ntCQ1 HnGI/sVoM79NiSVhNB4+6tLTDJW/VAPqjvZJ/qh/3pF0Gc83IPgmU5rFJaWRzuQ5/D9O /EP/VU5m++lHNeFZ92HwM+9HfKXElFVyTwRwIH05c+OBokRULI9y59TCpqFKQCa+7+At w37w== X-Gm-Message-State: ACrzQf1GdcFAxCd5AhYGGsbiqifBYTeLqrH9VRJ7f13p9QDnFKhJzvav C6/ahnT3PvpsLLYJ4ck2HIIj+kL4uts= X-Google-Smtp-Source: AMsMyM53TBli8Ytt1SnWa3NFExtJZe7Uzw8FClWdjfRXcLjh40T6varh6szHF9LKM5PbYpSJNmmJrw== X-Received: by 2002:a05:6871:1d5:b0:12b:239:ef00 with SMTP id q21-20020a05687101d500b0012b0239ef00mr13548617oad.85.1666379607185; Fri, 21 Oct 2022 12:13:27 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:26 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 01/26] eapol: More strictly validate key_descriptor_version Date: Fri, 21 Oct 2022 14:12:42 -0500 Message-Id: <20221021191307.31492-1-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/eapol.c | 38 +++++++++++++++++++++++--------------- src/eapolutil.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/eapolutil.h | 6 ++++++ 3 files changed, 73 insertions(+), 15 deletions(-) diff --git a/src/eapol.c b/src/eapol.c index e8bd5cdbf64b..c6439bb1302d 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -2238,12 +2238,14 @@ static void eapol_key_handle(struct eapol_sm *sm, const struct eapol_frame *frame, bool unencrypted) { + struct handshake_state *hs = sm->handshake; const struct eapol_key *ek; const uint8_t *kck; const uint8_t *kek; uint8_t *decrypted_key_data = NULL; size_t key_data_len = 0; uint64_t replay_counter; + uint8_t expected_key_descriptor_version; ek = eapol_key_validate((const uint8_t *) frame, sizeof(struct eapol_header) + @@ -2256,11 +2258,19 @@ static void eapol_key_handle(struct eapol_sm *sm, if (!ek->key_ack) return; + if (L_WARN_ON(eapol_key_descriptor_version_from_akm(hs->akm_suite, + hs->pairwise_cipher, + &expected_key_descriptor_version) < 0)) + return; + + if (L_WARN_ON(expected_key_descriptor_version != + ek->key_descriptor_version)) + return; + /* Further Descriptor Type check */ - if (!sm->handshake->wpa_ie && - ek->descriptor_type != EAPOL_DESCRIPTOR_TYPE_80211) + if (!hs->wpa_ie && ek->descriptor_type != EAPOL_DESCRIPTOR_TYPE_80211) return; - else if (sm->handshake->wpa_ie && + else if (hs->wpa_ie && ek->descriptor_type != EAPOL_DESCRIPTOR_TYPE_WPA) return; @@ -2293,31 +2303,30 @@ static void eapol_key_handle(struct eapol_sm *sm, if (sm->have_replay && sm->replay_counter >= replay_counter) return; - kck = handshake_state_get_kck(sm->handshake); + kck = handshake_state_get_kck(hs); if (ek->key_mic) { /* Haven't received step 1 yet, so no ptk */ - if (!sm->handshake->have_snonce) + if (!hs->have_snonce) return; - if (!eapol_verify_mic(sm->handshake->akm_suite, kck, ek, - sm->mic_len)) + if (!eapol_verify_mic(hs->akm_suite, kck, ek, sm->mic_len)) return; } - if ((ek->encrypted_key_data && !sm->handshake->wpa_ie) || - (ek->key_type == 0 && sm->handshake->wpa_ie)) { + if ((ek->encrypted_key_data && !hs->wpa_ie) || + (ek->key_type == 0 && hs->wpa_ie)) { /* * If using a MIC (non-FILS) but haven't received step 1 yet * we disregard since there will be no ptk */ - if (sm->mic_len && !sm->handshake->have_snonce) + if (sm->mic_len && !hs->have_snonce) return; - kek = handshake_state_get_kek(sm->handshake); + kek = handshake_state_get_kek(hs); decrypted_key_data = eapol_decrypt_key_data( - sm->handshake->akm_suite, kek, + hs->akm_suite, kek, ek, &key_data_len, sm->mic_len); if (!decrypted_key_data) return; @@ -2326,11 +2335,10 @@ static void eapol_key_handle(struct eapol_sm *sm, if (ek->key_type == 0) { /* GTK handshake allowed only after PTK handshake complete */ - if (!sm->handshake->ptk_complete) + if (!hs->ptk_complete) goto done; - if (sm->handshake->group_cipher == - IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC) + if (hs->group_cipher == IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC) goto done; if (!decrypted_key_data) diff --git a/src/eapolutil.c b/src/eapolutil.c index e2a41c2e823f..3a0ef26e62bc 100644 --- a/src/eapolutil.c +++ b/src/eapolutil.c @@ -25,9 +25,11 @@ #endif #include +#include #include #include "src/eapolutil.h" +#include "src/ie.h" const struct eapol_key *eapol_key_validate(const uint8_t *frame, size_t len, size_t mic_len) @@ -80,3 +82,45 @@ const struct eapol_key *eapol_key_validate(const uint8_t *frame, size_t len, return ek; } + +int eapol_key_descriptor_version_from_akm(enum ie_rsn_akm_suite akm, + enum ie_rsn_cipher_suite pairwise, + uint8_t *outv) +{ + /* 802.11-2020 Section 12.7.2 */ + switch (akm) { + case IE_RSN_AKM_SUITE_8021X: + case IE_RSN_AKM_SUITE_PSK: + if (pairwise == IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER || + pairwise == IE_RSN_CIPHER_SUITE_TKIP) + *outv = EAPOL_KEY_DESCRIPTOR_VERSION_HMAC_MD5_ARC4; + else + *outv = EAPOL_KEY_DESCRIPTOR_VERSION_HMAC_SHA1_AES; + + return 0; + case IE_RSN_AKM_SUITE_FT_OVER_8021X: + case IE_RSN_AKM_SUITE_FT_USING_PSK: + case IE_RSN_AKM_SUITE_8021X_SHA256: + case IE_RSN_AKM_SUITE_PSK_SHA256: + *outv = EAPOL_KEY_DESCRIPTOR_VERSION_AES_128_CMAC_AES; + return 0; + case IE_RSN_AKM_SUITE_SAE_SHA256: + case IE_RSN_AKM_SUITE_FT_OVER_SAE_SHA256: + case IE_RSN_AKM_SUITE_8021X_SUITE_B_SHA256: + case IE_RSN_AKM_SUITE_8021X_SUITE_B_SHA384: + case IE_RSN_AKM_SUITE_FT_OVER_8021X_SHA384: + case IE_RSN_AKM_SUITE_FILS_SHA256: + case IE_RSN_AKM_SUITE_FILS_SHA384: + case IE_RSN_AKM_SUITE_FT_OVER_FILS_SHA256: + case IE_RSN_AKM_SUITE_FT_OVER_FILS_SHA384: + case IE_RSN_AKM_SUITE_OWE: + case IE_RSN_AKM_SUITE_OSEN: + *outv = EAPOL_KEY_DESCRIPTOR_VERSION_AKM_DEFINED; + return 0; + case IE_RSN_AKM_SUITE_TDLS: + case IE_RSN_AKM_SUITE_AP_PEER_KEY_SHA256: + break; + } + + return -ENOTSUP; +}; diff --git a/src/eapolutil.h b/src/eapolutil.h index 1f15872eb2d7..7451f69bedd8 100644 --- a/src/eapolutil.h +++ b/src/eapolutil.h @@ -25,6 +25,9 @@ #include #include +enum ie_rsn_akm_suite; +enum ie_rsn_cipher_suite; + enum eapol_protocol_version { EAPOL_PROTOCOL_VERSION_2001 = 1, EAPOL_PROTOCOL_VERSION_2004 = 2, @@ -116,3 +119,6 @@ struct eapol_key { const struct eapol_key *eapol_key_validate(const uint8_t *frame, size_t len, size_t mic_len); +int eapol_key_descriptor_version_from_akm(enum ie_rsn_akm_suite akm, + enum ie_rsn_cipher_suite pairwise, + uint8_t *out_version); From patchwork Fri Oct 21 19:12:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015293 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 594506121 for ; Fri, 21 Oct 2022 19:13:30 +0000 (UTC) Received: by mail-ot1-f49.google.com with SMTP id v40-20020a056830092800b00661e37421c2so2392332ott.3 for ; Fri, 21 Oct 2022 12:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aVC9tBnMvCp9s2xsTDifP6G9EbnosN/shOAAZgv8hdo=; b=DZFssaV+jOso+WdwmgTefWVNuyCs7IX+VzSxiy3YQtbLCZhe1yo7XjWHLUHlXJn1il QT/p75fh2u9JDMD4DFox39GQmxAMmeLXEdcJCDrtkFHajPLHFPLjRgpOjv8Y1s4XnFMD sHlX6HQZc9JhpwGJWCMUpEfO8MCD/uORuWXhbO0mamGycNZDXxT0V72iNonxYgvebnG8 k2yQZfzVUVrnsGnp/7XZAr41EvKLWkGpqxXx9xGodg5qSY1wDESslMeHuOvLBrsyWe7g aOwxYOzRucbSjTJAILSNNLyBzcfvhmThFQip8tdCbL4+BvgFCB3DSw/TdHPwWyd0rUmh F5pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aVC9tBnMvCp9s2xsTDifP6G9EbnosN/shOAAZgv8hdo=; b=AAQbKMC7VgK93cMQkTRdVzFVzAd3S/s6bBi3MzO7gi9eqC2+U0l++QGTqULIcm48n/ AF4ww0fms5dYrd0lgPbftNVUbziEqrMqHzYIyjNXX3TDXjmg2pIA9x/oQegwM4IEIQNP 5XLqoPL+jzpZLtgWG3FAnW2EKT+0AfI5N3Eb9iV8Glvir1V0d89gkBZRCWU8b74DibLy +r6Ul9y0g7QLeZX/Uc1FD/Z02pA6mGAp9uuVM/CA9pzArcXHcQyDP81HnAGLPsb24LRW zHm6daOYkaIlo9SavIlInFvKfm9jqN6CnW1OUz4I6n9/0xvDCSk7qmOsntwPak2ElYEx E4Pw== X-Gm-Message-State: ACrzQf0nk8k1FpKDUxFIPzmS+fOry7saJi9RuqQ3wbb7FWZzzyY6tf5x vEfaaH6egH1qzbZR17U8Rt2hTDlQBJs= X-Google-Smtp-Source: AMsMyM6lVpMHGDldptWhb63Bu6b/Va2YnVvN/b9qroIIOVXtZRaq1c3L0rgIS50OHa1skG2MysgtVg== X-Received: by 2002:a05:6830:43aa:b0:661:ae26:53eb with SMTP id s42-20020a05683043aa00b00661ae2653ebmr10661177otv.221.1666379608801; Fri, 21 Oct 2022 12:13:28 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:28 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 02/26] crypto: Rename BIP to BIP_CMAC Date: Fri, 21 Oct 2022 14:12:43 -0500 Message-Id: <20221021191307.31492-2-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To match the spec more closely. Several additional BIP algorithms are being introduced, including BIP_GMAC_128|256 and BIP_CMAC_256. --- src/crypto.c | 2 +- src/crypto.h | 2 +- src/ie.c | 2 +- src/netdev.c | 2 +- src/wiphy.c | 2 +- tools/hwsim.c | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index 19d55e70f5d0..89e315df6a36 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -501,7 +501,7 @@ int crypto_cipher_key_len(enum crypto_cipher cipher) return 32; case CRYPTO_CIPHER_CCMP: return 16; - case CRYPTO_CIPHER_BIP: + case CRYPTO_CIPHER_BIP_CMAC: return 16; } diff --git a/src/crypto.h b/src/crypto.h index b6fa2ec3eccf..b2cd8839aa77 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -30,7 +30,7 @@ enum crypto_cipher { CRYPTO_CIPHER_WEP104 = 0x000fac05, CRYPTO_CIPHER_TKIP = 0x000fac02, CRYPTO_CIPHER_CCMP = 0x000fac04, - CRYPTO_CIPHER_BIP = 0x000fac06, + CRYPTO_CIPHER_BIP_CMAC = 0x000fac06, }; enum crypto_akm { diff --git a/src/ie.c b/src/ie.c index 070454ef4f8f..245b59c91ad3 100644 --- a/src/ie.c +++ b/src/ie.c @@ -429,7 +429,7 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite) case IE_RSN_CIPHER_SUITE_WEP104: return CRYPTO_CIPHER_WEP104; case IE_RSN_CIPHER_SUITE_BIP: - return CRYPTO_CIPHER_BIP; + return CRYPTO_CIPHER_BIP_CMAC; default: return 0; } diff --git a/src/netdev.c b/src/netdev.c index 206907b896f8..cd8e70863d3a 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1684,7 +1684,7 @@ static void netdev_set_igtk(struct handshake_state *hs, uint16_t key_index, } switch (cipher) { - case CRYPTO_CIPHER_BIP: + case CRYPTO_CIPHER_BIP_CMAC: memcpy(igtk_buf, igtk, 16); break; default: diff --git a/src/wiphy.c b/src/wiphy.c index 6fdd3df526cd..1283bede923e 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -1215,7 +1215,7 @@ static void parse_supported_ciphers(struct wiphy *wiphy, const void *data, case CRYPTO_CIPHER_WEP104: wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_WEP104; break; - case CRYPTO_CIPHER_BIP: + case CRYPTO_CIPHER_BIP_CMAC: wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_BIP; break; default: /* TODO: Support other ciphers */ diff --git a/tools/hwsim.c b/tools/hwsim.c index e55019045967..75f074abf0b0 100644 --- a/tools/hwsim.c +++ b/tools/hwsim.c @@ -175,7 +175,7 @@ static const uint32_t hwsim_supported_ciphers[] = { CRYPTO_CIPHER_WEP104, CRYPTO_CIPHER_TKIP, CRYPTO_CIPHER_CCMP, - CRYPTO_CIPHER_BIP, + CRYPTO_CIPHER_BIP_CMAC, }; static uint32_t hwsim_ciphers[L_ARRAY_SIZE(hwsim_supported_ciphers)]; static int hwsim_num_ciphers = 0; @@ -196,7 +196,7 @@ static const struct hwsim_support cipher_map[] = { { "wep104", CRYPTO_CIPHER_WEP104 }, { "tkip", CRYPTO_CIPHER_TKIP }, { "ccmp", CRYPTO_CIPHER_CCMP }, - { "bip", CRYPTO_CIPHER_BIP }, + { "bip", CRYPTO_CIPHER_BIP_CMAC }, { } }; From patchwork Fri Oct 21 19:12:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015294 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F5243D60 for ; Fri, 21 Oct 2022 19:13:31 +0000 (UTC) Received: by mail-ot1-f49.google.com with SMTP id a14-20020a9d470e000000b00661b66a5393so2363807otf.11 for ; Fri, 21 Oct 2022 12:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B2Ibed61Ib+SV6Yaz0OB1rjHTNi5wIEaKelOVBT1S9w=; b=dxEFQd4KQwak+moi6CR1OK81wCYxr3ig0ZbihaBHfbbXmXkbGReMUA1UBzRjNx7vSq TLXNQgy3Lbp77Y4QwAAXUw4yn2dE/0C4FvVG1RCAYT8Vk5g7PLOWE61oQuLCcf3cHv6C LgFV+yRy7teS+wCuch47R7Wx8KH+xQjXSwYxxjSe1SsKFDejtNcya7NlmJD/ru5FLROx QcAA8HvNMfSp38Fyl66biUDBPmxH6pPvE0GrTF5xIXjvIk9YhZnusiA4T3W+XpBuFFho wN8T76vZOyVijhkqM5cMkF5PCNcst0z8i6vChK4RFzDoRVUPKs1u1siWidI+Ogulee3s r9qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B2Ibed61Ib+SV6Yaz0OB1rjHTNi5wIEaKelOVBT1S9w=; b=SNP26GO9YehQLMFOHinM9oockvFXS/OFfDfM6hLsuXlyYRLJqhvim2+66o3pvGNSJ2 Ncs+H9dNITLCv3DH/diK++4Xrlylszst8VOaFqJZ9TUr62ySGrDsqhGc4yNDQgpNYSui Oz404wq9WXRkCQ9i+WeNVfTJ5MlBExfuu6knTqW8JzkRY6kHMzEmR82rZ6LC03rnJ2Jr nLLnXVfC/v8lIp7FkuxHWf2pa0aRe0x2QtRHLkbNzA+lcQRaxKlu6Hh7JnXv0VjQVd5F cU6sGQpJLjDIlAihZ0uixtVWwWLY/WrdKoU6Y8mMd8vQUNLyxJkJggUctI434WN/zUxQ amMQ== X-Gm-Message-State: ACrzQf3JPWhMtjJzM1Rs77G5vI4KVke+tGT5eze2p8gnccgGgaOqK2bo gk0/3+7OwQVZrQA5P8lwrbdwVE7BbDQ= X-Google-Smtp-Source: AMsMyM6Pn3UOkfDSdv5hqwPYrCL011lgj+TcBjTPgiWX/Vah/H16G0e+yw3eBBuAPtMveYvGzFne4Q== X-Received: by 2002:a05:6830:3703:b0:65f:c2ff:c526 with SMTP id bl3-20020a056830370300b0065fc2ffc526mr10528199otb.302.1666379610301; Fri, 21 Oct 2022 12:13:30 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:29 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 03/26] ie: Rename _BIP to _BIP_CMAC Date: Fri, 21 Oct 2022 14:12:44 -0500 Message-Id: <20221021191307.31492-3-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/ie.c | 15 ++++++++------- src/ie.h | 2 +- src/wiphy.c | 13 +++++++------ unit/test-ie.c | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/ie.c b/src/ie.c index 245b59c91ad3..7159222a4f6c 100644 --- a/src/ie.c +++ b/src/ie.c @@ -428,7 +428,7 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite) return CRYPTO_CIPHER_WEP40; case IE_RSN_CIPHER_SUITE_WEP104: return CRYPTO_CIPHER_WEP104; - case IE_RSN_CIPHER_SUITE_BIP: + case IE_RSN_CIPHER_SUITE_BIP_CMAC: return CRYPTO_CIPHER_BIP_CMAC; default: return 0; @@ -462,7 +462,7 @@ static bool ie_parse_cipher_suite(const uint8_t *data, *out = IE_RSN_CIPHER_SUITE_WEP104; return true; case 6: - *out = IE_RSN_CIPHER_SUITE_BIP; + *out = IE_RSN_CIPHER_SUITE_BIP_CMAC; return true; case 7: *out = IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC; @@ -625,7 +625,7 @@ static bool ie_parse_group_management_cipher(const uint8_t *data, return r; switch (tmp) { - case IE_RSN_CIPHER_SUITE_BIP: + case IE_RSN_CIPHER_SUITE_BIP_CMAC: case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: break; default: @@ -746,7 +746,8 @@ static int parse_ciphers(const uint8_t *data, size_t len, * management frame protection enabled */ if (out_info->mfpc) - out_info->group_management_cipher = IE_RSN_CIPHER_SUITE_BIP; + out_info->group_management_cipher = + IE_RSN_CIPHER_SUITE_BIP_CMAC; RSNE_ADVANCE(data, len, 2); @@ -905,7 +906,7 @@ static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui, memcpy(data, oui, 3); data[3] = 5; return true; - case IE_RSN_CIPHER_SUITE_BIP: + case IE_RSN_CIPHER_SUITE_BIP_CMAC: memcpy(data, oui, 3); data[3] = 6; return true; @@ -1115,7 +1116,7 @@ static int build_ciphers_common(const struct ie_rsn_info *info, uint8_t *to, else if (!info->mfpc) goto done; else if (info->group_management_cipher == - IE_RSN_CIPHER_SUITE_BIP) + IE_RSN_CIPHER_SUITE_BIP_CMAC) goto done; } @@ -1136,7 +1137,7 @@ static int build_ciphers_common(const struct ie_rsn_info *info, uint8_t *to, goto done; if (!force_group_mgmt_cipher && info->group_management_cipher == - IE_RSN_CIPHER_SUITE_BIP) + IE_RSN_CIPHER_SUITE_BIP_CMAC) goto done; /* Group Management Cipher Suite */ diff --git a/src/ie.h b/src/ie.h index e56df984e53c..e7ffaa63f74d 100644 --- a/src/ie.h +++ b/src/ie.h @@ -329,7 +329,7 @@ enum ie_rsn_cipher_suite { IE_RSN_CIPHER_SUITE_TKIP = 0x0004, IE_RSN_CIPHER_SUITE_CCMP = 0x0008, IE_RSN_CIPHER_SUITE_WEP104 = 0x0010, - IE_RSN_CIPHER_SUITE_BIP = 0x0020, + IE_RSN_CIPHER_SUITE_BIP_CMAC = 0x0020, IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC = 0x0040, }; diff --git a/src/wiphy.c b/src/wiphy.c index 1283bede923e..3e08047910e1 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -157,8 +157,8 @@ enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask) if (mask & IE_RSN_CIPHER_SUITE_TKIP) return IE_RSN_CIPHER_SUITE_TKIP; - if (mask & IE_RSN_CIPHER_SUITE_BIP) - return IE_RSN_CIPHER_SUITE_BIP; + if (mask & IE_RSN_CIPHER_SUITE_BIP_CMAC) + return IE_RSN_CIPHER_SUITE_BIP_CMAC; return 0; } @@ -178,7 +178,7 @@ static bool wiphy_can_connect_sae(struct wiphy *wiphy) * WPA3 Specification version 3, Section 2.3: * A STA shall negotiate PMF when associating to an AP using SAE */ - if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP)) { + if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP_CMAC)) { l_debug("HW not MFP capable, can't use SAE"); return false; } @@ -488,7 +488,7 @@ bool wiphy_can_transition_disable(struct wiphy *wiphy) if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_CCMP)) return false; - if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP)) + if (!(wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP_CMAC)) return false; return true; @@ -1145,7 +1145,7 @@ static void wiphy_print_basic_info(struct wiphy *wiphy) if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_TKIP) len += sprintf(buf + len, " TKIP"); - if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP) + if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP_CMAC) len += sprintf(buf + len, " BIP"); l_info("%s", buf); @@ -1216,7 +1216,8 @@ static void parse_supported_ciphers(struct wiphy *wiphy, const void *data, wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_WEP104; break; case CRYPTO_CIPHER_BIP_CMAC: - wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_BIP; + wiphy->supported_ciphers |= + IE_RSN_CIPHER_SUITE_BIP_CMAC; break; default: /* TODO: Support other ciphers */ break; diff --git a/unit/test-ie.c b/unit/test-ie.c index 709b745428b9..7ea84c387121 100644 --- a/unit/test-ie.c +++ b/unit/test-ie.c @@ -423,7 +423,7 @@ static const struct ie_rsne_info_test ie_rsne_info_test_6 = { .pairwise_ciphers = IE_RSN_CIPHER_SUITE_CCMP, .akm_suites = IE_RSN_AKM_SUITE_8021X, .mfpc = true, /* Management frame protection is enabled, not required */ - .group_management_cipher = IE_RSN_CIPHER_SUITE_BIP, + .group_management_cipher = IE_RSN_CIPHER_SUITE_BIP_CMAC, }; static void ie_test_rsne_info(const void *data) From patchwork Fri Oct 21 19:12:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015295 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 640973D60 for ; Fri, 21 Oct 2022 19:13:33 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id 101-20020a9d0bee000000b00661b54d945fso2357511oth.13 for ; Fri, 21 Oct 2022 12:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MBgi0EuoCm94wUm1zu6bmgYFnP7whyJrGGyjSUM8hyo=; b=Or7YksSQNQXIRfyQHd4CJvTZZMPb77BUGUqXi5gTgi6Qyk/RiRLeogvplTqqp4436w jU8K1hYLb/gIAHji0B3YR33VMfDBgSlTc01+LusLfq/kWlfR2btNPX+V1dZj1s7Rs1Yk WgIzMC2fau2lhDOXx0yzgB9mN9OSKNUCbOmfjLq9azQGDohMtyodg4/yKkkXmHlOpgaK gEj0ycBFBIMCUggnMzzypsXBzNdBCbOnjGtk0Nzb/2bI9h44mzrd5Ny6I3HFBL1z6Bi2 p0az95w91KrGHxyveaBi3lB8xboc5bt+wfF+kP6jO0Cyo6XWYiklHLu81EAfN/a3TdS5 5B1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MBgi0EuoCm94wUm1zu6bmgYFnP7whyJrGGyjSUM8hyo=; b=xT4j9Zswr5IYflEMlPOMnNHcoU4/RMRLcm6A8dEKjwC9HL9n8sI8GdQ8BUsDsiGNyi Xq0JCm0C0HCf8dOEu0S99NwITAKWfirIEzenC0GmTbr/yd3ahGstBwht6Nzeg+H+S6TT wqpGoE2/QZ+UCCVek4ht/ubJvletbARJR70cmZiGEunAXgLy2TGNDF/qjm8tKjWEfyPK pjczBdfJGYYKfeHuZwZJA424T4I+4HjBVSMe5MTvATUR+L9xoOTCqqVSK1pgXir94Qyw EuSC6o+Mn0JoYWa7k3zx6xZuSAY3KlFW5TMK/Ya8nzUqWOEy6uVd8uCgfl1yYWcpyZC9 p7xA== X-Gm-Message-State: ACrzQf0k1kx4xe9ZyUFoeIhZcrnlevUMzOrH/CNTMfunTga4I+nxXIdU y0m9cpsXcfrZWoBrEklSzwb7HSyrI1E= X-Google-Smtp-Source: AMsMyM4arM9ng3ylC6b+zlygaaCH2O0STRs4sG4QdH8jmEP/fEOVQkKojITZpXNb40Hz02SkaVi6Vw== X-Received: by 2002:a9d:322:0:b0:661:b793:6fb1 with SMTP id 31-20020a9d0322000000b00661b7936fb1mr10680560otv.14.1666379611731; Fri, 21 Oct 2022 12:13:31 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:31 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 04/26] ie: Simplify implementation Date: Fri, 21 Oct 2022 14:12:45 -0500 Message-Id: <20221021191307.31492-4-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Instead of copy-pasting the same basic operation (memcpy & assignment), use a goto and a common path instead. This should also make it easier for the compiler to optimize this function. --- src/ie.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/ie.c b/src/ie.c index 7159222a4f6c..8ceefc643615 100644 --- a/src/ie.c +++ b/src/ie.c @@ -885,38 +885,37 @@ int ie_parse_osen_from_data(const uint8_t *data, size_t len, static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui, const enum ie_rsn_cipher_suite suite) { + uint8_t selector; + switch (suite) { case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: - memcpy(data, oui, 3); - data[3] = 0; - return true; + selector = 0; + goto done; case IE_RSN_CIPHER_SUITE_WEP40: - memcpy(data, oui, 3); - data[3] = 1; - return true; + selector = 1; + goto done; case IE_RSN_CIPHER_SUITE_TKIP: - memcpy(data, oui, 3); - data[3] = 2; - return true; + selector = 2; + goto done; case IE_RSN_CIPHER_SUITE_CCMP: - memcpy(data, oui, 3); - data[3] = 4; - return true; + selector = 4; + goto done; case IE_RSN_CIPHER_SUITE_WEP104: - memcpy(data, oui, 3); - data[3] = 5; - return true; + selector = 5; + goto done; case IE_RSN_CIPHER_SUITE_BIP_CMAC: - memcpy(data, oui, 3); - data[3] = 6; - return true; + selector = 6; + goto done; case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: - memcpy(data, oui, 3); - data[3] = 7; - return true; + selector = 7; + goto done; } return false; +done: + memcpy(data, oui, 3); + data[3] = selector; + return true; } #define RETURN_AKM(data, oui, id) \ From patchwork Fri Oct 21 19:12:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015296 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E58673D60 for ; Fri, 21 Oct 2022 19:13:34 +0000 (UTC) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-12c8312131fso4748148fac.4 for ; Fri, 21 Oct 2022 12:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vdhOA1IZN3STU6OVhP5pOMCm8qIM//dPS4X9+VoHzGA=; b=ntjGofR4OoyVw4A4RNiWkDuuy09He8t+3103hOuooeNsOqozp6y+94LhCKurglVFkj jrjREQlTTtnG31ijot5Il5mTBSfPlKUQYWiA+yVyCj53+yM0s3zcovkXjMEBzSasf35x 82oreCrXIU48EISgWMVbrZLtOvzeXOChgJfF5lKb7gjqELAzabJs7zps+Xn60ApDi0aK zV8tiuzM9hKoZu3rEvoSJj2YGH0mdly9praeHNy6913O30FcfTlJIYN/d9/Q3iPQ7mIt y4ggIjs95a/jBKU9raBbn/C36Il2xOZyCKNykGFSjkXqDQSo3frM+UkGZmbrTngICzXX 0DKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vdhOA1IZN3STU6OVhP5pOMCm8qIM//dPS4X9+VoHzGA=; b=4INp8sQpp97fMC9nNllwaR1R5UK0fkCrBTh9/E2z9X+gikLHDj6XFMuXrvlW3RHN5r 7SJwdfOWjT7P7qtzet+AtcStcmp3rI0MESX/9gfvNn6pJeQlqr7UtcS7Smwz3mUcovi+ aq7BBZ7kffTdtjXAVxuJpQNjXw0biZbvJfK3tiH2yDTCNKSkibdOxWR4tduTKbKyGXLu B254YRt0jjvrIkT+D/QXRaLKmGfXRtD481zQCJdYgpFUYPyzNgBIjzrWfNyDLX4DdGT/ +AvMqiGHWgyxppshsPpC2Mx1x6oYV3escDPnflu3FBv0Hh9VKt5FEUwZVXogrtoLE3yg 0m8Q== X-Gm-Message-State: ACrzQf1tt9V7pDwnzpovplK1LW6yo7nwPnLXoYTEUeZHKAnUmNV6IrM8 5cCQ9+pFvSRkTAlGLBPKHgi7/ANolNo= X-Google-Smtp-Source: AMsMyM4wfCMjnm/6nhXLZEB1HngSRuOhH617W7lqAJei6QvaZNur1EPlxmCxpuYiEAyb5Y7Nsid3JA== X-Received: by 2002:a05:6870:609c:b0:131:c972:818f with SMTP id t28-20020a056870609c00b00131c972818fmr13106072oae.2.1666379613490; Fri, 21 Oct 2022 12:13:33 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:32 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 05/26] crypto: Add new cipher definitions Date: Fri, 21 Oct 2022 14:12:46 -0500 Message-Id: <20221021191307.31492-5-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/crypto.c | 8 ++++++++ src/crypto.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/src/crypto.c b/src/crypto.c index 89e315df6a36..840d9ee4dd5b 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -500,9 +500,17 @@ int crypto_cipher_key_len(enum crypto_cipher cipher) case CRYPTO_CIPHER_TKIP: return 32; case CRYPTO_CIPHER_CCMP: + case CRYPTO_CIPHER_GCMP: return 16; + case CRYPTO_CIPHER_CCMP_256: + case CRYPTO_CIPHER_GCMP_256: + return 32; case CRYPTO_CIPHER_BIP_CMAC: + case CRYPTO_CIPHER_BIP_GMAC: return 16; + case CRYPTO_CIPHER_BIP_CMAC_256: + case CRYPTO_CIPHER_BIP_GMAC_256: + return 32; } return 0; diff --git a/src/crypto.h b/src/crypto.h index b2cd8839aa77..ed430abb00d8 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -31,6 +31,12 @@ enum crypto_cipher { CRYPTO_CIPHER_TKIP = 0x000fac02, CRYPTO_CIPHER_CCMP = 0x000fac04, CRYPTO_CIPHER_BIP_CMAC = 0x000fac06, + CRYPTO_CIPHER_GCMP = 0x000fac08, + CRYPTO_CIPHER_GCMP_256 = 0x000fac09, + CRYPTO_CIPHER_CCMP_256 = 0x000fac0a, + CRYPTO_CIPHER_BIP_GMAC = 0x000fac0b, + CRYPTO_CIPHER_BIP_GMAC_256 = 0x000fac0c, + CRYPTO_CIPHER_BIP_CMAC_256 = 0x000fac0d, }; enum crypto_akm { From patchwork Fri Oct 21 19:12:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015297 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6308E3D60 for ; Fri, 21 Oct 2022 19:13:36 +0000 (UTC) Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-13af2d12469so4696254fac.13 for ; Fri, 21 Oct 2022 12:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=81riFLEbUob6TnesX42fOPrvVm+YpjomFui7FxvVdUk=; b=gugD9fPaGt1zd04ciMrQYqMv71ZrccqyyUsUIFbhgm/bVA7jFarRUf1Ev+1FSv0YF8 r7QRoZHlHnYsdvYzQt8qNKvqerEYsdHUCi8ZjmVlm1qv+lEpudrk6cpwFWBEq7GRhYOJ FkNlrrJqprnuj02n99ALGVEsbPP/dcZIk2d3mIF3Y5H1uPqU/JLDUK1n7x8aCzQaAded 1eVUiYOyo0m6PNAKpcfdA/s42j3Awp46Odi3QxXRQI4ia6qcmTA0tkeunBAo9F/nJ8D5 7ZEFG6p6pNDnfAXupfdhcYvcvma8sGs6wiHRloX7XrvuSTmcntONMNl7jbrTEIlfMtdF C/yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=81riFLEbUob6TnesX42fOPrvVm+YpjomFui7FxvVdUk=; b=clRthbe4QdClYU3oy7WNgPWFM4p8RZwH7etxTyowj6Xshlm57/ROeGyhvs+K0+II4l D0On60T+fDnyhj56FL8vk8DQyco5iJQFWayog3M70iGBvrx3RwkFBLcdslHHTkCAmIqQ JoWWfSO3MrXc1rD+jdHK+kxp6k/oiF1zy0qN861HQAnVAR8ZsGwkJD2fREKOicB0eJzQ S42ULXS5FkMbugN7w/PNWKueRqqFmfqcdjRC9nT8n6yHD3mZiQf4pe+sxwlX0unNm32O V8Bc5MgZG1AjMlfchpxuGXjQPRRfcNaj1KDC5Rjl6OwKtJgEWKb36l9RQzt/SpcjN/L5 TfxA== X-Gm-Message-State: ACrzQf3SK2X/xMU6qiD11id4XHmmWzh6fZunXFMueDvLh24+zopAGy50 Uz+nxPPQs52X4XvHZ8WXvEpFlrWunwE= X-Google-Smtp-Source: AMsMyM5Ykt7j7l6eh6/eKCUFmtN35oY3rXcIWSmI0VOfSfwMtriq06XA76OMAzj/VFWxOqPRKjjIQA== X-Received: by 2002:a05:6870:6025:b0:132:6b0b:abc2 with SMTP id t37-20020a056870602500b001326b0babc2mr27963298oaa.177.1666379614835; Fri, 21 Oct 2022 12:13:34 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:34 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 06/26] ie: Skip unknown pairwise ciphers Date: Fri, 21 Oct 2022 14:12:47 -0500 Message-Id: <20221021191307.31492-6-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/ie.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ie.c b/src/ie.c index 8ceefc643615..110b5b3ebdec 100644 --- a/src/ie.c +++ b/src/ie.c @@ -589,15 +589,14 @@ static bool ie_parse_group_cipher(const uint8_t *data, return true; } -static bool ie_parse_pairwise_cipher(const uint8_t *data, +static int ie_parse_pairwise_cipher(const uint8_t *data, enum ie_rsn_cipher_suite *out) { enum ie_rsn_cipher_suite tmp; - bool r = ie_parse_cipher_suite(data, &tmp); if (!r) - return r; + return -ENOENT; switch (tmp) { case IE_RSN_CIPHER_SUITE_CCMP: @@ -607,11 +606,11 @@ static bool ie_parse_pairwise_cipher(const uint8_t *data, case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: break; default: - return false; + return -ERANGE; } *out = tmp; - return true; + return 0; } static bool ie_parse_group_management_cipher(const uint8_t *data, @@ -682,9 +681,12 @@ static int parse_ciphers(const uint8_t *data, size_t len, /* Parse Pairwise Cipher Suite List field */ for (i = 0, out_info->pairwise_ciphers = 0; i < count; i++) { enum ie_rsn_cipher_suite suite; + int r = ie_parse_pairwise_cipher(data + i * 4, &suite); - if (!ie_parse_pairwise_cipher(data + i * 4, &suite)) - return -ERANGE; + if (r == -ENOENT) /* Skip unknown */ + continue; + else if (r < 0) + return r; out_info->pairwise_ciphers |= suite; } From patchwork Fri Oct 21 19:12:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015298 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A8113D60 for ; Fri, 21 Oct 2022 19:13:38 +0000 (UTC) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1324e7a1284so4712359fac.10 for ; Fri, 21 Oct 2022 12:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ECxO2H/ORGE1Urt6IuFQBDeZmF4FOWh6df8NeLalpVg=; b=dLd02jaFEk2sI3138F0NsqeGSU3tgL1vrMX62k4YVNxHXv+Iug1bp+mrfB+rq4rk/e +pKG+FAhOvimsZwd6evwAi0gH8gJSxFgA+Q3n1gk4tuKdBbHhCk+mbZRYIK2IkItF2R4 S/CluaP18Sn9r7iN2Wb53wBsZzg0Zv+zUofPwwr1e7sWsTcLd5e0S/Y07fjG/A3Q3xH3 jns78FYCedUfq7B4bwY3NN4UVux3O/FHmXCCXuRcGriI5soXB/AyqtA1ah3mxjUpD7L8 ONxq+pg/UkPOuelraxwafW0MZhzFpqFmacrrbh3npv2RCp3XD88fXGjUFgwqa2ELQ2n0 4WPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ECxO2H/ORGE1Urt6IuFQBDeZmF4FOWh6df8NeLalpVg=; b=qFe+c+3GT9sG8WrWnrxzdOgCSEIZB1yK+RkuWys+ah8S6M+ve1cflMJJkILZEf9gTm bBKUxKnkEDQi32cl4YvlECtmTYHthzqN7zF1SSgPf+D2ylkTOtUJz589gFdVLp3mXNf2 mbLBBVxQAgwi2zl5k5gtPgYOLe/weowjY2RpZrAzvR3nqsrHKBhWLcNtssw8JTozVoV8 HJq6TYoaupqKkPHeU5zQegvlYklEcIyDl9vsUx++JcR9IG+JccE3iqU+pzx7c7IRxmH9 ZS6dTi+w/1R6YmXZgWf91BOByiJ6ibAXVkbhd801Nx+XpcpRs0yL5/Rjn1Tsj6x1gTon zSvg== X-Gm-Message-State: ACrzQf0ijGIKnXeq0S+cZ/S3lo6zTnKkAh9pw3PnwzwovQF+y+gyR3oH 2cTjRcI465QeKRZq+UW1HW17l7JMcRI= X-Google-Smtp-Source: AMsMyM44gKCwlxayH67bJsLNqkxISnse11h0ZB0PylaWBnxotrB+yFP5qJxvxQEzUyVXX1UZTifkeg== X-Received: by 2002:a05:6870:d348:b0:131:9f68:cd49 with SMTP id h8-20020a056870d34800b001319f68cd49mr13466103oag.231.1666379616820; Fri, 21 Oct 2022 12:13:36 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:35 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 07/26] netdev: Build RSN attributes in a common function Date: Fri, 21 Oct 2022 14:12:48 -0500 Message-Id: <20221021191307.31492-7-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Both CMD_ASSOCIATE and CMD_CONNECT paths were using very similar code to build RSN specific attributes. Use a common function to build these attributes to cut down on duplicated code. While here, also start using ie_rsn_cipher_suite_to_cipher instead of assuming that the pairwise / group ciphers can only be CCMP or TKIP. --- src/netdev.c | 139 ++++++++++++++++++++------------------------------- 1 file changed, 53 insertions(+), 86 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index cd8e70863d3a..231ed9862cc5 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -2519,6 +2519,44 @@ static unsigned int ie_rsn_akm_suite_to_nl80211(enum ie_rsn_akm_suite akm) return 0; } +static void netdev_append_nl80211_rsn_attributes(struct l_genl_msg *msg, + struct handshake_state *hs) +{ + uint32_t nl_cipher; + uint32_t nl_akm; + uint32_t wpa_version; + + nl_cipher = ie_rsn_cipher_suite_to_cipher(hs->pairwise_cipher); + L_WARN_ON(!nl_cipher); + l_genl_msg_append_attr(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, + 4, &nl_cipher); + + nl_cipher = ie_rsn_cipher_suite_to_cipher(hs->group_cipher); + L_WARN_ON(!nl_cipher); + l_genl_msg_append_attr(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, + 4, &nl_cipher); + + if (hs->mfp) { + uint32_t use_mfp = NL80211_MFP_REQUIRED; + + l_genl_msg_append_attr(msg, NL80211_ATTR_USE_MFP, 4, &use_mfp); + } + + nl_akm = ie_rsn_akm_suite_to_nl80211(hs->akm_suite); + L_WARN_ON(!nl_akm); + l_genl_msg_append_attr(msg, NL80211_ATTR_AKM_SUITES, 4, &nl_akm); + + if (IE_AKM_IS_SAE(hs->akm_suite)) + wpa_version = NL80211_WPA_VERSION_3; + else if (hs->wpa_ie) + wpa_version = NL80211_WPA_VERSION_1; + else + wpa_version = NL80211_WPA_VERSION_2; + + l_genl_msg_append_attr(msg, NL80211_ATTR_WPA_VERSIONS, + 4, &wpa_version); +} + static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev, struct handshake_state *hs, const uint8_t *prev_bssid, @@ -2575,49 +2613,18 @@ static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev, l_genl_msg_append_attr(msg, NL80211_ATTR_SOCKET_OWNER, 0, NULL); if (is_rsn) { - uint32_t nl_cipher; - uint32_t nl_akm; - uint32_t wpa_version; - - if (hs->pairwise_cipher == IE_RSN_CIPHER_SUITE_CCMP) - nl_cipher = CRYPTO_CIPHER_CCMP; - else - nl_cipher = CRYPTO_CIPHER_TKIP; - - l_genl_msg_append_attr(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, - 4, &nl_cipher); - - if (hs->group_cipher == IE_RSN_CIPHER_SUITE_CCMP) - nl_cipher = CRYPTO_CIPHER_CCMP; - else - nl_cipher = CRYPTO_CIPHER_TKIP; - - l_genl_msg_append_attr(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, - 4, &nl_cipher); - - if (hs->mfp) { - uint32_t use_mfp = NL80211_MFP_REQUIRED; - l_genl_msg_append_attr(msg, NL80211_ATTR_USE_MFP, - 4, &use_mfp); - } - - nl_akm = ie_rsn_akm_suite_to_nl80211(hs->akm_suite); - if (nl_akm) - l_genl_msg_append_attr(msg, NL80211_ATTR_AKM_SUITES, - 4, &nl_akm); - - if (IE_AKM_IS_SAE(hs->akm_suite)) - wpa_version = NL80211_WPA_VERSION_3; - else if (hs->wpa_ie) - wpa_version = NL80211_WPA_VERSION_1; - else - wpa_version = NL80211_WPA_VERSION_2; + netdev_append_nl80211_rsn_attributes(msg, hs); + c_iov = iov_ie_append(iov, n_iov, c_iov, hs->supplicant_ie); + } - l_genl_msg_append_attr(msg, NL80211_ATTR_WPA_VERSIONS, - 4, &wpa_version); + if (is_rsn || hs->settings_8021x) { + l_genl_msg_append_attr(msg, NL80211_ATTR_CONTROL_PORT, + 0, NULL); - l_genl_msg_append_attr(msg, NL80211_ATTR_CONTROL_PORT, 0, NULL); - c_iov = iov_ie_append(iov, n_iov, c_iov, hs->supplicant_ie); + if (netdev->pae_over_nl80211) + l_genl_msg_append_attr(msg, + NL80211_ATTR_CONTROL_PORT_OVER_NL80211, + 0, NULL); } if (netdev->owe_sm) { @@ -2625,11 +2632,6 @@ static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev, c_iov = iov_ie_append(iov, n_iov, c_iov, owe_dh_ie); } - if (netdev->pae_over_nl80211) - l_genl_msg_append_attr(msg, - NL80211_ATTR_CONTROL_PORT_OVER_NL80211, - 0, NULL); - c_iov = iov_ie_append(iov, n_iov, c_iov, hs->mde); c_iov = netdev_populate_common_ies(netdev, hs, msg, iov, n_iov, c_iov); @@ -2953,52 +2955,17 @@ static struct l_genl_msg *netdev_build_cmd_associate_common( l_genl_msg_append_attr(msg, NL80211_ATTR_SSID, hs->ssid_len, hs->ssid); l_genl_msg_append_attr(msg, NL80211_ATTR_SOCKET_OWNER, 0, NULL); - if (is_rsn) { - uint32_t nl_cipher; - uint32_t nl_akm; - uint32_t wpa_version; + if (is_rsn) + netdev_append_nl80211_rsn_attributes(msg, hs); - l_genl_msg_append_attr(msg, NL80211_ATTR_CONTROL_PORT, 0, NULL); + if (is_rsn || hs->settings_8021x) { + l_genl_msg_append_attr(msg, NL80211_ATTR_CONTROL_PORT, + 0, NULL); if (netdev->pae_over_nl80211) l_genl_msg_append_attr(msg, NL80211_ATTR_CONTROL_PORT_OVER_NL80211, 0, NULL); - - if (hs->pairwise_cipher == IE_RSN_CIPHER_SUITE_CCMP) - nl_cipher = CRYPTO_CIPHER_CCMP; - else - nl_cipher = CRYPTO_CIPHER_TKIP; - - l_genl_msg_append_attr(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, - 4, &nl_cipher); - - if (hs->group_cipher == IE_RSN_CIPHER_SUITE_CCMP) - nl_cipher = CRYPTO_CIPHER_CCMP; - else - nl_cipher = CRYPTO_CIPHER_TKIP; - - l_genl_msg_append_attr(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, - 4, &nl_cipher); - - if (hs->mfp) { - uint32_t use_mfp = NL80211_MFP_REQUIRED; - l_genl_msg_append_attr(msg, NL80211_ATTR_USE_MFP, - 4, &use_mfp); - } - - nl_akm = ie_rsn_akm_suite_to_nl80211(hs->akm_suite); - if (nl_akm) - l_genl_msg_append_attr(msg, NL80211_ATTR_AKM_SUITES, - 4, &nl_akm); - - if (hs->wpa_ie) - wpa_version = NL80211_WPA_VERSION_1; - else - wpa_version = NL80211_WPA_VERSION_2; - - l_genl_msg_append_attr(msg, NL80211_ATTR_WPA_VERSIONS, - 4, &wpa_version); } return msg; From patchwork Fri Oct 21 19:12:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015299 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F18A3D60 for ; Fri, 21 Oct 2022 19:13:40 +0000 (UTC) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-132fb4fd495so4700999fac.12 for ; Fri, 21 Oct 2022 12:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xkmhcFzxlwRMcnB1rIwSKb4zvn9eT8l0k3JrrN7xZPM=; b=T6hA8ZaYdB9I6XODLF+4MQGYTVj7k+iItW/g6yMVCpZs6Exp1w2cm8ev41c4JmYWg1 KcRh/efM+RN2yffqg0j9DOAQxKpCv0hc3y6kUdmRnlWfrbITVvs7MVlxGsITdECxGg1T xFrPzWr/V4ZFycqr7Rx2mh8b6LNnXvqCQFPkzOKu5ygl6wHdjCXc1txyAgFJDVF64bEK jTaDUMq/66FoHgxf6udGWi8kRFTMd6wfH3gG0VDJbPjiCUYz4gyKZKJkbFJbS/wqGLCq SN3S/IKZZdyPXiBnHDLtJ0+SEyMHyop0s9bh+KCOduOor4ZwQC9/W9YleU7NhulXJQC5 HPRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xkmhcFzxlwRMcnB1rIwSKb4zvn9eT8l0k3JrrN7xZPM=; b=Ei0sAH6lRn8vPFJ4ztZpLYCEThKWoDM1go4qNw6f0L+lbVKZ1nfymPA2vA59MLBwEY 92PbybxSx/y9h330CS7cxGkxYNfypQAamrCo3f77/1AYxeXRFgy/SeE+MRJXjMquT1Ge Dfzd/51hyRXZEWaA6CPPxsVBD4224okjKJDNgVzA7VOvB4Kp+yol5mWrFFDFprEs4UWk fhutI/sbVyvTikidXnXtwjrfD3foKa6SJDJrWGlmArLFvMxUpV91/6af9ktp5z5xvMUa cqu31ZzO8Ru49lHl0Tq4ggu1N3YpC4u74ub9Lk9wOIbn5GDC2R60lc4Td+uqDE72eNgE Kodw== X-Gm-Message-State: ACrzQf2QRDPW9+zLHvj4mwkhjp6Wr4DG28qhdUXT6JpcT1JUM4g2wRJX dqmKV6i130aP+an2QBE21DpfkHJAF8s= X-Google-Smtp-Source: AMsMyM6ww83quGGdomuZ/mEQgxcfa4wnyjYqRf8WsbMAWmDoyRuw5DhncsisMQv3C4rHCg9h0OHCIw== X-Received: by 2002:a05:6870:c185:b0:137:5188:d2d7 with SMTP id h5-20020a056870c18500b001375188d2d7mr23057789oad.296.1666379618534; Fri, 21 Oct 2022 12:13:38 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:37 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 08/26] netdev: Add support for setting GCMP keys Date: Fri, 21 Oct 2022 14:12:49 -0500 Message-Id: <20221021191307.31492-8-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/netdev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index 231ed9862cc5..4ca230e42b1f 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1564,12 +1564,15 @@ static bool netdev_copy_tk(uint8_t *tk_buf, const uint8_t *tk, { switch (cipher) { case CRYPTO_CIPHER_CCMP: + case CRYPTO_CIPHER_GCMP: /* - * 802.11-2016 12.8.3 Mapping PTK to CCMP keys: + * 802.11-2020 12.8.3 Mapping PTK to CCMP keys: * "A STA shall use the temporal key as the CCMP key * for MPDUs between the two communicating STAs." + * + * Similar verbiage in 12.8.8 */ - memcpy(tk_buf, tk, 16); + memcpy(tk_buf, tk, crypto_cipher_key_len(cipher)); break; case CRYPTO_CIPHER_TKIP: /* From patchwork Fri Oct 21 19:12:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015300 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B01396127 for ; Fri, 21 Oct 2022 19:13:41 +0000 (UTC) Received: by mail-ot1-f50.google.com with SMTP id br15-20020a056830390f00b0061c9d73b8bdso2385076otb.6 for ; Fri, 21 Oct 2022 12:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bRY3Bs1CSYf0yZ4wCkjeenL3uaImyaSlDHmthDImn0M=; b=QBq3rC0+w5hZ6wQFbz0piKwQeUOu5dkjwj/aD/maQ6cnaGvm++P+dT6hTpHa04HoSI XSHU+nc5HPEFgjEMIO61Djf9HDXYvfhu3dJuHzl7ahrpHAumPIs07YZMJ+9ctNzyrjeO OSo+Vetyr25zN2qFNGprnkysQgbOV9hvLxgeVswG5sIgHud5FvLo+N8RbEQ1d746s6Tv s17jouGzeHCiShr8bxRMWV7OziakVjDc8M7EPqOGoJuHUn6t8P3dQiK0P92Xifzlx1qq pveov6+QJY+Tr3KLm9KbGdyin/QB0KrZ8XOwgYvCeLu+6IXqyiEH4TN6gz5fUI4oUnpE XteA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bRY3Bs1CSYf0yZ4wCkjeenL3uaImyaSlDHmthDImn0M=; b=P13UbesWsPlsXvBZQPEK/f2HdcwU6/MssWj8moLFKjYUSkEAQGmk8ipQXFwhEhn1ji /jcbPIVy8WH38iioBrk2JvxpghgmxaidV40yxJ6x3tnsV28hAskcEmjaA33AGGXaeSBi 5mUJ0+LZOyAUvbvL1ADofuqnn9SFrR9blepjeQc7lrCoTDeGID+uFdf73f0+6WvpFe4k vrMgLx2G4yCBAa33n1s5dP0HOFchufGfC+Lx5lLMPmcqfUE5pvP/UQufs39ptUCHLAYH kvmfvC+3cWOWYcfxfvCcQzBiQHT/BpkXGbqp+epPEQhKzaLb49ocIbtnN4A2m8dlY2ow 9MSQ== X-Gm-Message-State: ACrzQf3irWpML3hOmB/tflM2XRUE8OuzWrC4Gcu14Gh8sQ4C7P2aTXUn rJsTnJrRV7fWDMiH5scEAJPQlpc/xaU= X-Google-Smtp-Source: AMsMyM4OUmkyh8Q7Yfc9/LfiP7Aw13NwIRwtlepbPhrQQbnRArKYaVOkhfUfEm8LskQ/32eAI+dzJg== X-Received: by 2002:a9d:6acb:0:b0:662:335f:ff17 with SMTP id m11-20020a9d6acb000000b00662335fff17mr1137611otq.96.1666379620359; Fri, 21 Oct 2022 12:13:40 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:39 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 09/26] ie: Add support for GCMP cipher suite Date: Fri, 21 Oct 2022 14:12:50 -0500 Message-Id: <20221021191307.31492-9-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/ie.c | 11 +++++++++++ src/ie.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/ie.c b/src/ie.c index 110b5b3ebdec..89f19b11a0fb 100644 --- a/src/ie.c +++ b/src/ie.c @@ -430,6 +430,8 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite) return CRYPTO_CIPHER_WEP104; case IE_RSN_CIPHER_SUITE_BIP_CMAC: return CRYPTO_CIPHER_BIP_CMAC; + case IE_RSN_CIPHER_SUITE_GCMP: + return CRYPTO_CIPHER_GCMP; default: return 0; } @@ -467,6 +469,9 @@ static bool ie_parse_cipher_suite(const uint8_t *data, case 7: *out = IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC; return true; + case 8: + *out = IE_RSN_CIPHER_SUITE_GCMP; + return true; default: return false; } @@ -580,6 +585,7 @@ static bool ie_parse_group_cipher(const uint8_t *data, case IE_RSN_CIPHER_SUITE_WEP104: case IE_RSN_CIPHER_SUITE_WEP40: case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: + case IE_RSN_CIPHER_SUITE_GCMP: break; default: return false; @@ -604,6 +610,7 @@ static int ie_parse_pairwise_cipher(const uint8_t *data, case IE_RSN_CIPHER_SUITE_WEP104: case IE_RSN_CIPHER_SUITE_WEP40: case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: + case IE_RSN_CIPHER_SUITE_GCMP: break; default: return -ERANGE; @@ -911,6 +918,9 @@ static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui, case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: selector = 7; goto done; + case IE_RSN_CIPHER_SUITE_GCMP: + selector = 8; + goto done; } return false; @@ -999,6 +1009,7 @@ static int build_ciphers_common(const struct ie_rsn_info *info, uint8_t *to, IE_RSN_CIPHER_SUITE_WEP104, IE_RSN_CIPHER_SUITE_WEP40, IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER, + IE_RSN_CIPHER_SUITE_GCMP, }; unsigned int pos = 0; unsigned int i; diff --git a/src/ie.h b/src/ie.h index e7ffaa63f74d..2cbe35f2bdcc 100644 --- a/src/ie.h +++ b/src/ie.h @@ -331,6 +331,7 @@ enum ie_rsn_cipher_suite { IE_RSN_CIPHER_SUITE_WEP104 = 0x0010, IE_RSN_CIPHER_SUITE_BIP_CMAC = 0x0020, IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC = 0x0040, + IE_RSN_CIPHER_SUITE_GCMP = 0x0080, }; enum ie_rsn_akm_suite { From patchwork Fri Oct 21 19:12:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015301 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 370366127 for ; Fri, 21 Oct 2022 19:13:43 +0000 (UTC) Received: by mail-ot1-f54.google.com with SMTP id r13-20020a056830418d00b0065601df69c0so2378671otu.7 for ; Fri, 21 Oct 2022 12:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TgJEqu9v4fqz9i9aQw9tx+M3Z7JSNc/H/29K0sl2tjg=; b=WRzAKDvOFNZTJYVltjGX3XFwi//boNo1ABkXU+bfUGtogzKpg/8v+gbv7Pc3bo1Bnp bKCYrehj8kCB2A4U7Eqn8bXDS4+ujtrOLOMG8aWtXM7WjYsCx+9Dej9NJbNr4kc+SOld yHqYWvglyGSEaDFxZyRfzFm0sgl8G4janZQEPvC8eFksNq/0MzJywqU8CJSvzXyehasg YTL23Aefbeqj+hACtqWuR8xjfP6awJjU5Ugbde80fwIdYSbAFPGLdWDZzjt26wFaWDjz sGT03YZjbc+LGMqbThwjlqeiAQIDSyitS1xbCWfh5Imh7eXCFtQ1MJrLeXiltkpwYGv4 dkxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TgJEqu9v4fqz9i9aQw9tx+M3Z7JSNc/H/29K0sl2tjg=; b=gTWMf/fs9qi3A3TaajgqHX8BxQNy/ANRrdjvi0Nztk7xCCnLbgTxnFjAP6cia/WGS2 dGn2nnY75ennhZDWNNn2FbW/Fd12QNV2V2cLUnWfotVB8TnmdZY4B+HGjeqiUiWywFAo tMed9DrJVU/iLNr9KXiHHaHij7Q/91skBOcNJtSGRgXQ7IzIfnK1XdNa2WNnplmgNM3g 5aX++RoDVg7iLWi41PrK4NXU30C0IIKBWhlpg7u4B9Y5vrkontmOsZIVcBxM5XtubzTG zg4diC48ifZZcCkbQMnibas2A4ZmLJHprmJI9sxLvZfykeJEuBRiD7HMdvSGxB+UTOly nPbw== X-Gm-Message-State: ACrzQf06iFYb4PI6nMFrrvZVG2+q8BZrmpDzXke5Kp74yShso9q6DF9x WSG50zc9cUOKPIBIhah6CJ5MUNvtfxc= X-Google-Smtp-Source: AMsMyM5SmO0q8Fx03XTScqTh1H1kwZjHFZyz72e5xY5r3vq55UCAQCPAUR6NfafZZ/BDqLaQw/5t1Q== X-Received: by 2002:a05:6830:310a:b0:661:e955:a7a1 with SMTP id b10-20020a056830310a00b00661e955a7a1mr10350554ots.57.1666379621764; Fri, 21 Oct 2022 12:13:41 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:41 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 10/26] ie: add ie_rsn_cipher_suite_to_string Date: Fri, 21 Oct 2022 14:12:51 -0500 Message-Id: <20221021191307.31492-10-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/ie.c | 24 ++++++++++++++++++++++++ src/ie.h | 1 + 2 files changed, 25 insertions(+) diff --git a/src/ie.c b/src/ie.c index 89f19b11a0fb..a424af275634 100644 --- a/src/ie.c +++ b/src/ie.c @@ -437,6 +437,30 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite) } } +const char *ie_rsn_cipher_suite_to_string(enum ie_rsn_cipher_suite suite) +{ + switch (suite) { + case IE_RSN_CIPHER_SUITE_CCMP: + return "CCMP-128"; + case IE_RSN_CIPHER_SUITE_TKIP: + return "TKIP"; + case IE_RSN_CIPHER_SUITE_WEP40: + return "WEP-40"; + case IE_RSN_CIPHER_SUITE_WEP104: + return "WEP-104"; + case IE_RSN_CIPHER_SUITE_BIP_CMAC: + return "BIP-CMAC-128"; + case IE_RSN_CIPHER_SUITE_GCMP: + return "GCMP-128"; + case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: + return "NO-TRAFFIC"; + case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: + break; + } + + return NULL; +} + /* 802.11, Section 8.4.2.27.2 */ static bool ie_parse_cipher_suite(const uint8_t *data, enum ie_rsn_cipher_suite *out) diff --git a/src/ie.h b/src/ie.h index 2cbe35f2bdcc..1dadcb6be718 100644 --- a/src/ie.h +++ b/src/ie.h @@ -587,6 +587,7 @@ unsigned char *ie_tlv_builder_finalize(struct ie_tlv_builder *builder, size_t *out_len); uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite); +const char *ie_rsn_cipher_suite_to_string(enum ie_rsn_cipher_suite suite); int ie_parse_rsne(struct ie_tlv_iter *iter, struct ie_rsn_info *info); int ie_parse_rsne_from_data(const uint8_t *data, size_t len, From patchwork Fri Oct 21 19:12:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015302 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D2636127 for ; Fri, 21 Oct 2022 19:13:45 +0000 (UTC) Received: by mail-oi1-f175.google.com with SMTP id r204so1518610oie.5 for ; Fri, 21 Oct 2022 12:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A905O3m3o5kthDoiJTtkx1OzXE58O7aDsZLCw1j9tyQ=; b=AcpemlENZgnoWsfGs0odkEu70btDkJWtxTF01Nr7w/K1k44GIv/ac0yMrStfDpVF9/ 2/rNSPkMrQKmO9XdDHA9MdWNKrDO9G4DdY2Q/eE5AHvRA24zGpql8B7UTDu6K+49M1+p pGU0oPYEuf/gNwk0m4hODCOi79g9rRr9d01lZUL+6b2Uf8sEX2YYNqJh8pMGGD7deBN/ 9cXVAPVqpJC2qG7w2QlRw8uBP34BD1RB/N+uF48KbPqB3HN6ySWp1xONZrwrtXsLqsX9 qdBTge53PJzXh6BGi+QmMu0kBWnL6kE3k60hve44PW64bTISEkWBpUY4yDJtB2ilXDD1 5iLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A905O3m3o5kthDoiJTtkx1OzXE58O7aDsZLCw1j9tyQ=; b=XcyYZhclJ5YdTnH48yq/o8n+KY2y6OEKxnbboUDyWNIzQTIQvN1HnmTj022Etr9q0Y pP2mhN/UqRKkSfkn6phNC8n0CJp15GDnjmsRNwzj+jVbPTgvVkN34gg75ZTsecs5qpYZ I99UDHiw1e4If66ukdGNiv8uU+0WU6WghaNoHv8TYcaMmP8pndMI/IkWPTrI6xNUWCUR vn/uq6JJbiIfsr9vCj1rdhxIqwPi5fWxpi4ck/iZBqQRkKuk0IuFbBf1bN8NzigbOeWY yhhvEz96UDF6YCv7gSdlAL6jKmbdQchsmpTIMcNVItZgi4t3DvqikDHpatxzs5qo2JYW R6xw== X-Gm-Message-State: ACrzQf006xVuBwSwZN0hVI4DY/SYGDY2Kv/MYZrvUGnVKdJ29LRL2zqv QeTDz89W0nzs0fEbGwERuOokWlYvxgQ= X-Google-Smtp-Source: AMsMyM6hG2lM9HIR9Aq/8FzHE5jpje7KkEMvRjYn6HgA1x7TJOHif9tAjloJmBq+bYujjai0WOmdlg== X-Received: by 2002:a05:6808:13ca:b0:354:bd5b:c2b7 with SMTP id d10-20020a05680813ca00b00354bd5bc2b7mr11034908oiw.118.1666379623929; Fri, 21 Oct 2022 12:13:43 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:43 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 11/26] wiphy: Generalize supported cipher dumper Date: Fri, 21 Oct 2022 14:12:52 -0500 Message-Id: <20221021191307.31492-11-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To make it easier to support additional ciphers in the future. --- src/wiphy.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/wiphy.c b/src/wiphy.c index 3e08047910e1..da4610d094d5 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -1120,7 +1120,7 @@ static void wiphy_print_band_info(struct band *band, const char *name) static void wiphy_print_basic_info(struct wiphy *wiphy) { - char buf[1024]; + char buf[2048]; l_info("Wiphy: %d, Name: %s", wiphy->id, wiphy->name); l_info("\tPermanent Address: "MAC, MAC_STR(wiphy->permanent_addr)); @@ -1135,18 +1135,33 @@ static void wiphy_print_basic_info(struct wiphy *wiphy) wiphy_print_band_info(wiphy->band_6g, "6GHz Band"); if (wiphy->supported_ciphers) { - int len = 0; + int n = 0; + size_t len = 0; + int i = sizeof(wiphy->supported_ciphers) * 8 - 1; - len += sprintf(buf + len, "\tCiphers:"); + len += snprintf(buf, sizeof(buf), "\tCiphers:"); - if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_CCMP) - len += sprintf(buf + len, " CCMP"); + for (; i >= 0 && len < sizeof(buf); i--) { + typeof(wiphy->supported_ciphers) cipher = 1 << i; + const char *str; - if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_TKIP) - len += sprintf(buf + len, " TKIP"); + if (cipher == IE_RSN_CIPHER_SUITE_WEP40 || + cipher == IE_RSN_CIPHER_SUITE_WEP104) + continue; + + if (!(wiphy->supported_ciphers & cipher)) + continue; - if (wiphy->supported_ciphers & IE_RSN_CIPHER_SUITE_BIP_CMAC) - len += sprintf(buf + len, " BIP"); + str = ie_rsn_cipher_suite_to_string(cipher); + if (!str) + continue; + + len += snprintf(buf + len, sizeof(buf) - len, "%s%s", + !n || (n % 4) ? " " : "\n\t\t ", + str); + + n += 1; + } l_info("%s", buf); } From patchwork Fri Oct 21 19:12:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015303 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF5046127 for ; Fri, 21 Oct 2022 19:13:46 +0000 (UTC) Received: by mail-oi1-f169.google.com with SMTP id w74so4362095oie.0 for ; Fri, 21 Oct 2022 12:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IgUrKnJO1a7AwlPdQgQD5u3nwYf3oTBDHCB6aXaW0jc=; b=WDo8aTXzFHPv1/58DW3d7UZ32KDVbKtjm+UrDgKISlz2+SmnvQjphTs0cIZq0nWuDY 1voACmYMI/HM6iTbMADpV5BKvtskpWIZSF6yEwJk5fTrI/I31EZ0lAKG7fFexel4+/A/ YFf/ReCkgwQe0YPtj1iRquIC6Q6e+JRRZPxdbR3Zn4ALYw4IXbNMrk9blDgm50LNUL2h KCjkqsVIecER3rHwsDsebOqP/nl5g/wnocZzmPnD078CaNToJuTgghpmYLiWvIupokuC bTbg+4pYE1dSjQ/zdPIy8mre1FdHKanJav6Ieur56RpC0epX4UEDzfZkKknIjP19svy4 hkjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IgUrKnJO1a7AwlPdQgQD5u3nwYf3oTBDHCB6aXaW0jc=; b=i8Ajt7tLl5MqkJTkghlAZeruG7VnKsPf4e4PBh88frvj/paKBDJODhgEG2KmlWwUK5 cIPXJddhaOcooCIn4rVbtga3Nk/lTsL+AQfrCAWN42TGHVIzjzqPXbtVb6GjW/TL67Ei Lq4UDtcRVLpU7JB6df23/FM4H3NYstzc/ov1/I4IJNfmt7apHgCnFPUKyKvDm9AAJ7Tb gNc6MjPwOvWXbVAg1IC8exPSUDy9M40OUe07fLlrrmf9ge/AiY3+IqWWX28XdJm4qDYz tDt+qVY5qhHwrJRundNVHuvTvIIaLkFlHs6r/+CeqQtC/66TP4mx6NemFXtKCEuiYa6l N4NA== X-Gm-Message-State: ACrzQf2U2QQ2R2oEZ76iJ3BE+LvkRcJ/H2NRqBwXlnfNYFZ4KeKtVcLq iCGrjOd7GyIkVX8YoF8ABUhCRea+Nig= X-Google-Smtp-Source: AMsMyM6cYwlg99nLrAGOkG6g0XjXgzEvOhBcJr/pxnQbfGenLEW9auwzB992zuhZsr+U+guij08gdw== X-Received: by 2002:aca:2207:0:b0:354:4cdb:72bf with SMTP id b7-20020aca2207000000b003544cdb72bfmr10569471oic.71.1666379625387; Fri, 21 Oct 2022 12:13:45 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:44 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 12/26] wiphy: Support GCMP cipher suite Date: Fri, 21 Oct 2022 14:12:53 -0500 Message-Id: <20221021191307.31492-12-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/station.c | 3 ++- src/wiphy.c | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/station.c b/src/station.c index 294edd615107..e0c163fb7e44 100644 --- a/src/station.c +++ b/src/station.c @@ -1167,7 +1167,8 @@ build_ie: * also indicates support. */ if (wiphy_supports_ext_key_id(wiphy) && bss_info.extended_key_id && - info.pairwise_ciphers == IE_RSN_CIPHER_SUITE_CCMP) + (info.pairwise_ciphers & (IE_RSN_CIPHER_SUITE_CCMP | + IE_RSN_CIPHER_SUITE_GCMP))) info.extended_key_id = true; /* RSN takes priority */ diff --git a/src/wiphy.c b/src/wiphy.c index da4610d094d5..f0451b60416e 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -150,7 +150,9 @@ enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask) mask &= wiphy->supported_ciphers; - /* CCMP is our first choice, TKIP second */ + if (mask & IE_RSN_CIPHER_SUITE_GCMP) + return IE_RSN_CIPHER_SUITE_GCMP; + if (mask & IE_RSN_CIPHER_SUITE_CCMP) return IE_RSN_CIPHER_SUITE_CCMP; @@ -1234,6 +1236,9 @@ static void parse_supported_ciphers(struct wiphy *wiphy, const void *data, wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_BIP_CMAC; break; + case CRYPTO_CIPHER_GCMP: + wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_GCMP; + break; default: /* TODO: Support other ciphers */ break; } From patchwork Fri Oct 21 19:12:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015304 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC2236127 for ; Fri, 21 Oct 2022 19:13:48 +0000 (UTC) Received: by mail-oi1-f182.google.com with SMTP id y72so4308249oia.3 for ; Fri, 21 Oct 2022 12:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8y/A/GlJkNBvJym4h19T9hvt3iF8NBWeraLeRqbLf+4=; b=fsxiNfEV5Glo8j6ax31W0R+c/psrpnoNOgsoBqEArbYPubMHVv68fU5XftrQ5HAX2a exJ5bECjAqA+Fn0ExHaan04DF3ANRAwQBonu/WztEsENqvIAmgg0eSCN6aMu3SI0ftNW HooE86JVrI76Ci+amTAt7cTtUfAqIu+TDrTKdpxpxvugAHQURhAHIrw1dP4NaN0Rb/gb ooD/uCd2Q1M+l2H449T8zzfeajJ2jYqQyV+neW+iaPGu/bi5tltImCtDZP3rpu63QRoB 0F6JV/IRtv25Zgf4gW0Qq8Ahjjm6yCcBJT4tJyvQnkfW1khx9O0kuSbNewE4pWxxJT4+ NYLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8y/A/GlJkNBvJym4h19T9hvt3iF8NBWeraLeRqbLf+4=; b=Xx62mvbQdKuHtJc7gzIGfIUF054F1xrIt6SepBY8SdPT/qV2yPtxBafyRStMmAvaqo UkJFU/vpfELFztdVI7y2zP8EQkomZQYlk+j64QofQn6KTyCLFybEJ5iCLtiHwqFAwTJ1 HCkKtx5GipjlDy9n+YzYnp/MQRpRcQjsLiGzARRfsrxwh1sH41pV56qRa7bM59/4XWzc FvA/HAR5qN+GGT8HrKD9AKKoY1NU6/EzEp8C/Y8Trwj+tG/DeFjXxFNn0t4xKgo307Ao v1zcIogScDiis2u0MdzkNsxhaAUo3mbPtq6Fr6PLauOGxYU027zytaaNn53TU4NEY+I1 nImg== X-Gm-Message-State: ACrzQf0CqtPaWLhRct3n5Dk+t19ApyFC+C++VSm3VLmHBRQhgE7r+tKW nKRnzOjrBFyCR4zHRij/bUiaad577a4= X-Google-Smtp-Source: AMsMyM4/cErNKX8cEFFiOi2HQMQXCFNVzebAvl8lsMVPifSKo9AmN/Gz1a4mky1JZdAo0nHf8eRPZw== X-Received: by 2002:aca:ab57:0:b0:354:febd:62c9 with SMTP id u84-20020acaab57000000b00354febd62c9mr10740691oie.156.1666379627356; Fri, 21 Oct 2022 12:13:47 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:46 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 13/26] doc: Document PairwiseCipher property Date: Fri, 21 Oct 2022 14:12:54 -0500 Message-Id: <20221021191307.31492-13-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add an additional optional PairwiseCipher property on net.connman.iwd.StationDiagnostic interface that will hold the current pairwise cipher in use for the connection. --- doc/station-diagnostic-api.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/station-diagnostic-api.txt b/doc/station-diagnostic-api.txt index d1a340ad4d5a..a974b8130c3a 100644 --- a/doc/station-diagnostic-api.txt +++ b/doc/station-diagnostic-api.txt @@ -43,6 +43,12 @@ Methods dict GetDiagnostics() TxMCS [optional] - Transmitting MCS index + PairwiseCipher [optional] - The pairwise cipher chosen + for this connection. Possible values are: + - CCMP-128 + - TKIP + - GCMP-128 + Possible errors: net.connman.iwd.Busy net.connman.iwd.Failed net.connman.iwd.NotConnected From patchwork Fri Oct 21 19:12:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015305 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB331612B for ; Fri, 21 Oct 2022 19:13:49 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id 101-20020a9d0bee000000b00661b54d945fso2357958oth.13 for ; Fri, 21 Oct 2022 12:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CjH3kURmk/t18sxDQeCNvexvMtP8PUFBfraBGFjCa5c=; b=Iekjf/j9QvnzG4ZieOmleiOFMhkQUPKnousqfThDxOujE+agur/NBQ7EIHAb2cfx3x dMHDwBD5zceqReB9XRAOb+kSlQL8rImTo+5P+BIS36q5KALkTEps8QHwzxzIQozZajC8 +cgzCcDvrZviH2KIcw3QuoydWj7ggJlx7e0cSsZ77cXRfeStGG8Cap0CoijYfSo/jZFs IGNH9wWv+xYKoqjAzlkaeS6POV68rrGixXKGqBgWkgTzV9mhf5pK0y0xRKNVWoVXm+N8 vy/LfP69T3iiEEJimVC1bHaLEi0OQ02gGb4RV8Ei/PDLiDtIK3NrS53skBSbJDWAZFxp aOew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CjH3kURmk/t18sxDQeCNvexvMtP8PUFBfraBGFjCa5c=; b=sD6Ku3gOHigxtumaOj4jZ5kxsi2jTPbtM98/hkro78Fwvbb2ij1+mmzlSH8myC3U29 JSIn+kpoxXe91abpaT3kd6EPx2JM/AHWs+CpvUw93Yi3kKegNPE/53okOvQigRlQpscv 1gzhJHTbYfxe2aWoHx1GTPt6uRq9/L+VaEJiTkaeF1QLL55Fo2+YgR0wAm5zQGRVyoqX hRKWvKMK+X0Yfnge387Io9iwtZmOFmxBRpuJYgwugAiZbyQnSTWoNO/pBGKK/O+/0XhN fldcu9KZunGUPW3N9B4wy1LXGoqyqUgCTECdFccNUOMQ2CA8b4IVDXgWLozwSpW/zbwA 3Hng== X-Gm-Message-State: ACrzQf2y4fEH5vnhyeZ1SJyzyzVIbrDSFztxSGrJTydXLCcpE9fytFQI poTCPsGHdmFHjVOisRBfOdXrJ82PFwg= X-Google-Smtp-Source: AMsMyM5fv5uaIruJxSK81KwENUnTBiZ9xACDqu+UwMQYyydr1o13mSyP7Zis7LtUnq6VCnY+wihQrA== X-Received: by 2002:a05:6830:4b5:b0:661:d8ee:b4ac with SMTP id l21-20020a05683004b500b00661d8eeb4acmr10340769otd.296.1666379628909; Fri, 21 Oct 2022 12:13:48 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:48 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 14/26] station: diagnostic: implement PairwiseCipher Date: Fri, 21 Oct 2022 14:12:55 -0500 Message-Id: <20221021191307.31492-14-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/station.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/station.c b/src/station.c index e0c163fb7e44..11e86d1f06c2 100644 --- a/src/station.c +++ b/src/station.c @@ -4509,6 +4509,21 @@ static void station_get_diagnostic_cb( diagnostic_akm_suite_to_security(hs->akm_suite, hs->wpa_ie)); + if (hs->pairwise_cipher) { + const char *str; + + if (hs->pairwise_cipher == + IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER) + str = ie_rsn_cipher_suite_to_string(hs->group_cipher); + else + str = ie_rsn_cipher_suite_to_string( + hs->pairwise_cipher); + + if (str) + dbus_append_dict_basic(builder, "PairwiseCipher", + 's', str); + } + diagnostic_info_to_dict(info, builder); l_dbus_message_builder_leave_array(builder); From patchwork Fri Oct 21 19:12:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015306 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 521BF612B for ; Fri, 21 Oct 2022 19:13:52 +0000 (UTC) Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-1322d768ba7so4752321fac.5 for ; Fri, 21 Oct 2022 12:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t0kWoZfFdjNHSq4gma9SU+0+HgA3ePJmbsrTgnIa8KA=; b=PuHct5Vp7LhM8uMkflRdFM8X+ow9XyO2MngU5zaxQ9oL9wZ4zqcK9YNpZL+9sNKrRZ 40lr82bNJi71UFjgUDUHj+iT5Jb8kvI94tmEroa/AybghuVBWElvG15vu2EJ3lnlVsW+ LNY26MFD0wLew9WGeWjsXf0RIFgn1QHpe/voNwx6ThFUN5E2Zg4f5vExo9EeJZfPZyeH jDmabBrtlUiWCeNapdMrb2J/O9YHPj2HTtXVlXkw4ttkONLtoEkEZPa+F8lYifR/+HFY SVMpTN4O7450Cssrhtj2TTkFvtaOG+uLiJZ4nNri2uKWOBhVGktj+etJvPmcQLfCs+uj QUXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t0kWoZfFdjNHSq4gma9SU+0+HgA3ePJmbsrTgnIa8KA=; b=qHhFZR0M4pDcXrmQIcXXXb2w9EY61catCZFIYpDW/fFavPKRWMtlhGfPfXs7hJkV3z RRHVW+qnNQ2NgFE4JjWi+RKi5czUBVi8OXHooqxnAVLkwZGLhTeZ52pzl6AIh6UlItyH abS75b68mQ9DCWwnYfde8xDI8gOgeNtQHul6fYrhofKNno7sj9XcYyfEapf7apdPSORY 96ruLPP0CKEF5i6cFMs9G9LTCca7O6/Nwp13GaHtHynQ+lRA7jEMO2jDZ+MRi8rVWI/w FI8LW4+0ZDBPdAuEeVmfiPun0PpocGx5i2yU4amUYIBDhMbI6py+I4PDnEuKKEk1XmPH itSw== X-Gm-Message-State: ACrzQf2gh0ou7vP1SFWqMKfDuq+t4nRKSpM4OWTVdfm4KTGwU7gqhg/L l6KWTTbJXr7rUrcgayLEws7E9NipgzA= X-Google-Smtp-Source: AMsMyM5V3Omf8N0NEGbk2tAVtOUtkgsfGtCKvZSfONHJAMUQXEfwg7IjRK4OyySpywXXgzdA+tSNFA== X-Received: by 2002:a05:6870:c08a:b0:132:dc3a:ecdf with SMTP id c10-20020a056870c08a00b00132dc3aecdfmr14895316oad.299.1666379630881; Fri, 21 Oct 2022 12:13:50 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:50 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 15/26] auto-t: Support multiple pairwise ciphers in WPA2 Date: Fri, 21 Oct 2022 14:12:56 -0500 Message-Id: <20221021191307.31492-15-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- autotests/testWPA2/connection_test.py | 30 +++++++++++++++---- autotests/testWPA2/failure_test.py | 4 +-- autotests/testWPA2/hw.conf | 3 +- autotests/testWPA2/password_test.py | 4 +-- .../testWPA2/{ssidCCMP.conf => ssidWPA2.conf} | 2 +- 5 files changed, 31 insertions(+), 12 deletions(-) rename autotests/testWPA2/{ssidCCMP.conf => ssidWPA2.conf} (83%) diff --git a/autotests/testWPA2/connection_test.py b/autotests/testWPA2/connection_test.py index bf8831ea81db..2cbdf8e1b788 100644 --- a/autotests/testWPA2/connection_test.py +++ b/autotests/testWPA2/connection_test.py @@ -8,20 +8,19 @@ import iwd from iwd import IWD from iwd import PSKAgent from iwd import NetworkType +from hostapd import HostapdCLI import testutil class Test(unittest.TestCase): - def test_connection_success(self): - wd = IWD() - + def validate_connection_success(self, wd): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) devices = wd.list_devices(1) device = devices[0] - ordered_network = device.get_ordered_network('ssidCCMP') + ordered_network = device.get_ordered_network('ssidWPA2') self.assertEqual(ordered_network.type, NetworkType.psk) @@ -43,13 +42,32 @@ class Test(unittest.TestCase): wd.unregister_psk_agent(psk_agent) + def test_ccmp(self): + self.hostapd.set_value('rsn_pairwise', 'CCMP') + self.hostapd.reload() + self.hostapd.wait_for_event("AP-ENABLED") + self.validate_connection_success(self.wd) + + def test_gcmp(self): + self.hostapd.set_value('rsn_pairwise', 'GCMP') + self.hostapd.reload() + self.hostapd.wait_for_event("AP-ENABLED") + self.validate_connection_success(self.wd) + + def setUp(self): + self.wd = IWD(True) + + def tearDown(self): + self.wd.clear_storage() + self.wd = None + @classmethod def setUpClass(cls): - pass + cls.hostapd = HostapdCLI(config='ssidWPA2.conf') @classmethod def tearDownClass(cls): - IWD.clear_storage() + pass if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testWPA2/failure_test.py b/autotests/testWPA2/failure_test.py index 605ee5dddc59..61cf6ade87b0 100644 --- a/autotests/testWPA2/failure_test.py +++ b/autotests/testWPA2/failure_test.py @@ -13,7 +13,7 @@ import testutil class Test(unittest.TestCase): def test_connection_success(self): - wd = IWD() + wd = IWD(True) psk_agent = PSKAgent("InvalidPassword") wd.register_psk_agent(psk_agent) @@ -22,7 +22,7 @@ class Test(unittest.TestCase): self.assertIsNotNone(devices) device = devices[0] - ordered_network = device.get_ordered_network('ssidCCMP') + ordered_network = device.get_ordered_network('ssidWPA2') self.assertEqual(ordered_network.type, NetworkType.psk) diff --git a/autotests/testWPA2/hw.conf b/autotests/testWPA2/hw.conf index fad15b8823a3..51350f989552 100644 --- a/autotests/testWPA2/hw.conf +++ b/autotests/testWPA2/hw.conf @@ -1,5 +1,6 @@ [SETUP] num_radios=2 +start_iwd=0 [HOSTAPD] -rad0=ssidCCMP.conf +rad0=ssidWPA2.conf diff --git a/autotests/testWPA2/password_test.py b/autotests/testWPA2/password_test.py index d937d5c04cd8..1dbfce004c2e 100644 --- a/autotests/testWPA2/password_test.py +++ b/autotests/testWPA2/password_test.py @@ -13,7 +13,7 @@ import testutil class Test(unittest.TestCase): def test_connection_success(self): - wd = IWD() + wd = IWD(True) devices = wd.list_devices(1) device = devices[0] @@ -22,7 +22,7 @@ class Test(unittest.TestCase): condition = 'obj.state == DeviceState.disconnected' wd.wait_for_object_condition(device, condition) - ordered_network = device.get_ordered_network("ssidCCMP") + ordered_network = device.get_ordered_network("ssidWPA2") self.assertEqual(ordered_network.type, NetworkType.psk) network = ordered_network.network_object diff --git a/autotests/testWPA2/ssidCCMP.conf b/autotests/testWPA2/ssidWPA2.conf similarity index 83% rename from autotests/testWPA2/ssidCCMP.conf rename to autotests/testWPA2/ssidWPA2.conf index 074e82283e23..64fd77961f2c 100644 --- a/autotests/testWPA2/ssidCCMP.conf +++ b/autotests/testWPA2/ssidWPA2.conf @@ -1,6 +1,6 @@ hw_mode=g channel=1 -ssid=ssidCCMP +ssid=ssidWPA2 wpa=2 wpa_pairwise=CCMP From patchwork Fri Oct 21 19:12:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015307 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B84A96135 for ; Fri, 21 Oct 2022 19:13:53 +0000 (UTC) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-13aeccf12fbso4701705fac.11 for ; Fri, 21 Oct 2022 12:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xp8WG5OsRkytD8tMWyVETT6orbxjHY/Dh+Z3zcDf7E8=; b=qD7Ndw86Fa/AAVb5EQiT0vidtj08H+3ldOiFsvNMWRMx81YXlY6n6cjA8H6CQe9i1w ZAgAGsvjlPuemOsDp1Z2qkOqy4ccSHEG+KufwYj+uNUKtI6rqOKcdpod76pHa0Rwt2le TnE7n4s5pYheqr4z4MK9nT9CX6ZkWuulYkrwDbd8hjsyJm7oEASAoqdvfNvhI8Mft9EM 1t76T7rXly9JNEzlYNJn/e+Ywk/lddARONpxvJp1ZbpKZ49lbVaMdj4NzXfKzv+IysJJ N83GZI/CA+tF7rwe8eV3qCh6MDMzRhz/h3dAzeEwg3+RT941GPRbqYmhZPYqcJURduHZ MR+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xp8WG5OsRkytD8tMWyVETT6orbxjHY/Dh+Z3zcDf7E8=; b=4bKKuGX0xedXI7hqXuhE5k6eujdW6/QgdIpvg2WEoh+jV8f5JfbcVCN1I31IJC9g2V VFxEDANe2dpywIHSdeTTia94fWSgfwIUIiPyziYt0Hl9gOcgsvykl0623sthEH+t0Jsf oAi0bxKgl724Fye3pu2JzmgDSqfqmy+fzqJoxoSoZzkmPf2aXPYJiNThV/1zBLH2eatT hi9NaWHdEUimcBiqIKeH0beVqZzVkZBGAUD33vNQM8h2HCppSevc0PeC7LS1RJqYswpT xfrTbseqUgxrDn9R+H9g5+5sDxBD+qlkaOh1XQOdkZTDdo7nuFArUadXD6EdM746pPDS rcaw== X-Gm-Message-State: ACrzQf1aQ3Jqvq2K+Y0erXKu2Sr5lPKuqwE3Zb+RTHgiNOyIyYpCNfuI jBBX9hDqc6EgCwAUsEfrA6cyRs+NgTs= X-Google-Smtp-Source: AMsMyM6Y/GyGdD1HNJkuwXGmVjfGhspzBoeuOjtzvxSgRYdKbzTD5r1uf1dvSCZDXImRo/FWMWkqjw== X-Received: by 2002:a05:6871:90:b0:136:b9e8:a024 with SMTP id u16-20020a056871009000b00136b9e8a024mr29178444oaa.60.1666379632383; Fri, 21 Oct 2022 12:13:52 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:51 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 16/26] ie: Add support for GCMP|CCMP-256 Date: Fri, 21 Oct 2022 14:12:57 -0500 Message-Id: <20221021191307.31492-16-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/ie.c | 26 ++++++++++++++++++++++++++ src/ie.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/src/ie.c b/src/ie.c index a424af275634..4a3e02e11cac 100644 --- a/src/ie.c +++ b/src/ie.c @@ -432,6 +432,10 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite) return CRYPTO_CIPHER_BIP_CMAC; case IE_RSN_CIPHER_SUITE_GCMP: return CRYPTO_CIPHER_GCMP; + case IE_RSN_CIPHER_SUITE_GCMP_256: + return CRYPTO_CIPHER_GCMP_256; + case IE_RSN_CIPHER_SUITE_CCMP_256: + return CRYPTO_CIPHER_CCMP_256; default: return 0; } @@ -452,6 +456,10 @@ const char *ie_rsn_cipher_suite_to_string(enum ie_rsn_cipher_suite suite) return "BIP-CMAC-128"; case IE_RSN_CIPHER_SUITE_GCMP: return "GCMP-128"; + case IE_RSN_CIPHER_SUITE_GCMP_256: + return "GCMP-256"; + case IE_RSN_CIPHER_SUITE_CCMP_256: + return "CCMP-256"; case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: return "NO-TRAFFIC"; case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: @@ -496,6 +504,12 @@ static bool ie_parse_cipher_suite(const uint8_t *data, case 8: *out = IE_RSN_CIPHER_SUITE_GCMP; return true; + case 9: + *out = IE_RSN_CIPHER_SUITE_GCMP_256; + return true; + case 10: + *out = IE_RSN_CIPHER_SUITE_CCMP_256; + return true; default: return false; } @@ -610,6 +624,8 @@ static bool ie_parse_group_cipher(const uint8_t *data, case IE_RSN_CIPHER_SUITE_WEP40: case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: case IE_RSN_CIPHER_SUITE_GCMP: + case IE_RSN_CIPHER_SUITE_GCMP_256: + case IE_RSN_CIPHER_SUITE_CCMP_256: break; default: return false; @@ -635,6 +651,8 @@ static int ie_parse_pairwise_cipher(const uint8_t *data, case IE_RSN_CIPHER_SUITE_WEP40: case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: case IE_RSN_CIPHER_SUITE_GCMP: + case IE_RSN_CIPHER_SUITE_GCMP_256: + case IE_RSN_CIPHER_SUITE_CCMP_256: break; default: return -ERANGE; @@ -945,6 +963,12 @@ static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui, case IE_RSN_CIPHER_SUITE_GCMP: selector = 8; goto done; + case IE_RSN_CIPHER_SUITE_GCMP_256: + selector = 9; + goto done; + case IE_RSN_CIPHER_SUITE_CCMP_256: + selector = 10; + goto done; } return false; @@ -1034,6 +1058,8 @@ static int build_ciphers_common(const struct ie_rsn_info *info, uint8_t *to, IE_RSN_CIPHER_SUITE_WEP40, IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER, IE_RSN_CIPHER_SUITE_GCMP, + IE_RSN_CIPHER_SUITE_GCMP_256, + IE_RSN_CIPHER_SUITE_CCMP_256, }; unsigned int pos = 0; unsigned int i; diff --git a/src/ie.h b/src/ie.h index 1dadcb6be718..f447a4f98d81 100644 --- a/src/ie.h +++ b/src/ie.h @@ -332,6 +332,8 @@ enum ie_rsn_cipher_suite { IE_RSN_CIPHER_SUITE_BIP_CMAC = 0x0020, IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC = 0x0040, IE_RSN_CIPHER_SUITE_GCMP = 0x0080, + IE_RSN_CIPHER_SUITE_GCMP_256 = 0x0100, + IE_RSN_CIPHER_SUITE_CCMP_256 = 0x0200, }; enum ie_rsn_akm_suite { From patchwork Fri Oct 21 19:12:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015308 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3F306135 for ; Fri, 21 Oct 2022 19:13:55 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id cy15-20020a056830698f00b0065c530585afso2401869otb.2 for ; Fri, 21 Oct 2022 12:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NvxEGWfH3iv4jxzU7pvZIEePTFMoZC0TyDgj4eDVwoY=; b=DuWB//0GHEwZIJcvLCjAAaFoldYHCpS/r/UTj/PJ79mdkfnDSM8SCJOSqH5BkhWu8R j79D8FmccJED66F5wS9xxhPNKbZOrA3PH/AwvQi2Bt1287bDuLC53cxcjQxwqNB5E7D/ J8K9z0MBKOpBXy3UdXF7EqpTknZjl79NAyGdFPZHYH0ajweBVCHzFQyGQlaExRZ3yseI +jtmSx3LOUG7uD4gIjAV+iVelNUJFRD0nr+m6Ft0yRohWvm57rdhAc0gmJZbALmp2wX+ rrBLRcge+Q26wAW5pu9cvmY/KNK4G7/AsHlw4X8KF1SMg88eBCWGhiWdgrXqNX8wAKUD hP0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NvxEGWfH3iv4jxzU7pvZIEePTFMoZC0TyDgj4eDVwoY=; b=dbwm+gOXn4eMMoVEc46bd9b8krhkjzXbBcVTasO/yI/WFcodYYd5xyjnH7resI3oN+ VBsnrtBopTW/Rf4e7ReM3vTrswQjR7sWD8K1icnd+kUlvtb1o2570G4YD84mw1ElBbc5 n04AVYrm84ohE+Kv51KSscayUwZNgm0IV0ErwYB+Jb7+DsT38JSHV2ttaCW0Hofc1wVc SZn2ZsQXE/CPRfrXShGIAlKHZOe/+AUT/iJDf5FhYGsrUDfp0133ZsORa9BVMtZzkNkN cDE8GMZs6l9/UNtdDmN34Agjq5KN7chkpRL85yMMteBbfkEYA4W90kUfBhulWMfzd3+a eD6A== X-Gm-Message-State: ACrzQf2wesiav5OzmKcnc7Taxgg9QXbIp6fpgByKnm81KRRzINoQsNth py/MIYSR9zNdPJEnNVPFop22AKQ5H48= X-Google-Smtp-Source: AMsMyM7k4P/pG8MaU5gvTdYPzob4TtOZcTSkHhQn/22yZlk5Xs8PMVBRDn0OgLib+N8ZmZ0hPrwzXw== X-Received: by 2002:a9d:3e59:0:b0:661:c029:d7bb with SMTP id h25-20020a9d3e59000000b00661c029d7bbmr10677835otg.112.1666379634420; Fri, 21 Oct 2022 12:13:54 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:53 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 17/26] netdev: Add support for CCMP|GCMP-256 Date: Fri, 21 Oct 2022 14:12:58 -0500 Message-Id: <20221021191307.31492-17-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 These are similar to CCMP/GCMP, just a different key size which is already taken care of by calling crypto_cipher_key_len --- src/netdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/netdev.c b/src/netdev.c index 4ca230e42b1f..7b8948604347 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1565,6 +1565,8 @@ static bool netdev_copy_tk(uint8_t *tk_buf, const uint8_t *tk, switch (cipher) { case CRYPTO_CIPHER_CCMP: case CRYPTO_CIPHER_GCMP: + case CRYPTO_CIPHER_GCMP_256: + case CRYPTO_CIPHER_CCMP_256: /* * 802.11-2020 12.8.3 Mapping PTK to CCMP keys: * "A STA shall use the temporal key as the CCMP key From patchwork Fri Oct 21 19:12:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015309 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39B8A6138 for ; Fri, 21 Oct 2022 19:13:57 +0000 (UTC) Received: by mail-oi1-f179.google.com with SMTP id u15so4318101oie.2 for ; Fri, 21 Oct 2022 12:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=74q1P5RcsX1FHWF2pqVTy+LDchQUI6twF0RQTqfeG28=; b=dc24faqGgAr9xNWY/LBy1L8FBQZEyi4aiVYJe6H1/n2R+JL+6iIu9Ticnk3hE/GNNI TSmpZWPwjYQ8i2tmol9n0vlWIFREq349vZGik8i8ucmy8svKnP/oa09N4lDXpRMB2FR3 5gjWcti2ya6V1F0d3uYTwFNJ2tFduSdHQIoQvu4A6nUixRPvFAwt1bjN5zhDiJEN0DHz HlMmW+WRJlYhBFGC1ALdteXAA0wbeC0PBsYEMRnbLG1BOiAt2jSWXuzWMgsJO3Dbp2fj ZIVpzqdful9XpcMqfwaBKkhcFS+rry5CIZ1dC2lj/Fic7GopJnyJbH15SBNkZtNnfm9j ZoqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=74q1P5RcsX1FHWF2pqVTy+LDchQUI6twF0RQTqfeG28=; b=E1VtieK2EW5feA9A/cfBWjzWiJQYHsXr2TzvGNgLBchmf+2qz7adfCONBSxvkSMs3C sjt8C6/DO8CpFyRiP7RXLzEBmfB3Djz0IdYDMuJ+H/Wb41Cjr9KolhY0g9A4+okiED1w wgeoXH4nxmm7+reS6/ZFdniaPaNkfFc1cGBs4/m0u21S9Z2khapmO5/ccJIcdCj4XTSX JVoqQpFnhmvVevPol/Bijyv3oUtuEBfIgsd4IdoRsVDT/6e8IXvlB2e2qceRJq4pdobK hoQn23xyzNJtXuDo3SvgqahjtceTb3At0Uy+HcRXTkXHDD1IhvxTycDCLgXxZnn42x6Y ovmA== X-Gm-Message-State: ACrzQf0XUyrXDDA+X+I9LqfE25r29RISQiEI3b8n6s9X4gYyPcHcaXtt qARAMHvN1GVVe1KmAKAJ+vkLGsQgSdw= X-Google-Smtp-Source: AMsMyM7xF5JL49NwyOMHmTM6u88eMph+GKau/Z96QEPX2TvKLA75NCnKWs1JWz1uuA5Mg+KTLHoC5Q== X-Received: by 2002:a05:6808:ec4:b0:354:475a:c101 with SMTP id q4-20020a0568080ec400b00354475ac101mr11100679oiv.56.1666379635787; Fri, 21 Oct 2022 12:13:55 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:55 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 18/26] ie: Add IE_CIPHER_IS_GCMP_CCMP inline Date: Fri, 21 Oct 2022 14:12:59 -0500 Message-Id: <20221021191307.31492-18-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Similar to IE_AKM_IS_* functions --- src/ie.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ie.h b/src/ie.h index f447a4f98d81..e69175635908 100644 --- a/src/ie.h +++ b/src/ie.h @@ -390,6 +390,14 @@ static inline bool IE_AKM_IS_8021X(uint32_t akm) IE_RSN_AKM_SUITE_FT_OVER_8021X_SHA384); } +static inline bool IE_CIPHER_IS_GCMP_CCMP(uint32_t cipher_suite) +{ + return cipher_suite & (IE_RSN_CIPHER_SUITE_CCMP | + IE_RSN_CIPHER_SUITE_CCMP_256 | + IE_RSN_CIPHER_SUITE_GCMP | + IE_RSN_CIPHER_SUITE_GCMP_256); +} + #define IE_LEN(ie) \ ((ie) ? (ie)[1] + 2 : 0) From patchwork Fri Oct 21 19:13:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015310 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 139A06134 for ; Fri, 21 Oct 2022 19:13:59 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id p24-20020a9d6958000000b00661c528849eso2369771oto.9 for ; Fri, 21 Oct 2022 12:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7ZeyfgP692EXnD9OkF5MVt/X3WIkq8K8+w1Boi566YQ=; b=gkbyrfctK3h4eG5ryS6igc6JiIOeidUSD5mDdgOe+Dw+pPNsUsWKJ2gkcCHNi3QZz6 XUJu9skcTKDbye9rPrKc7foaADLIcCoZ365ZFEX0PycLp1IWSrWLXLtUdkzfElg0rRKt 5vjewC4c5yveGs8G1qjQ+6BZChSLxM9kztkV4jqcQwoUZBN68RFKBheCs0jktzRNDYex T//MfsMsgLCIeQTqXSr0UPzDjWD7hACAG+KdJUSDvGTFYZCvYDxAElD6OQizo2ltd/24 Aqga6dYiUesigBxtrjJ0d76WJ8Kxk/tXGs8S6Q6EpbKQhTicjwCzEvbPqs+ByR9FNMLS bL4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ZeyfgP692EXnD9OkF5MVt/X3WIkq8K8+w1Boi566YQ=; b=sHk3rWl7tiRWHWcsQXqM5wMGfv+2IzRZ96X7wyBagDWNREkyVBSRm7AfcZ9bqxzbyg wfu1uGX3zbuBboMSP1bskNLjOh4N4ehJon5C/pKvziD4hDDO9sgn5LYkfytz7Wdh0u+4 n8ENJOcTGCr0Ff7KEHpUQ68cfywYi8yD/kqspc/3y7Q0kgax3JomREy65BCQfp4N2/gS aVpljlNbDsxw0D+X+xbyfw7VKYyv0AZf7kSF65oWHgbVra8Hl/L7D1jzzMMphwjcTaCE IWz+hKqFi052PSyH95lw+flrB2/6Jzy0u/xgqLRYydtJ6zWlpc9Z7FY1LcdKiW+nJeJQ 6bFA== X-Gm-Message-State: ACrzQf2n1Gbnzd47jjmNYNSC5oVy5B72KlO3UyzJHzbBbbLJXjU+jQZv HoCrVr3nORA98ZlJHjSt3HOJz7DF8bA= X-Google-Smtp-Source: AMsMyM5MXZ+G8zmOQx7JfI9nkvchc1ecGL22DyCku2sw+pktlBOzPRg+7o98IaX5Crs7OukT/OscWw== X-Received: by 2002:a9d:ee4:0:b0:660:bd64:a3f0 with SMTP id 91-20020a9d0ee4000000b00660bd64a3f0mr10547903otj.234.1666379637693; Fri, 21 Oct 2022 12:13:57 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:56 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 19/26] station: Use IE_CIPHER_IS_GCMP_CCMP Date: Fri, 21 Oct 2022 14:13:00 -0500 Message-Id: <20221021191307.31492-19-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/station.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/station.c b/src/station.c index 11e86d1f06c2..eab16eff5afa 100644 --- a/src/station.c +++ b/src/station.c @@ -1167,8 +1167,7 @@ build_ie: * also indicates support. */ if (wiphy_supports_ext_key_id(wiphy) && bss_info.extended_key_id && - (info.pairwise_ciphers & (IE_RSN_CIPHER_SUITE_CCMP | - IE_RSN_CIPHER_SUITE_GCMP))) + IE_CIPHER_IS_GCMP_CCMP(info.pairwise_ciphers)) info.extended_key_id = true; /* RSN takes priority */ From patchwork Fri Oct 21 19:13:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015311 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00CFA6135 for ; Fri, 21 Oct 2022 19:13:59 +0000 (UTC) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1322fa1cf6fso4735936fac.6 for ; Fri, 21 Oct 2022 12:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SrQAuSsfMGPAVlC+f2WrYfMePuNzuqG0WjHc1g3SYHA=; b=bs2P3FOYB+8vK6XeQyFtVx8rkU+bQxlXedU9WC8QBYhoGMzYr3v1jd99QnFrhX3Pc/ B13MVjYfWOKwZqzLk3KDI6teHjZbbjEhLDNx8ZgsBJ6IJb8R1P6xfDb6VwxMGtpCq14p /tjrviPeHr55d4xwN+WDSdWT+8NqGan6hyyU0d8Ae54mp6rthD3p2kJbHDiAcNm6NOG5 9sY/WKAUuAnE0MR4Kjv3GsmSxY7uPuIGw0483a7K2CEMUG6qSInWSO+tH+ixw2XBsr4l sQ9D4Q7Sg2L4MZzZwlumQgpj61kgJn0RpYelY51XB7q71VldWWMmadOs03T8UlCaang+ 0NWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SrQAuSsfMGPAVlC+f2WrYfMePuNzuqG0WjHc1g3SYHA=; b=o6B1eKV/DG/tIwfR6VNtFNlLeYhjMSpKX41v+qn42ZTMEPBB5yeQ7QGkLaRLDFLE5i 5daidevIZ/x96W8TBKlXM9VZ/oGUi81T8pvTcxAhykyzu87V43mQx5vs2Ly3wVvG3rbj +G2wHnvdOvdU9bZNpJpL7MDu98btfb46wGN77npWspd8iiteDXxWWfmnxXLp/85OB+UQ 0XQDkJ5aInBvm2jODG3S5mJPTLyb5t2XLDNAz9LtRbnO8Df0fJj8VAWvVK4oW5bGZFz8 TjJFJAhBeOnRRpDVsN4/5Rc5avjXZjpcPNxGfmdOTa0DxkNAmQunanycFkj+cAJJ7ViW EcEg== X-Gm-Message-State: ACrzQf22hRS3Zr0lCzT0V0+uOXgqgICjhee1FogprEjbqCzzD9D6pAZD S0uzdzHCY2YqNmHDMSXIAb6VHik5S9Q= X-Google-Smtp-Source: AMsMyM4PXYmyZ+3Zi5YIx2clb3UXlOQyg5T9juvPEfXXIkJSkgEpuTylDYvJlgPOBSKLe1pq8Yzx8w== X-Received: by 2002:a05:6871:453:b0:132:259a:b125 with SMTP id e19-20020a056871045300b00132259ab125mr13490289oag.248.1666379639127; Fri, 21 Oct 2022 12:13:59 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:58 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 20/26] wiphy: Support GCMP|CCMP-256 cipher suites Date: Fri, 21 Oct 2022 14:13:01 -0500 Message-Id: <20221021191307.31492-20-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/wiphy.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/wiphy.c b/src/wiphy.c index f0451b60416e..76f1ba7cfc04 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -150,6 +150,12 @@ enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask) mask &= wiphy->supported_ciphers; + if (mask & IE_RSN_CIPHER_SUITE_GCMP_256) + return IE_RSN_CIPHER_SUITE_GCMP_256; + + if (mask & IE_RSN_CIPHER_SUITE_CCMP_256) + return IE_RSN_CIPHER_SUITE_CCMP_256; + if (mask & IE_RSN_CIPHER_SUITE_GCMP) return IE_RSN_CIPHER_SUITE_GCMP; @@ -1239,6 +1245,14 @@ static void parse_supported_ciphers(struct wiphy *wiphy, const void *data, case CRYPTO_CIPHER_GCMP: wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_GCMP; break; + case CRYPTO_CIPHER_GCMP_256: + wiphy->supported_ciphers |= + IE_RSN_CIPHER_SUITE_GCMP_256; + break; + case CRYPTO_CIPHER_CCMP_256: + wiphy->supported_ciphers |= + IE_RSN_CIPHER_SUITE_CCMP_256; + break; default: /* TODO: Support other ciphers */ break; } From patchwork Fri Oct 21 19:13:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015312 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C201B6135 for ; Fri, 21 Oct 2022 19:14:01 +0000 (UTC) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-13aeccf12fbso4702197fac.11 for ; Fri, 21 Oct 2022 12:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PosxOZALKrEhJtYjRnocYQmLJH8qbE1BqkZ2znv3s3g=; b=HyLacZWZPzhDnXq/W0EWVW6s+gKbmK8NgKysG737j1lTL2j2ZRmvwcEOrpQ3lqYw4L kAP7wkThCFQs/VDte6CPxkHefGsDO9kfYH98F0q+IBoamSOXZE8Bv9fY7Pviu+hn1daz 2NIkIk554Cb9pTl9LAvsE/87pgjXAD27BiBPyfY0gv6X6UIkk12vf41z6GC/YCdpUIW0 1KtDZhnHAl1tIp5tzC9sG+VflaDzcreuoJkLUzMqzyqaKu0bGFh+HqD+Kn8+1Fiw7wxZ 8QfEchrLV9V9tVgOFAfYotRHXFgn/lCCdlBu/OqBhGnCNjT80+8G66AGwvswzam05mc9 JYpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PosxOZALKrEhJtYjRnocYQmLJH8qbE1BqkZ2znv3s3g=; b=SQWN/ymxkbd57CrDo1bMV0YUxiT12Q6fSS5BVfkV4Dg9JTi4IDVsGg+M7fNchz4uFs 5eF72iIzBfHxsxVQlqTp6FmMh+erE/cghD9eRhu8OtQSQg89Mwt4jQ/Mome8d2I2wQ/s bf8ybU4E6LrRGm23Pxt6e7r67en+QSE3nVF1NBdOH+jM2T5GZVUaFx43WyKwv7Nxu1v0 54+6hto54rnuPfwDlBmTFqWuPzi2TfN0gSA9YUGEIMQHVTZRUtZKSlOVtVYEpefRp+VZ ED2Jlylk2imTwnSI9F/PIwuFujIrNr8ShyMPY8NkVQeBSPUST+AKj38SFn68MIfJj0xm PnFw== X-Gm-Message-State: ACrzQf3g8LU+B5+IkUyc5yiAUx/2krnAFbgWzDdeClAbfbCtf3gjokFi o3do1xI6PZjnjtR8MDmGErGXgpAhc+c= X-Google-Smtp-Source: AMsMyM7aeTywl6cq97Wi4xX8Ot1IyC+sIrYF+ijlmx6VSfSHHZyC9df5yg29FYJK4370TzHKSXvbhg== X-Received: by 2002:a05:6870:d191:b0:131:a0be:b305 with SMTP id a17-20020a056870d19100b00131a0beb305mr12614998oac.169.1666379640571; Fri, 21 Oct 2022 12:14:00 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.13.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:59 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 21/26] doc: Document GCMP|CCMP-256 ciphers Date: Fri, 21 Oct 2022 14:13:02 -0500 Message-Id: <20221021191307.31492-21-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- doc/station-diagnostic-api.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/station-diagnostic-api.txt b/doc/station-diagnostic-api.txt index a974b8130c3a..f6e099b51241 100644 --- a/doc/station-diagnostic-api.txt +++ b/doc/station-diagnostic-api.txt @@ -48,6 +48,8 @@ Methods dict GetDiagnostics() - CCMP-128 - TKIP - GCMP-128 + - GCMP-256 + - CCMP-256 Possible errors: net.connman.iwd.Busy net.connman.iwd.Failed From patchwork Fri Oct 21 19:13:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015313 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9359F612D for ; Fri, 21 Oct 2022 19:14:03 +0000 (UTC) Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-1364357a691so4734842fac.7 for ; Fri, 21 Oct 2022 12:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V4qCZyjaDNColV29S3cX/gLW4CzvmVP6huDOAyIsec8=; b=SnzYYPjs2FEYfQuhdtecTIo0qjR//j+Qn3cgOkaun/68nBSJ76oS4LXGg1zpE5+uBU b5DuRy4oOk3/+Kgq/pecRcoeJLUp8DY8yebavqXo3dTSjELpHSvx+fMoD3LMAjExvqVD S9ckJHBvRyUgV9irfpgz5Ugd96NNjp3vR65sIinL7GZY5aciZiI9fHeSa9vkdKyaibgO aaR1Gs8TCKInTR8ILFreIeWopgqVAmt7DuF8jiFh8R0rqMx/RmhfVX29BOg5JNAxoP9a 8TqJQIHZ9f1CHPkYMa2WeNTTvrWxBzexdRgow120bz7RJqTz3AJ6ngABcoqXLr+nCsD5 RMtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V4qCZyjaDNColV29S3cX/gLW4CzvmVP6huDOAyIsec8=; b=FmYiPVWidDljDguJV1YciseyXBUu/gBWjcN2Pd11eArCW6LQHKGFInOAUjciFx2lD+ BE/PpIyfWhTsIQDSYJcJnDf3cErZd97KlCMVe4P23nqslKP5GBtZDDZLfwH7xSGIx7Xj 6eWhRnxd6KtgkfQbo7Xmpnpz8kJ9FpxuaRoAdoGLiJq7MvvCYVjAfCg6VtjYstl1vRx3 SEpg53eWBxfuNW9V+HeJ1esqdsItapheb+mF6Khza0n5VnPVeGpd4B5X77c1XmAgzS8j OXO/tmQuFWNFS0wShFsqQ+i+pGCMhkEmfVAj8ehzN3E3RH4hUL2YGCe5aZZRCQfsgwYy DCsg== X-Gm-Message-State: ACrzQf0Pv0RNpGtyP4QbdEWTniQrf/GLJ+V49rc6vmLnWZPfkfcet/F7 HkHD5yTOKrtNAW5AURtXCatYjX8Bi8o= X-Google-Smtp-Source: AMsMyM44N5gDCvxKf7NdEIm1HPl5+XPg+sFWvnguJlPlic3rPFSyhucKsT3HB3NRSV6EH+TR7MSNtg== X-Received: by 2002:a05:6870:738d:b0:131:f040:fb49 with SMTP id z13-20020a056870738d00b00131f040fb49mr29683297oam.253.1666379642266; Fri, 21 Oct 2022 12:14:02 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.14.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:14:01 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 22/26] auto-t: Add GCMP|CCMP-256 to WPA2 test Date: Fri, 21 Oct 2022 14:13:03 -0500 Message-Id: <20221021191307.31492-22-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- autotests/testWPA2/connection_test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/autotests/testWPA2/connection_test.py b/autotests/testWPA2/connection_test.py index 2cbdf8e1b788..a5a655f58795 100644 --- a/autotests/testWPA2/connection_test.py +++ b/autotests/testWPA2/connection_test.py @@ -54,6 +54,18 @@ class Test(unittest.TestCase): self.hostapd.wait_for_event("AP-ENABLED") self.validate_connection_success(self.wd) + def test_gcmp_256(self): + self.hostapd.set_value('rsn_pairwise', 'GCMP-256') + self.hostapd.reload() + self.hostapd.wait_for_event("AP-ENABLED") + self.validate_connection_success(self.wd) + + def test_ccmp_256(self): + self.hostapd.set_value('rsn_pairwise', 'CCMP-256') + self.hostapd.reload() + self.hostapd.wait_for_event("AP-ENABLED") + self.validate_connection_success(self.wd) + def setUp(self): self.wd = IWD(True) From patchwork Fri Oct 21 19:13:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015314 Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31A76612D for ; Fri, 21 Oct 2022 19:14:05 +0000 (UTC) Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-1364357a691so4734938fac.7 for ; Fri, 21 Oct 2022 12:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kG3b5opKNODbFYwDTToCH1ywAIZ5n+rhAvvsMbcLFRk=; b=VMutkPvMY7RYgAaIqHInp+JiKbT0IARyLfws7giEkuZx0ceFcU+5dBMSy58H+ii8Se 5pjVfjE4OSuz8rpJmLiJ2DPl6bZHCOy6BT4aYuT8YZMA5Pn3TTgiqaiwVkjA59bHFePg lanME73+Qk/9nAVHqlo+F9BbMw3+1DkFp2np1Re+bux7hj5ToiYk4zFXd+sZ2aCt8ZaB DJ0nn3BdwC5C54eKP143QVf82ROHU30AwvhQHpVGWdPAiyNxHQSBImaW0suZaiuzzrci WmDVUoFljxqWe5vBHXZ+T9SD/dbfc41SDj2eI2Seo5IXg7X/l7N5cjXSgpgiGLNihD9E 3hXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kG3b5opKNODbFYwDTToCH1ywAIZ5n+rhAvvsMbcLFRk=; b=NNgKUkpq9pbKhlccOn9MaY+aDENxIFb8DqTMs023GEj8ct4L9IlkKdFTUJjxw8RU6P Ug7SOtDo2bgERSU29sSYHvju96XXZg4wn4WtRKhkFHvJtJBQjx8pZ52YrWBaeWZHxb11 COK6GtEr95yyAlpbgoafwPsnXUPH1Tr9d21aCbMzW6W2cj37R1d0HdY82W3JXQLvG9Fi f9fTfnyYsTIEIE1pLCRfwx7oM5W+kTz4uQPJ6jkqOq7LQtzxu19pykwzjjHMVYAwncfI BZLw0Itws7NWA488PFiJFNvQals46lyCjMYt5LFGExjRSNMVBvdtD0wnNVBuBo8SL4kW u6Lg== X-Gm-Message-State: ACrzQf2QKZizlZoKp+2zE9nwRA4SQH6+uPrX+E/Mx/fzUmGzYZ8NchAJ hBTuRnv0aNpBZ4LjZs36Tn5AJRI2qas= X-Google-Smtp-Source: AMsMyM5DOIDsJGHpWH4A+LT88A/DlbKJh/KeflWLOSQclykvB9YnWKAOTMzeX4A2z70bVT4emttWZg== X-Received: by 2002:a05:6870:2487:b0:131:4fee:7c0c with SMTP id s7-20020a056870248700b001314fee7c0cmr13052178oaq.71.1666379643686; Fri, 21 Oct 2022 12:14:03 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:14:03 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 23/26] ie: Support more group management cipher suites Date: Fri, 21 Oct 2022 14:13:04 -0500 Message-Id: <20221021191307.31492-23-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/ie.c | 33 +++++++++++++++++++++++++++++++++ src/ie.h | 3 +++ 2 files changed, 36 insertions(+) diff --git a/src/ie.c b/src/ie.c index 4a3e02e11cac..6b08ce180a87 100644 --- a/src/ie.c +++ b/src/ie.c @@ -436,6 +436,12 @@ uint32_t ie_rsn_cipher_suite_to_cipher(enum ie_rsn_cipher_suite suite) return CRYPTO_CIPHER_GCMP_256; case IE_RSN_CIPHER_SUITE_CCMP_256: return CRYPTO_CIPHER_CCMP_256; + case IE_RSN_CIPHER_SUITE_BIP_GMAC: + return CRYPTO_CIPHER_BIP_GMAC; + case IE_RSN_CIPHER_SUITE_BIP_GMAC_256: + return CRYPTO_CIPHER_BIP_GMAC_256; + case IE_RSN_CIPHER_SUITE_BIP_CMAC_256: + return CRYPTO_CIPHER_BIP_CMAC_256; default: return 0; } @@ -464,6 +470,12 @@ const char *ie_rsn_cipher_suite_to_string(enum ie_rsn_cipher_suite suite) return "NO-TRAFFIC"; case IE_RSN_CIPHER_SUITE_USE_GROUP_CIPHER: break; + case IE_RSN_CIPHER_SUITE_BIP_GMAC: + return "BIP-GMAC-128"; + case IE_RSN_CIPHER_SUITE_BIP_GMAC_256: + return "BIP-GMAC-256"; + case IE_RSN_CIPHER_SUITE_BIP_CMAC_256: + return "BIP-CMAC-256"; } return NULL; @@ -510,6 +522,15 @@ static bool ie_parse_cipher_suite(const uint8_t *data, case 10: *out = IE_RSN_CIPHER_SUITE_CCMP_256; return true; + case 11: + *out = IE_RSN_CIPHER_SUITE_BIP_GMAC; + return true; + case 12: + *out = IE_RSN_CIPHER_SUITE_BIP_GMAC_256; + return true; + case 13: + *out = IE_RSN_CIPHER_SUITE_BIP_CMAC_256; + return true; default: return false; } @@ -675,6 +696,9 @@ static bool ie_parse_group_management_cipher(const uint8_t *data, switch (tmp) { case IE_RSN_CIPHER_SUITE_BIP_CMAC: case IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC: + case IE_RSN_CIPHER_SUITE_BIP_GMAC: + case IE_RSN_CIPHER_SUITE_BIP_GMAC_256: + case IE_RSN_CIPHER_SUITE_BIP_CMAC_256: break; default: return false; @@ -969,6 +993,15 @@ static bool ie_build_cipher_suite(uint8_t *data, const uint8_t *oui, case IE_RSN_CIPHER_SUITE_CCMP_256: selector = 10; goto done; + case IE_RSN_CIPHER_SUITE_BIP_GMAC: + selector = 11; + goto done; + case IE_RSN_CIPHER_SUITE_BIP_GMAC_256: + selector = 12; + goto done; + case IE_RSN_CIPHER_SUITE_BIP_CMAC_256: + selector = 13; + goto done; } return false; diff --git a/src/ie.h b/src/ie.h index e69175635908..533118541d6c 100644 --- a/src/ie.h +++ b/src/ie.h @@ -334,6 +334,9 @@ enum ie_rsn_cipher_suite { IE_RSN_CIPHER_SUITE_GCMP = 0x0080, IE_RSN_CIPHER_SUITE_GCMP_256 = 0x0100, IE_RSN_CIPHER_SUITE_CCMP_256 = 0x0200, + IE_RSN_CIPHER_SUITE_BIP_GMAC = 0x0400, + IE_RSN_CIPHER_SUITE_BIP_GMAC_256 = 0x0800, + IE_RSN_CIPHER_SUITE_BIP_CMAC_256 = 0x1000, }; enum ie_rsn_akm_suite { From patchwork Fri Oct 21 19:13:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015315 Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A294D612D for ; Fri, 21 Oct 2022 19:14:06 +0000 (UTC) Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-13b23e29e36so4011293fac.8 for ; Fri, 21 Oct 2022 12:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WO6O2qBsqi+7phB5hT93+ISZeY3elaHD4eYUVyWGL/k=; b=c6xx9KK2aR/7fpUroBd+wq1JFxK4B0J9wyD3W4Fh1YdVip2UJCD6yim7MLbZh8wC3c 8Dl9vgO7nmt8rKewy/snbRLOfXZKqkx4juj1xmC/Ry1ZtcgaQXMhSLmFcbiivWrCTT9G 7QCTyIKQe4Ffex8/uKkAa4nJQyy5ts8Z5v5j5VtT+NCgRstVKxJCsjS2JhZWQ4carbti w9XQoXc92JfS6iQr3VFd38Fb68i1hbtc0hdBZZIQ3Mfmk50hoeEuxr3GwWzMYM953mby 6ztmzrQoAnxPfq3S5PIF8wV/kpp/ppBpWSPhc6xBl2M67ujYD5zdnwSOW7sCX2QVrNrE bFAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WO6O2qBsqi+7phB5hT93+ISZeY3elaHD4eYUVyWGL/k=; b=oLk4sAyjtpC+KPIbzSWOIZrs5Cgszq5WgeeJ8ci1gPYmJLaeZL2iUIdeTBv4gdAr0n PYxV0lqr7N029HVnR3XhnhFg2GjfOgpIxhL6y4GAtKgC8gU5pjKbTddO9s0az6AosKX4 Co6OuxlsXQWnIH2Zk70bYhJfBNATQwVuV2N67PcGDHMoMvbHHxmJQo1iPsDQQpVyYLgB fqnH9ym+i4boqVs2snRBdx5+JIOZm689X9nPi2QcynhbRc7miWsU5RQj623MYLWetBmN T5+BLnCxgr3nI4sSh/ffhMNe1oEAk+n0QfKZY0V46uLb4pTdXyYXFNpsc3u04yJcf4pW 6vQw== X-Gm-Message-State: ACrzQf1CB5d5mZl754+L7REDMVwh1a9zXWreIqA2X4dYjmdfyxrsoLwO Gtvcr4Qi7t0Qr1zvgLPRy/bbBVJ58Z4= X-Google-Smtp-Source: AMsMyM5f4CIbWZN5AFBPUNYlCokvbn/bnDlHOH4KFIHUg8Bhu6iJLK6SE/4StTB5P/vQcXqURf2AhQ== X-Received: by 2002:a05:6870:58a:b0:136:3535:c7a8 with SMTP id m10-20020a056870058a00b001363535c7a8mr13260023oap.156.1666379645187; Fri, 21 Oct 2022 12:14:05 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:14:04 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 24/26] netdev: Support more IGTK cipher suites Date: Fri, 21 Oct 2022 14:13:05 -0500 Message-Id: <20221021191307.31492-24-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/netdev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/netdev.c b/src/netdev.c index 7b8948604347..636c02dea51a 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -1674,7 +1674,7 @@ static void netdev_set_igtk(struct handshake_state *hs, uint16_t key_index, { struct netdev_handshake_state *nhs = l_container_of(hs, struct netdev_handshake_state, super); - uint8_t igtk_buf[16]; + uint8_t igtk_buf[32]; struct netdev *netdev = nhs->netdev; struct l_genl_msg *msg; @@ -1690,7 +1690,10 @@ static void netdev_set_igtk(struct handshake_state *hs, uint16_t key_index, switch (cipher) { case CRYPTO_CIPHER_BIP_CMAC: - memcpy(igtk_buf, igtk, 16); + case CRYPTO_CIPHER_BIP_GMAC: + case CRYPTO_CIPHER_BIP_GMAC_256: + case CRYPTO_CIPHER_BIP_CMAC_256: + memcpy(igtk_buf, igtk, igtk_len); break; default: l_error("Unexpected cipher: %x", cipher); From patchwork Fri Oct 21 19:13:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015316 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76B676AA0 for ; Fri, 21 Oct 2022 19:14:07 +0000 (UTC) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1324e7a1284so4714090fac.10 for ; Fri, 21 Oct 2022 12:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j65mOG+qaztQKHrnBzciwpQiF/Uq0W5eKoVH0mT3nh4=; b=T8Tz0lR+HmoUubUTc/xgdukPOCAkd6vcel+CKtmQemwdlFZCf2RgBZxt5Y5+Vu5wSu XQ+Dlaqbmi6fCK9nGACd6zeTEYPmGY03Floi7AHCHr1cRIuDICd9vmZXTwhr0FvdHpjT Oo4KReqBRL7810pNBnEyjUO0D3MPts266AHfRZgiz9vc9adZCzXAjs50JPu4xPlce23F qhqP3UFTSRBfRK1aQa/kCMEk68iEQNzkZxPJhv7kh18RMvdWtlU7cI0cK9cH9bbGzRRi 9Vf1ZpOv0bQ42OGhMZL7drvU2dGvyEkqj17DJY1RUnJBDIvnrfkjVrTXAyJ9XamWccG8 K9MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j65mOG+qaztQKHrnBzciwpQiF/Uq0W5eKoVH0mT3nh4=; b=WUzxaOyswWpXogTAZws1B8yFKhbjcI8Fw2JWUaICh66VkuDRjcBVDmtZj+OOyF/jBJ IjwhH3Q7LScho+2WTqxaDFN8NN0uCU3HxvA1yLE3DHpivdiQSVNVegO47LUvJdiMTh3z PthcpnjOW57s82TB0waefX+jGdY/W5EIGJet0Bk4iKCrrWFoOaZCLlG/0WXf85EEwUdl sqiVVubfdqKGvbLxmGliVFsqJBT4hjHNFiZ1iZ1Q6w9shLzWlkZvb5Xoa2UgBWSQFAgD OCD+77YywntermXFphzrVVDXrh3UZJYt/VVUPwr2MhMQ0lWsqPjx8WUAmAdYs7ZFC/Ry p32w== X-Gm-Message-State: ACrzQf3P6RQEfpI/QXFT3NkamBqqCyiQToqfw+YyTOm6WlGvmc8Y4DUn CGAT9yO3PN4viQQqtcO+uppyVR6bSVk= X-Google-Smtp-Source: AMsMyM4i2iwNYH2qEYry3JARUgsRMXaom3GVHoLbNWerbop3xAsFIdHlRmyPWKF752/NV11/c1JtCA== X-Received: by 2002:a05:6870:c092:b0:132:a01f:7c31 with SMTP id c18-20020a056870c09200b00132a01f7c31mr13685642oad.56.1666379646748; Fri, 21 Oct 2022 12:14:06 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:14:06 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 25/26] wiphy: Support more group management cipher suites Date: Fri, 21 Oct 2022 14:13:06 -0500 Message-Id: <20221021191307.31492-25-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/wiphy.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/wiphy.c b/src/wiphy.c index 76f1ba7cfc04..bb83f814aa69 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -165,6 +165,15 @@ enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask) if (mask & IE_RSN_CIPHER_SUITE_TKIP) return IE_RSN_CIPHER_SUITE_TKIP; + if (mask & IE_RSN_CIPHER_SUITE_BIP_GMAC_256) + return IE_RSN_CIPHER_SUITE_BIP_GMAC_256; + + if (mask & IE_RSN_CIPHER_SUITE_BIP_CMAC_256) + return IE_RSN_CIPHER_SUITE_BIP_CMAC_256; + + if (mask & IE_RSN_CIPHER_SUITE_BIP_GMAC) + return IE_RSN_CIPHER_SUITE_BIP_GMAC; + if (mask & IE_RSN_CIPHER_SUITE_BIP_CMAC) return IE_RSN_CIPHER_SUITE_BIP_CMAC; @@ -1253,6 +1262,18 @@ static void parse_supported_ciphers(struct wiphy *wiphy, const void *data, wiphy->supported_ciphers |= IE_RSN_CIPHER_SUITE_CCMP_256; break; + case CRYPTO_CIPHER_BIP_GMAC: + wiphy->supported_ciphers |= + IE_RSN_CIPHER_SUITE_BIP_GMAC; + break; + case CRYPTO_CIPHER_BIP_GMAC_256: + wiphy->supported_ciphers |= + IE_RSN_CIPHER_SUITE_BIP_GMAC_256; + break; + case CRYPTO_CIPHER_BIP_CMAC_256: + wiphy->supported_ciphers |= + IE_RSN_CIPHER_SUITE_BIP_CMAC_256; + break; default: /* TODO: Support other ciphers */ break; } From patchwork Fri Oct 21 19:13:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13015317 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1D7D6AA4 for ; Fri, 21 Oct 2022 19:14:08 +0000 (UTC) Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-13af2d12469so4698011fac.13 for ; Fri, 21 Oct 2022 12:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U1FbxXAJPHzCn5v6mwheNTG8PW972DaO5UUUnm8tB1I=; b=o+Ib2vtSF77AXWRXkGyyjEZjC7/VjDcPg4v8BJycnZvH6ky8hH8N9zEp72COlf4tgj /8GcwZzv64ajLCQz1VOGKxHWkuqhO8FY4CrRr/gyO64IltItOCKNHsL6Fahs5fVbvMjZ R+CoabI8rgbOB64dGMoFXXECd+2f5S5cR4ERqiN1DLinpSc4T3gFydgp2ZMP/zsxwaU0 Ff4Nii1pdtcYz/EinoACJVT3PGMxR4pOJRQaLCHic8GDs3D+rYcV/5G1fOYMKCS0V0Jx Ib0cmVuoSXLPthwOaoa+Z7Hcznw3ZWzfBWpoLK2lozz4JGCtHlVzOpYDmkYneBcciOZ+ lA2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U1FbxXAJPHzCn5v6mwheNTG8PW972DaO5UUUnm8tB1I=; b=29ba6w6wM4l5Sv7UzNRY+TCes164CgzDKPPdgoAdFb2eWNbZgczv/nx0/SLoXc6VRn CkIrkfm3BiRGk4TmVa4NrzSO5Hn2tXf8XbAHdpzH9dzgncDKNJTNJSguaS/72l6rJ7xl 3i4jSpI7X8G1oXOPAB6ziA+5wO3fJqaNBtVlgQTqKA408bvayaq2c5wcFrlST+WX/GKe yfxaUZ2PLK8eAnDiEyJtcD6c2KtXkR+enZ105h2c/z3Jz8FlBtH+upB9EnkXhf0+jSNm HAkGhlWCjIqnMNB6wONTMcx0ncjd19O0oZ8UFn6gPmJ3YdPKkee1c4Pqlq96Aq5GsSvr oVOQ== X-Gm-Message-State: ACrzQf2OzR0Ez2anSrwtctHgYg0DkbXNPyMst9xWPLvCuQNQTA3ZQO2O A0kG1SNKpcs1wMzcntobuOewVE5717E= X-Google-Smtp-Source: AMsMyM4OS7EMThF7ko/nAZh8IY58i6obgo+qX/hz59V072ae31+pgi4ni+7/MavUO8oaHn1GaA8cUw== X-Received: by 2002:a05:6870:1795:b0:136:88c4:8c8f with SMTP id r21-20020a056870179500b0013688c48c8fmr30807705oae.191.1666379647982; Fri, 21 Oct 2022 12:14:07 -0700 (PDT) Received: from localhost.localdomain (cpe-70-114-247-242.austin.res.rr.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id e6-20020a056870d10600b0010d7242b623sm10675546oac.21.2022.10.21.12.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:14:07 -0700 (PDT) From: Denis Kenzior To: iwd@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 26/26] auto-t: Add tests for GMAC/GMAC-256/CMAC-256 Date: Fri, 21 Oct 2022 14:13:07 -0500 Message-Id: <20221021191307.31492-26-denkenz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221021191307.31492-1-denkenz@gmail.com> References: <20221021191307.31492-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- autotests/testWPA2withMFP/connection_test.py | 42 ++++++++++++++++--- autotests/testWPA2withMFP/hw.conf | 4 +- .../{ssidCCMP.conf => ssidWPA2.conf} | 2 +- 3 files changed, 40 insertions(+), 8 deletions(-) rename autotests/testWPA2withMFP/{ssidCCMP.conf => ssidWPA2.conf} (88%) diff --git a/autotests/testWPA2withMFP/connection_test.py b/autotests/testWPA2withMFP/connection_test.py index 982b69e265d7..bdc9e96ac536 100644 --- a/autotests/testWPA2withMFP/connection_test.py +++ b/autotests/testWPA2withMFP/connection_test.py @@ -8,19 +8,18 @@ import iwd from iwd import IWD from iwd import PSKAgent from iwd import NetworkType +from hostapd import HostapdCLI class Test(unittest.TestCase): - def test_connection_success(self): - wd = IWD() - + def validate_connection_success(self, wd): psk_agent = PSKAgent("secret123") wd.register_psk_agent(psk_agent) devices = wd.list_devices(1) device = devices[0] - ordered_network = device.get_ordered_network('ssidCCMP') + ordered_network = device.get_ordered_network('ssidWPA2') self.assertEqual(ordered_network.type, NetworkType.psk) @@ -39,13 +38,44 @@ class Test(unittest.TestCase): wd.unregister_psk_agent(psk_agent) + def test_cmac(self): + self.hostapd.set_value('group_mgmt_cipher', 'AES-128-CMAC') + self.hostapd.reload() + self.hostapd.wait_for_event("AP-ENABLED") + self.validate_connection_success(self.wd) + + def test_gmac(self): + self.hostapd.set_value('group_mgmt_cipher', 'BIP-128-GMAC') + self.hostapd.reload() + self.hostapd.wait_for_event("AP-ENABLED") + self.validate_connection_success(self.wd) + + def test_gmac_256(self): + self.hostapd.set_value('group_mgmt_cipher', 'BIP-256-GMAC') + self.hostapd.reload() + self.hostapd.wait_for_event("AP-ENABLED") + self.validate_connection_success(self.wd) + + def test_cmac_256(self): + self.hostapd.set_value('group_mgmt_cipher', 'BIP-256-CMAC') + self.hostapd.reload() + self.hostapd.wait_for_event("AP-ENABLED") + self.validate_connection_success(self.wd) + + def setUp(self): + self.wd = IWD(True) + + def tearDown(self): + self.wd.clear_storage() + self.wd = None + @classmethod def setUpClass(cls): - pass + cls.hostapd = HostapdCLI(config='ssidWPA2.conf') @classmethod def tearDownClass(cls): - IWD.clear_storage() + pass if __name__ == '__main__': unittest.main(exit=True) diff --git a/autotests/testWPA2withMFP/hw.conf b/autotests/testWPA2withMFP/hw.conf index fad15b8823a3..edfe03f97e25 100644 --- a/autotests/testWPA2withMFP/hw.conf +++ b/autotests/testWPA2withMFP/hw.conf @@ -1,5 +1,7 @@ [SETUP] num_radios=2 +start_iwd=0 [HOSTAPD] -rad0=ssidCCMP.conf +rad0=ssidWPA2.conf + diff --git a/autotests/testWPA2withMFP/ssidCCMP.conf b/autotests/testWPA2withMFP/ssidWPA2.conf similarity index 88% rename from autotests/testWPA2withMFP/ssidCCMP.conf rename to autotests/testWPA2withMFP/ssidWPA2.conf index c79f5e558021..908915d7cb02 100644 --- a/autotests/testWPA2withMFP/ssidCCMP.conf +++ b/autotests/testWPA2withMFP/ssidWPA2.conf @@ -1,6 +1,6 @@ hw_mode=g channel=1 -ssid=ssidCCMP +ssid=ssidWPA2 wpa=2 wpa_pairwise=CCMP