From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796291432; b=N+9zbP1aWoKGFefIwQee3HU0yEvu1wc+FKa7eCRQxmZMvi4U1CJxSVwlN+/xxPZC1/jC 5tM4qj+Yjbwr3TLya31a8PjCNiNj4fk7A7k+AldaX2KgT4qUxx/6j/dQJ3A6UX04NBiHQ SupyTUIcaXYdPHSuNO5Sn6YVtQHYgyczOWYAixRurW6rREDG+KFLNg5WaeeVYUsGON21M ZmCoTWT93TxX9tW3viNPNOv3T3pt11OCNEYyDPNFLOf2dQCSb+/nNl7onlhGg9oeXpW8A ZoODeGp1jIajSpzaEG+Jmi1yWm87B6Jv+5KOJ1hsYrpXjSsVgnX910qDdPL1+8ba+Jw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796291432; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=DfJuKUncOnbyENi5rizfc9aJjYn7+qvoIEx4G6ZInoY=; b=ZVTL3CXxf31yjAqyGu505yY1T6866iF/aIJXPOhPIDh+6IHrxtyJffohj9hKXCI9azKj uVRm7hBbi5WRBO8la39zft5GFPU/Akr2gOrYj79Uf4akCM1DYAKdSVcFCMIMnn8y/8Ulo Ugqg9omasiOvN/DPyTw0OKFyWqpy1aQyvBvbkUAoDUE5IAVHvTwV4M5XvSSmFnbz1D1E8 ANoqFemsKpYpb7Qy9SUZzIqgQzwLcv7f72v+nMivK0HQ2N3PVWrNmH3tcdL0vMWPaBgjv 4LDBXFcyk4vQlPHyqZnsI7NRubGKT52l/Skgf4jqjOd3xyyQNwOmIFNWQD4EHzTxsxQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fS+lsxpr; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B05B6606A33C for ; Thu, 3 Dec 2026 09:50:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fS+lsxpr Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F4171F000C1; Thu, 3 Dec 2026 09:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796291432; bh=DfJuKUncOnbyENi5rizfc9aJjYn7+qvoIEx4G6ZInoY=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=fS+lsxprUqV6qJWSxaNwmjn+bV99iskk4B52iVdCcAL3ygzxE+jd/RVi/xFRNmMOJ nhYk6+t7eRrHGe5Dnv5hWMsrws29E0aa03AeUnbTrucqc9l2iVB2REQZkGMDT9PMcp CMmERJWA6tnTOD3TaNxF8TJSHqXADNlElTYn7ejbE9ftZIwampsYdGXZQyROMOHDLo FDkLOg7Q/a5WJexzJzfovdYrZabzNDEto2N/U0p7BFJlGqSeDQp+pGAdGdbPZAKVST vV3aSX2NwFegw7O2IA8lZHeh2wN0T/W4XBCiFvQx81zHR0NFalBCrJBithr/GG4Rob Sp/Gwyb+RI7og== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 2/4] crypto: fips - Add back the lost key length check to the hmac(sha1) algorithm Reply-To: sashiko-reviews@lists.linux.dev To: "Thomas Huth" , "Herbert Xu" , linux-crypto@vger.kernel.org Cc: "David S. Miller" , "Eric Biggers" In-Reply-To: <20261203093316.97847-3-thuth@redhat.com> References: <20261203093316.97847-1-thuth@redhat.com> <20261203093316.97847-3-thuth@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 09:50:31 +0000 X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] crypto: per-driver FIPS check in crypto_hmac_sha1_setkey() skips HW drivers -- commit d6b7b3a077cba610436db798132876d0dbc2035d Author: Thomas Huth crypto: fips - Add back the lost key length check to the hmac(sha1) algorit= hm This commit adds a FIPS minimum key length check to crypto_hmac_sha1_setkey() so hmac-sha1-lib rejects keys shorter than 112 bits in FIPS mode. > diff --git a/crypto/sha1.c b/crypto/sha1.c > index 4fbf61cf03709..83eb405f011f0 100644 > --- a/crypto/sha1.c > +++ b/crypto/sha1.c [ ... ] > @@ -122,6 +123,9 @@ static int crypto_sha1_import_core(struct shash_desc = *desc, const void *in) > static int crypto_hmac_sha1_setkey(struct crypto_shash *tfm, > const u8 *raw_key, unsigned int keylen) > { > + if (fips_hmac_keylen_disallowed(keylen)) > + return -EINVAL; > + > hmac_sha1_preparekey(HMAC_SHA1_KEY(tfm), raw_key, keylen); > return 0; > } [Severity: Medium] Does enforcing fips_hmac_keylen_disallowed() only in crypto_hmac_sha1_setkey() break hardware hmac(sha1) drivers under CONFIG_CRYPTO_SELFTESTS_FULL with fips=3D1? In FIPS mode, generate_random_hash_testvec() fuzzes keys of 1..80 bytes against hmac-sha1-lib, which now returns -EINVAL for keys under 14 bytes. Hardware drivers without CRYPTO_ALG_NEED_FALLBACK (e.g., caamhash.c) accept those keys, causing test_ahash_vec_cfg() to fail and alg_test() to panic. Higher-priority hardware hmac(sha1) drivers also continue to accept short keys at runtime in FIPS mode. Enforcing fips_hmac_keylen_disallowed() centrally in crypto_shash_setkey() and crypto_ahash_setkey() for hmac(...) algorithms would cover software, library, and hardware drivers uniformly. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203093316.9784= 7-1-thuth@redhat.com?part=3D2