Commit 3c15a6df authored by Eric Biggers's avatar Eric Biggers Committed by Steve French
Browse files

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: default avatarStefan Metzmacher <metze@samba.org>
Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
Signed-off-by: default avatarEric Biggers <ebiggers@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 2c09630d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −9
Original line number Diff line number Diff line
@@ -27,16 +27,8 @@
#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;