Skip to content

Commit 27e9d5d

Browse files
bharathsm-mssmfrench
authored andcommitted
smb: minor fix to use SMB2_NTLMV2_SESSKEY_SIZE for auth_key size
Replaced hardcoded value 16 with SMB2_NTLMV2_SESSKEY_SIZE in the auth_key definition and memcpy call. Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]> Signed-off-by: Bharath SM <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 4d360cf commit 27e9d5d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fs/smb/client/cifs_ioctl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct smb_query_info {
6161
struct smb3_key_debug_info {
6262
__u64 Suid;
6363
__u16 cipher_type;
64-
__u8 auth_key[16]; /* SMB2_NTLMV2_SESSKEY_SIZE */
64+
__u8 auth_key[SMB2_NTLMV2_SESSKEY_SIZE];
6565
__u8 smb3encryptionkey[SMB3_SIGN_KEY_SIZE];
6666
__u8 smb3decryptionkey[SMB3_SIGN_KEY_SIZE];
6767
} __packed;

fs/smb/client/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
506506
le16_to_cpu(tcon->ses->server->cipher_type);
507507
pkey_inf.Suid = tcon->ses->Suid;
508508
memcpy(pkey_inf.auth_key, tcon->ses->auth_key.response,
509-
16 /* SMB2_NTLMV2_SESSKEY_SIZE */);
509+
SMB2_NTLMV2_SESSKEY_SIZE);
510510
memcpy(pkey_inf.smb3decryptionkey,
511511
tcon->ses->smb3decryptionkey, SMB3_SIGN_KEY_SIZE);
512512
memcpy(pkey_inf.smb3encryptionkey,

0 commit comments

Comments
 (0)