Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH 0/4] crypto: Add back the lost FIPS key length checks to the  hmac(sha*) algorithms
@ 2026-12-01 18:47 Thomas Huth
  2026-12-01 18:47 ` [PATCH 1/4] crypto: Add a wrapper function for checking the HMAC key length in FIPS mode Thomas Huth
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Thomas Huth @ 2026-12-01 18:47 UTC (permalink / raw)
  To: Herbert Xu, linux-crypto; +Cc: David S. Miller, Eric Biggers, linux-kernel

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
libcrypto. Thus add the key length check to the crypto/sha*.c files, too,
to be compliant again with the FIPS requirements.

(I've fixed each file in a separate patch to ease backporting if required)

Thomas Huth (4):
  crypto: Add a wrapper function for checking the HMAC key length in
    FIPS mode
  crypto: Add back the lost FIPS key length check to the hmac(sha1)
    algorithm
  crypto: Add back the lost FIPS key length check to the hmac(sha256)
    algorithm
  crypto: Add back the lost FIPS key length check to the hmac(sha512)
    algorithm

 crypto/hmac.c        | 2 +-
 crypto/sha1.c        | 4 ++++
 crypto/sha256.c      | 7 +++++++
 crypto/sha512.c      | 7 +++++++
 include/linux/fips.h | 9 +++++++++
 5 files changed, 28 insertions(+), 1 deletion(-)

-- 
2.56.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-12-01 20:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 18:47 [PATCH 0/4] crypto: Add back the lost FIPS key length checks to the hmac(sha*) algorithms Thomas Huth
2026-12-01 18:47 ` [PATCH 1/4] crypto: Add a wrapper function for checking the HMAC key length in FIPS mode Thomas Huth
2026-12-01 18:52   ` sashiko-bot
2026-12-01 19:07     ` Thomas Huth
2026-12-01 18:47 ` [PATCH 2/4] crypto: Add back the lost FIPS key length check to the hmac(sha1) algorithm Thomas Huth
2026-12-01 18:47 ` [PATCH 3/4] crypto: Add back the lost FIPS key length check to the hmac(sha256) algorithm Thomas Huth
2026-12-01 18:47 ` [PATCH 4/4] crypto: Add back the lost FIPS key length check to the hmac(sha512) algorithm Thomas Huth
2026-12-01 20:21 ` [PATCH 0/4] crypto: Add back the lost FIPS key length checks to the hmac(sha*) algorithms Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox