Skip to content

smb: client: More crypto library conversions

Eric Biggers linux-cifs linux-crypto lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8smb: client: Use SHA-512 library for SMB3.1.1 preauth hashfs/smb/client/Kconfig fs/smb/client/smb2misc.c fs/smb/client/smb2proto.h+16 -440 replies
2/8smb: client: Use HMAC-SHA256 library for key generationfs/smb/client/Kconfig fs/smb/client/smb2transport.c+15 -540 replies
3/8smb: client: Use HMAC-SHA256 library for SMB2 signature calculationfs/smb/client/cifsencrypt.c fs/smb/client/cifsproto.h fs/smb/client/smb2transport.c+53 -610 replies
4/8smb: client: Use MD5 library for M-F symlink hashingfs/smb/client/Kconfig fs/smb/client/link.c+4 -280 replies
5/8smb: client: Use MD5 library for SMB1 signature calculationfs/smb/client/cifsencrypt.c fs/smb/client/cifsproto.h+18 -170 replies
6/8smb: client: Use HMAC-MD5 library for NTLMv2fs/smb/client/cifsencrypt.c+22 -920 replies
7/8smb: client: Remove obsolete crypto_shash allocationsfs/smb/client/Kconfig fs/smb/client/cifsencrypt.c fs/smb/client/cifsfs.c +2 more+2 -470 replies
8/8smb: client: Consolidate cmac(aes) shash allocationfs/smb/client/sess.c fs/smb/client/smb2proto.h fs/smb/client/smb2transport.c+3 -110 replies

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchArd Biesheuvel
SeriesA-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] smb: client: More crypto library conversions

This series converts fs/smb/client/ to access SHA-512, HMAC-SHA256, MD5, 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.

Tested with Samba with all SMB versions, with mfsymlinks in the mount options, 'server min protocol = NT1' and 'server signing = required' in smb.conf, and doing a simple file data and symlink verification test. That seems to cover all the modified code paths.

However, with SMB 1.0 I get "CIFS: VFS: SMB signature verification returned error = -13", regardless of whether this series is applied or not. Presumably, testing that case requires some other setting I couldn't find.

Regardless, these are straightforward conversions and all the actual crypto is exactly the same as before, as far as I can tell.

Eric Biggers (8):
smb: client: Use SHA-512 library for SMB3.1.1 preauth hash
smb: client: Use HMAC-SHA256 library for key generation
smb: client: Use HMAC-SHA256 library for SMB2 signature calculation
smb: client: Use MD5 library for M-F symlink hashing
smb: client: Use MD5 library for SMB1 signature calculation
smb: client: Use HMAC-MD5 library for NTLMv2
smb: client: Remove obsolete crypto_shash allocations
smb: client: Consolidate cmac(aes) shash allocation

 fs/smb/client/Kconfig         |   7 +-
 fs/smb/client/cifsencrypt.c   | 201 +++++++++++++---------------------
 fs/smb/client/cifsfs.c        |   4 -
 fs/smb/client/cifsglob.h      |   3 -
 fs/smb/client/cifsproto.h     |  10 +-
 fs/smb/client/link.c          |  31 +-----
 fs/smb/client/sess.c          |   2 +-
 fs/smb/client/smb2misc.c      |  53 ++-------
 fs/smb/client/smb2proto.h     |   8 +-
 fs/smb/client/smb2transport.c | 164 +++++----------------------
 10 files changed, 131 insertions(+), 352 deletions(-)

base-commit: 67029a49db6c1f21106a1b5fcdd0ea234a6e0711

Signature · 1 line
2.51.0