smb: client: make SHA-512 TFM ephemeral
authorEnzo Matsumiya <ematsumiya@suse.de>
Thu, 26 Sep 2024 17:46:16 +0000 (14:46 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 26 Sep 2024 23:15:19 +0000 (18:15 -0500)
commit220d83b52c7d16ec3c168b82f4e6ce59c645f7ab
treeeec846177fdd5b3e10712ee3606c90ff337d3c89
parentdb44ca9f7bc00a368d345b9fa1ecee0c4e75ac48
smb: client: make SHA-512 TFM ephemeral

The SHA-512 shash TFM is used only briefly during Session Setup stage,
when computing SMB 3.1.1 preauth hash.

There's no need to keep it allocated in servers' secmech the whole time,
so keep its lifetime inside smb311_update_preauth_hash().

This also makes smb311_crypto_shash_allocate() redundant, so expose
smb3_crypto_shash_allocate() and use that.

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsencrypt.c
fs/smb/client/cifsglob.h
fs/smb/client/sess.c
fs/smb/client/smb2misc.c
fs/smb/client/smb2proto.h
fs/smb/client/smb2transport.c