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=1796329525; b=iC2p/GKTCm/hpU/o4DJCf3W5zSreVFRQZPUtHy6H5+5cdw4/yd03W++8RBclT6e5ZFUk lADPVVBJab8Fyfu/OP610zH0i0+ACoMdEYgvDvCgLfxXX53X04jMe8Rszh701/EEVGrkH B8ZIGVCmsX6x9EWSjt+obJZ9rV3OnpVe68yJlFpJ5LT9yF33PTXT9npFRwwuD7mUjtZcG XkFPFsZEWM2GbNVPHy3zN7xrEHYMaeojgKVNUa7C2Xg9P8Z5v3zORXlAB/vVRAcA7F9bE bKjeH/9MDAewq55yjh1o4knXz4w6mCPp4570Iuge1Vhz8KPcIKAGKM/OVWO7axY87ZA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796329525; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=4DtDBFdimBG+oObUfOubKgC6apfkZBJFzmw/56HwWIo=; b=lLc7KcEsip0URaG+wo+l4l4eAr7/g6ViWv5H/MMl+aveBLg6F/ZXGXDyl3ZY3CdDplVt NL1r5ofJPIRRjr0qXkYkCB1igD8Nk4x3c54PYOewtB+47Hj0bBLeFbDxtzTFvV/cBIFZo G/TiSb3hDJEASxlqIlqe/Aw4VpqirHxh2uM/9yjv+uaSeqvVzFC0vuuC5J3rQ+IR51USE /mssYjhpAordxg+E2fJX5ozT7vEntdvSq+lTcQfqgUBC/6GLmGGnMtN6k/HP4lO+iNrpH LAh9usdhn/bjJMkdPFNw/Q13+SfrkcO4gdM/t+JxmkKpnx2WYYEgrnlBnYnp9HC1aig== 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=FKoQe0Ux; 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 5D7F6606A322; Thu, 3 Dec 2026 20:25:25 +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=FKoQe0Ux Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDCD81F000CE; Thu, 3 Dec 2026 20:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796329525; bh=4DtDBFdimBG+oObUfOubKgC6apfkZBJFzmw/56HwWIo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=FKoQe0UxAPDE7q3iA7MnuYqz3uxB5trS8CU0jmjHtXh4Xcbcxz/JziCtTvMVJMiRA +JbJrSJim0msz2QdzurRuNg/k4EXom9CGqN5mmUNkKVCqKn1QqaO3T6g8tNzl/5n9J tFVw7MwPAIuxA8o1TH5jA7nue0aUExjll8f1YmoLZsfpEfDexsFGQZikpPGrrN/6mK QAktihXH0iOGfO+Wy2r0ydveqo6VfsqsJR3xbUlxXyQC0FLViULZY+e8yAAj7IdIiK kJG++Npf+SD12j9szAIVRdHGYx7/LAcd2n1PEZBsTiqOn7tf2rCBWM0eFHiFKVMhlG JYYLrng9m8SWw== Date: Thu, 3 Dec 2026 12:25:23 -0800 From: Eric Biggers To: Thomas Huth Cc: Herbert Xu , linux-crypto@vger.kernel.org, "David S. Miller" , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 0/4] crypto: fips - Add back the lost key length checks to the hmac(sha*) algorithms Message-ID: <20261203202523.GE2267@sol> References: <20261203093316.97847-1-thuth@redhat.com> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203093316.97847-1-thuth@redhat.com> On Thu, Dec 03, 2026 at 10:33:12AM +0100, Thomas Huth wrote: > The generic code in hmac_setkey() in crypto/hmac.c correctly rejects > keys with less than 112 bits in FIPS-compliance mode. However, this > check got lost when the hmac(sha*) algorithms were implemented via > the crypto library. > > We noticed this behavioral change after backporting the corresponding > commits to an older kernel branch: One of our downstream tests checks > whether setting key length with less than 112 bits works in fips_enabled > mode, and this test started failing. Thus let's restore the same behavior > from kernel v6.16 and earlier by adding the key length check to the > crypto/sha*.c files, too. > > Note: Please don't backport these patches to any kernel before 6.19, see: > https://lore.kernel.org/linux-crypto/20261201202148.GA501764@google.com/ > > v2: > - Moved the helper in the first patch out of the #ifdef and removed > superfluous macro > - Reworked patch descriptions and added notes to not backport this > to the 6.18 stable trees > > Thomas Huth (4): > crypto: fips - Add a wrapper function for checking the HMAC key length > crypto: fips - Add back the lost key length check to the hmac(sha1) > algorithm > crypto: fips - Add back the lost key length check to the hmac(sha256) > algorithm > crypto: fips - Add back the lost key length check to the hmac(sha512) > algorithm Acked-by: Eric Biggers - Eric