Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1202512rdg; Fri, 13 Oct 2023 13:29:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMsr+Xt0qsujLQrDtJMNvuhk5+7M9FpR518yG9G1hw5rkv95Z3MF5wfQsqg4nBc4WUco9c X-Received: by 2002:a17:902:8544:b0:1b9:e972:134d with SMTP id d4-20020a170902854400b001b9e972134dmr20918059plo.3.1697228957944; Fri, 13 Oct 2023 13:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697228957; cv=none; d=google.com; s=arc-20160816; b=CGg+eSgdvJjjnbqnUdkSThpDG6tTbUK6hygNRqCTPOkzNTAwfizxGBEZbFPSwHE0nq 02ziqwVOfyKLa7Dh/QZibGW/CmHqduHDXCPvBJdQJ3hurdiIqkyFUfbOTvfVHhW6lmBF jnxfU6AJQQhNy9Am640BKtjwmz/5K8ZXz4iUlf76sm9LD9wY/HW4azDvt7/usphXKX7N 6+nxXBSn5pUT6ZrL9/rb6rBvZslKh3/kY18odp5ZRcDGxcmPmcVmTS91FXf19akg2QLv +alV03FK8DfeMfjKdBOec9HP8jVaa177w/6+NRs6B7qmOBNFf3qtpHX05oH/Tg74ea4M fe6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6cVklUBJ2GX15heOtwqXFzln+u/hJujOwwMqeS1EpW0=; fh=nK/B2gIzvYPsKU0sJgdKEVdz5eoE00hHt727sEimwsQ=; b=Vrit0vBPDx0rVjLbHDzMu4mbtkE4fGlUn0NMyYYiU2hkGD2o78+jKvb8WVyw8nELjb wi2IMybCHavXY+MzER5QKrJufhphyDIx2m38J4faqKjDGyDGL6lIAztnBT0hgfNNS5xU PvV7MdufX2J5paT/LDFs8ERDFkWtek/3XYpuNpoSP0k3CXy6KnY1+YvY8Btjq1nHDVR3 qBVJnV28La7MZsDhfmhxIhNOV8jf6FouiVCVCwITh23e6PAJukSdLy/BVbrQAjoqoUTX G4ncfXFr+NX1KZOgcX7MKeQK7cCbk9/vKVsW3ut0koNtgdyaxX6T9xeF/W25zU9aPoxM JuEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=ITA6Oled; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id d2-20020a170903230200b001c62bbdde51si5665259plh.479.2023.10.13.13.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 13:29:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=ITA6Oled; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9D8C782D9823; Fri, 13 Oct 2023 13:29:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232140AbjJMU3H (ORCPT + 99 others); Fri, 13 Oct 2023 16:29:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232005AbjJMU3G (ORCPT ); Fri, 13 Oct 2023 16:29:06 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CAC7BB for ; Fri, 13 Oct 2023 13:29:01 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 56BA6240029 for ; Fri, 13 Oct 2023 22:28:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1697228939; bh=FLYT+SprL3ZRgczhwxNKHQ8OrNt4PO3mwxSQn6FYQbQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=ITA6OledQbDyCnMqLfsAA0aT9iS6L1DU5tl5QEJHCFGUB5MTaE/9YBYioEfHWDtqY wzbdGHvjrX1lMo3S+iViQ3FltaKZFrNE52gizqA0mLdRgl7WHHVeF3kKEBCVzfCC7G Q8jtsmEiI2VrnD/bLiHqMaaXkhEKf/qN5xNMRR6/1iJbIpyjyxsDPaARsOLzp9nHBD RQTo6Pbgd8c9znabXOUEdtk45O99uRpZJNRgCY71zU1EZD+ntj/dm9lbVtSH6hLLcg sxJdDLZwRf7nMK/lLwcqtitkwAv1XJsBoG78vw5V3bBzbOzn4hu71Wr/N9eBtgWmL6 aqC8BvhDXfKzQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S6dPz2MPJz9rxF; Fri, 13 Oct 2023 22:28:55 +0200 (CEST) From: Mark O'Donovan To: linux-kernel@vger.kernel.org Cc: linux-nvme@lists.infradead.org, sagi@grimberg.me, hch@lst.de, axboe@kernel.dk, kbusch@kernel.org, hare@suse.de, Mark O'Donovan Subject: [PATCH 0/2] Remove secret-size restrictions for hashes Date: Fri, 13 Oct 2023 20:28:25 +0000 Message-Id: <20231013202827.2262708-1-shiftee@posteo.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 13:29:15 -0700 (PDT) This relates to the hash functions used to transform the secret. The kernel currently restricts us to using secrets equal in size to the transformation hash function they use. e.g. 32 byte secrets with the SHA-256(32 byte) hash function. This restriction is not required by the spec and means incompatibility with more permissive implementations. With these patches the example secret from the spec should now be permitted with any of the following: DHHC-1:00:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n: DHHC-1:01:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n: DHHC-1:02:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n: DHHC-1:03:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n: Note: Secrets are still restricted to 32,48 or 64 bits. Mark O'Donovan (2): nvme-auth: use transformed key size to create resp nvme-auth: allow mixing of secret and hash lengths drivers/nvme/common/auth.c | 8 -------- drivers/nvme/host/auth.c | 11 ++++++++++- 2 files changed, 10 insertions(+), 9 deletions(-) -- 2.39.2