From patchwork Thu Aug 18 09:44:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Werner X-Patchwork-Id: 1667624 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=oEhMQWwy; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=G//79w3S; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M7g9F6kJFz1ygH for ; Thu, 18 Aug 2022 19:50:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=T4NzYIRJVRncdDkWvxAHisVy2PPgybIaLG6GQZL7uqw=; b=oEhMQWwyDQpnSG Vob5dueYUF3VnNFc9x+PnRwWHGExFvo1hq9Fhqlr+r/JgkZzZW+hs0wDxDFPDYEBHzeWP0H4qdkre XszROE96QHsLgfyv5MfFmQvDauuD6PHNjKyYLe0N/A3soj4pz2r6CJWWZjCRn6+mc+XLTdK7V43pj seRcRoyIMbJx6kCYDLWiSuBJsQ6TrPJIYC0yT0McbuMKAI20FsERbzUrNMLx/DVPwkqvMHUcY3Alk 92dEP2T1rb5zYJj/aisx4aG30qVeH2cRcNNq/h/sMMHBdus5jfEdsaOBMikwxXxD0fDvyHsoPd05v hIsszzbKdDRZnAk/aesg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOc56-001pUx-Tz; Thu, 18 Aug 2022 09:44:53 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOc53-001pPv-MR for openwrt-devel@lists.openwrt.org; Thu, 18 Aug 2022 09:44:51 +0000 Received: by mail-ed1-x534.google.com with SMTP id t5so1163012edc.11 for ; Thu, 18 Aug 2022 02:44:46 -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; bh=1vxAo35znBrPT/EBe+5EAUL4TbZbtFrtbcbpY7JoEW4=; b=G//79w3SfIoknINiRf1k9ZOZ5kBKCj5EtP8NnU3QACk7olTE+4c9FVu956Cv9tD3jJ DlCANFT46nky0gtoGb6qhtHXiGyCMC0mogjp2fVKvsMMfBEuyUYXapRup3DaRauqiVe9 WJIE5enSzH1aaJnrpmyr6PSibBLPtdUh/ep6MSDulsC6WCQs3CB66FyxQhe/AnZdJrNt Ii6j51FV4+c/oBOjeVowZy6ZwyKD3eyOohV4bM6QoUh8NGy68rARnI3IpwTdeZVYpAl7 oxKHok0hPAaML/oKKmcCh7904W8Uh6CIhOWF6e16B0hPvlhNZYYilCjupEymu0I5r6RC LoOw== 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; bh=1vxAo35znBrPT/EBe+5EAUL4TbZbtFrtbcbpY7JoEW4=; b=cqGPcJBj3BZyntAmhbpTBdE2UM6zFUIoVHJbDvxcrqQKTHlzzL8RR+jgcguIeXdmkZ OKnfUauLb3VtDm+DSvRr3jyWcR7zioDCtBTc35qMPbugCXJtQmhQEv8VVceXxFoF2Ul0 iI+clVF/lClbCA82N1CDeg+orltst/pNxkyFOVdc0M7P74fD2PQKIy2w0BfIWNlHIvzK N6+fu142aHwsq4P/3FXJvXO1Hsw1WIUt254HIEgjvxHarAM7A8fPYP3SstW/yPOaqb51 OtLp6Vxaof0dJKmcpPh9NjlMMPXDPsqFrZzvu/4iRmb6S8ddf4zBqr+Nd+NbaX52DLZK yZ/Q== X-Gm-Message-State: ACgBeo1WOZhe7VFqKX5tQ0Td2JH0MONSEsyaMen/YAqV6PG8c9D16c3E 6xtKacBtXeGybdlBTd0q+uSjqUNMq6M= X-Google-Smtp-Source: AA6agR7DvHL/58lHUQsSK26+/lD7MLu6ZCwgf4UWdZrEq0F+oVGn8Dc03VxA9FwEMfRwnRFjTFPPIQ== X-Received: by 2002:a05:6402:288c:b0:446:1f9c:aa24 with SMTP id eg12-20020a056402288c00b004461f9caa24mr362797edb.256.1660815885382; Thu, 18 Aug 2022 02:44:45 -0700 (PDT) Received: from bodensee.schreibubi.home.arpa ([2a02:810d:4d40:3e00::da:6666]) by smtp.gmail.com with ESMTPSA id v6-20020a056402174600b0043cab10f702sm820927edx.90.2022.08.18.02.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 02:44:44 -0700 (PDT) From: Joerg Werner To: openwrt-devel@lists.openwrt.org, jo@mein.io Cc: Joerg Werner Subject: [PATCH] Add support for CCMP-256 and GCMP-256 ciphers Date: Thu, 18 Aug 2022 11:44:35 +0200 Message-Id: <20220818094435.189176-1-schreibubi@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220818_024449_755392_2244121A X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Signed-off-by: Joerg Werner --- include/iwinfo.h | 22 ++++++++++++ iwinfo_cli.c | 6 ++++++ iwinfo_lua.c | 6 ++++++ iwinfo_nl80211.c | 14 ++++++++------ iwinfo_utils.c | 10 ++++++++-- 5 fil [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:534 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [schreibubi[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Signed-off-by: Joerg Werner --- include/iwinfo.h | 22 ++++++++++++---------- iwinfo_cli.c | 6 ++++++ iwinfo_lua.c | 6 ++++++ iwinfo_nl80211.c | 14 ++++++++------ iwinfo_utils.c | 10 ++++++++-- 5 files changed, 40 insertions(+), 18 deletions(-) diff --git a/include/iwinfo.h b/include/iwinfo.h index e9b7451..576632d 100644 --- a/include/iwinfo.h +++ b/include/iwinfo.h @@ -36,16 +36,18 @@ #define IWINFO_BAND_6 (1 << 2) #define IWINFO_BAND_60 (1 << 3) -#define IWINFO_CIPHER_NONE (1 << 0) -#define IWINFO_CIPHER_WEP40 (1 << 1) -#define IWINFO_CIPHER_TKIP (1 << 2) -#define IWINFO_CIPHER_WRAP (1 << 3) -#define IWINFO_CIPHER_CCMP (1 << 4) -#define IWINFO_CIPHER_WEP104 (1 << 5) -#define IWINFO_CIPHER_AESOCB (1 << 6) -#define IWINFO_CIPHER_CKIP (1 << 7) -#define IWINFO_CIPHER_GCMP (1 << 8) -#define IWINFO_CIPHER_COUNT 9 +#define IWINFO_CIPHER_NONE (1 << 0) +#define IWINFO_CIPHER_WEP40 (1 << 1) +#define IWINFO_CIPHER_TKIP (1 << 2) +#define IWINFO_CIPHER_WRAP (1 << 3) +#define IWINFO_CIPHER_CCMP (1 << 4) +#define IWINFO_CIPHER_WEP104 (1 << 5) +#define IWINFO_CIPHER_AESOCB (1 << 6) +#define IWINFO_CIPHER_CKIP (1 << 7) +#define IWINFO_CIPHER_GCMP (1 << 8) +#define IWINFO_CIPHER_CCMP256 (1 << 9) +#define IWINFO_CIPHER_GCMP256 (1 << 10) +#define IWINFO_CIPHER_COUNT 11 #define IWINFO_KMGMT_NONE (1 << 0) #define IWINFO_KMGMT_8021x (1 << 1) diff --git a/iwinfo_cli.c b/iwinfo_cli.c index 456c67a..dca86cf 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -158,9 +158,15 @@ static char * format_enc_ciphers(int ciphers) if (ciphers & IWINFO_CIPHER_CCMP) pos += sprintf(pos, "CCMP, "); + if (ciphers & IWINFO_CIPHER_CCMP256) + pos += sprintf(pos, "CCMP-256, "); + if (ciphers & IWINFO_CIPHER_GCMP) pos += sprintf(pos, "GCMP, "); + if (ciphers & IWINFO_CIPHER_GCMP256) + pos += sprintf(pos, "GCMP-256, "); + if (ciphers & IWINFO_CIPHER_WRAP) pos += sprintf(pos, "WRAP, "); diff --git a/iwinfo_lua.c b/iwinfo_lua.c index e49e454..a2fe9d1 100644 --- a/iwinfo_lua.c +++ b/iwinfo_lua.c @@ -61,9 +61,15 @@ static char * iwinfo_crypto_print_ciphers(int ciphers) if (ciphers & IWINFO_CIPHER_CCMP) pos += sprintf(pos, "CCMP, "); + if (ciphers & IWINFO_CIPHER_CCMP256) + pos += sprintf(pos, "CCMP-256, "); + if (ciphers & IWINFO_CIPHER_GCMP) pos += sprintf(pos, "GCMP, "); + if (ciphers & IWINFO_CIPHER_GCMP256) + pos += sprintf(pos, "GCMP-256, "); + if (ciphers & IWINFO_CIPHER_WRAP) pos += sprintf(pos, "WRAP, "); diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index adb8c45..30da680 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -1708,12 +1708,14 @@ static struct { const char *match; int cipher; } wpa_cipher_strings[] = { - { "WEP-104", IWINFO_CIPHER_WEP104 }, - { "WEP-40", IWINFO_CIPHER_WEP40 }, - { "NONE", IWINFO_CIPHER_NONE }, - { "TKIP", IWINFO_CIPHER_TKIP }, - { "CCMP", IWINFO_CIPHER_CCMP }, - { "GCMP", IWINFO_CIPHER_GCMP } + { "WEP-104", IWINFO_CIPHER_WEP104 }, + { "WEP-40", IWINFO_CIPHER_WEP40 }, + { "NONE", IWINFO_CIPHER_NONE }, + { "TKIP", IWINFO_CIPHER_TKIP }, + { "CCMP-256",IWINFO_CIPHER_CCMP256 }, + { "CCMP", IWINFO_CIPHER_CCMP }, + { "GCMP-256",IWINFO_CIPHER_GCMP256 }, + { "GCMP", IWINFO_CIPHER_GCMP } }; static void parse_wpa_ciphers(const char *str, uint16_t *ciphers) diff --git a/iwinfo_utils.c b/iwinfo_utils.c index d071997..f5eb398 100644 --- a/iwinfo_utils.c +++ b/iwinfo_utils.c @@ -316,10 +316,16 @@ static void iwinfo_parse_rsn_cipher(uint8_t idx, uint16_t *ciphers) *ciphers |= IWINFO_CIPHER_GCMP; break; + case 9: + *ciphers |= IWINFO_CIPHER_GCMP256; + break; + + case 10: + *ciphers |= IWINFO_CIPHER_CCMP256; + break; + case 6: /* AES-128-CMAC */ case 7: /* No group addressed */ - case 9: /* GCMP-256 */ - case 10: /* CCMP-256 */ case 11: /* BIP-GMAC-128 */ case 12: /* BIP-GMAC-256 */ case 13: /* BIP-CMAC-256 */