Skip to content

Commit 3c15a6d

Browse files
Eric Biggerssmfrench
authored andcommitted
smb: client: Consolidate cmac(aes) shash allocation
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>
1 parent 2c09630 commit 3c15a6d

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

fs/smb/client/sess.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ cifs_ses_add_channel(struct cifs_ses *ses,
584584
* to sign packets before we generate the channel signing key
585585
* (we sign with the session key)
586586
*/
587-
rc = smb311_crypto_shash_allocate(chan->server);
587+
rc = smb3_crypto_shash_allocate(chan->server);
588588
if (rc) {
589589
cifs_dbg(VFS, "%s: crypto alloc failed\n", __func__);
590590
mutex_unlock(&ses->session_mutex);

fs/smb/client/smb2proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ extern int smb2_validate_and_copy_iov(unsigned int offset,
295295
extern void smb2_copy_fs_info_to_kstatfs(
296296
struct smb2_fs_full_size_info *pfs_inf,
297297
struct kstatfs *kst);
298-
extern int smb311_crypto_shash_allocate(struct TCP_Server_Info *server);
298+
extern int smb3_crypto_shash_allocate(struct TCP_Server_Info *server);
299299
extern void smb311_update_preauth_hash(struct cifs_ses *ses,
300300
struct TCP_Server_Info *server,
301301
struct kvec *iov, int nvec);

fs/smb/client/smb2transport.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,8 @@
2727
#include "../common/smb2status.h"
2828
#include "smb2glob.h"
2929

30-
static int
31-
smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
32-
{
33-
struct cifs_secmech *p = &server->secmech;
34-
35-
return cifs_alloc_hash("cmac(aes)", &p->aes_cmac);
36-
}
37-
3830
int
39-
smb311_crypto_shash_allocate(struct TCP_Server_Info *server)
31+
smb3_crypto_shash_allocate(struct TCP_Server_Info *server)
4032
{
4133
struct cifs_secmech *p = &server->secmech;
4234

0 commit comments

Comments
 (0)