Skip to content

ksmbd: More crypto library conversions

Eric Biggers linux-cifs linux-crypto lkml 1 version Applied

Status from this message: Applied them to #ksmbd-for-next-next.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3ksmbd: Use SHA-512 library for SMB3.1.1 preauth hashfs/smb/server/Kconfig fs/smb/server/auth.c fs/smb/server/crypto_ctx.c +2 more+8 -480 replies
2/3ksmbd: Use HMAC-SHA256 library for message signing and key generationfs/smb/server/Kconfig fs/smb/server/auth.c fs/smb/server/auth.h +5 more+52 -1772 replies
3/3ksmbd: Use HMAC-MD5 library for NTLMv2fs/smb/server/Kconfig fs/smb/server/auth.c fs/smb/server/crypto_ctx.c +2 more+27 -1650 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] ksmbd: More crypto library conversions

This series converts fs/smb/server/ to access SHA-512, HMAC-SHA256, and HMAC-MD5 using the library APIs instead of crypto_shash.

This simplifies the code significantly. It also slightly improves performance, as it eliminates unnecessary overhead. I haven't done server-specific benchmarks, but you can get an idea of what to expect by looking at the numbers I gave for the similar client-side series:
https://lore.kernel.org/linux-cifs/20251014034230.GC2763@sol/

No change in behavior intended. All the crypto computations should be the same as before. I haven't tested this series (I did test the similar client-side series), but everything should still work.

Eric Biggers (3):
ksmbd: Use SHA-512 library for SMB3.1.1 preauth hash
ksmbd: Use HMAC-SHA256 library for message signing and key generation
ksmbd: Use HMAC-MD5 library for NTLMv2

 fs/smb/server/Kconfig      |   6 +-
 fs/smb/server/auth.c       | 390 +++++++------------------------------
 fs/smb/server/auth.h       |  10 +-
 fs/smb/server/crypto_ctx.c |  24 ---
 fs/smb/server/crypto_ctx.h |  15 +-
 fs/smb/server/server.c     |   4 -
 fs/smb/server/smb2pdu.c    |  26 +--
 fs/smb/server/smb_common.h |   2 +-
 8 files changed, 87 insertions(+), 390 deletions(-)

base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787

Signature · 1 line
2.51.0