]> www.infradead.org Git - users/hch/misc.git/commitdiff
smb: client: Consolidate cmac(aes) shash allocation
authorEric Biggers <ebiggers@kernel.org>
Sun, 12 Oct 2025 01:57:38 +0000 (18:57 -0700)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Oct 2025 03:10:28 +0000 (22:10 -0500)
Now that smb3_crypto_shash_allocate() and smb311_crypto_shash_allocate()
are identical and only allocate "cmac(aes)", delete the latter and
replace the call to it with the former.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/sess.c
fs/smb/client/smb2proto.h
fs/smb/client/smb2transport.c

index 0a8c2fcc9dedf1d75b247b7c738a682b371ddb70..ef3b498b0a02a7967348efba26ba5430f6a46cd5 100644 (file)
@@ -584,7 +584,7 @@ cifs_ses_add_channel(struct cifs_ses *ses,
         * to sign packets before we generate the channel signing key
         * (we sign with the session key)
         */
-       rc = smb311_crypto_shash_allocate(chan->server);
+       rc = smb3_crypto_shash_allocate(chan->server);
        if (rc) {
                cifs_dbg(VFS, "%s: crypto alloc failed\n", __func__);
                mutex_unlock(&ses->session_mutex);
index e7cda885c39f089f80c89c5db9837b468223f488..6eb86d134abcc5d2486444146903a6c4a3f22b35 100644 (file)
@@ -295,7 +295,7 @@ extern int smb2_validate_and_copy_iov(unsigned int offset,
 extern void smb2_copy_fs_info_to_kstatfs(
         struct smb2_fs_full_size_info *pfs_inf,
         struct kstatfs *kst);
-extern int smb311_crypto_shash_allocate(struct TCP_Server_Info *server);
+extern int smb3_crypto_shash_allocate(struct TCP_Server_Info *server);
 extern void smb311_update_preauth_hash(struct cifs_ses *ses,
                                       struct TCP_Server_Info *server,
                                       struct kvec *iov, int nvec);
index cd689bc27bfdcb1e67d3114dbbb823274c40fe8e..ad6068e17a2a99e81b782e8a8a4a7731d07e7807 100644 (file)
 #include "../common/smb2status.h"
 #include "smb2glob.h"
 
-static int
-smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
-{
-       struct cifs_secmech *p = &server->secmech;
-
-       return cifs_alloc_hash("cmac(aes)", &p->aes_cmac);
-}
-
 int
-smb311_crypto_shash_allocate(struct TCP_Server_Info *server)
+smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
 {
        struct cifs_secmech *p = &server->secmech;