The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Thomas Huth <thuth@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	linux-crypto@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	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
Date: Thu, 3 Dec 2026 12:25:23 -0800	[thread overview]
Message-ID: <20261203202523.GE2267@sol> (raw)
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 <ebiggers@kernel.org>

- Eric

      parent reply	other threads:[~2026-12-03 20:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  9:33 [PATCH v2 0/4] crypto: fips - Add back the lost key length checks to the hmac(sha*) algorithms Thomas Huth
2026-12-03  9:33 ` [PATCH v2 1/4] crypto: fips - Add a wrapper function for checking the HMAC key length Thomas Huth
2026-12-03  9:33 ` [PATCH v2 2/4] crypto: fips - Add back the lost key length check to the hmac(sha1) algorithm Thomas Huth
2026-12-03  9:33 ` [PATCH v2 3/4] crypto: fips - Add back the lost key length check to the hmac(sha256) algorithm Thomas Huth
2026-12-03  9:33 ` [PATCH v2 4/4] crypto: fips - Add back the lost key length check to the hmac(sha512) algorithm Thomas Huth
2026-12-03 20:25 ` Eric Biggers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203202523.GE2267@sol \
    --to=ebiggers@kernel.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox