linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] crypto: shash – crypto_shash_export_core() fails with -ENOSYS after libcrypto updates merge
@ 2025-08-31 19:48 Giovanni Cabiddu
  2025-08-31 20:54 ` Eric Biggers
  2025-09-01  6:20 ` Ovidiu Panait
  0 siblings, 2 replies; 4+ messages in thread
From: Giovanni Cabiddu @ 2025-08-31 19:48 UTC (permalink / raw)
  To: herbert, ebiggers; +Cc: linux-crypto, qat-linux

After commit 13150742b09e ("Merge tag 'libcrypto-updates-for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux"),
crypto_shash_export_core() fails with -ENOSYS for all SHA algorithms
registered via shash.

The failure originates from shash_default_export_core(), which is now
being used as the default export function. However, this function is not
implemented, resulting in -ENOSYS.

Before the merge, SHA shash implementations were setting the
CRYPTO_AHASH_ALG_BLOCK_ONLY flag. This caused alg->export_core to be
assigned to alg->export, enabling proper state export. It seems the
removal of CRYPTO_AHASH_ALG_BLOCK_ONLY from the SHA implementations was
intentional, is this correct?

This issue breaks all aead implementations in the QAT driver, which
since commit ccafe2821cfa ("crypto: qat – Use crypto_shash_export_core")
rely on crypto_shash_export_core() to retrieve the initial state for
HMAC (i.e., H(K' xor opad) and H(K' xor ipad)).

It’s likely that the Chelsio driver is also affected, as it uses the
same API.

What is the recommended way to move forward?  Should the SHA
implementations reintroduce CRYPTO_AHASH_ALG_BLOCK_ONLY?  Should
shash_default_export_core() be properly implemented?  Should drivers
like QAT switch to using the software library directly to export the SHA
state?  Or is there another preferred approach?

Thanks,

-- 
Giovanni

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

end of thread, other threads:[~2025-09-01 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-31 19:48 [BUG] crypto: shash – crypto_shash_export_core() fails with -ENOSYS after libcrypto updates merge Giovanni Cabiddu
2025-08-31 20:54 ` Eric Biggers
2025-09-01  6:20 ` Ovidiu Panait
2025-09-01 17:11   ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).