]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: minor fix to use SMB2_NTLMV2_SESSKEY_SIZE for auth_key size
authorBharath SM <bharathsm@microsoft.com>
Thu, 19 Jun 2025 15:35:34 +0000 (21:05 +0530)
committerSteve French <stfrench@microsoft.com>
Sat, 21 Jun 2025 16:03:25 +0000 (11:03 -0500)
Replaced hardcoded value 16 with SMB2_NTLMV2_SESSKEY_SIZE
in the auth_key definition and memcpy call.

Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifs_ioctl.h
fs/smb/client/ioctl.c

index 26327442e383b1626aab48f239e0348a11d9dbd9..b51ce64fcccf9fd39806cc4350771ce8c6ae3e29 100644 (file)
@@ -61,7 +61,7 @@ struct smb_query_info {
 struct smb3_key_debug_info {
        __u64   Suid;
        __u16   cipher_type;
-       __u8    auth_key[16]; /* SMB2_NTLMV2_SESSKEY_SIZE */
+       __u8    auth_key[SMB2_NTLMV2_SESSKEY_SIZE];
        __u8    smb3encryptionkey[SMB3_SIGN_KEY_SIZE];
        __u8    smb3decryptionkey[SMB3_SIGN_KEY_SIZE];
 } __packed;
index 56439da4f1194dc7c963cc010154cd6df72d2921..0a9935ce05a5ad9a4fce128201757a1c1cdaeb42 100644 (file)
@@ -506,7 +506,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
                                le16_to_cpu(tcon->ses->server->cipher_type);
                        pkey_inf.Suid = tcon->ses->Suid;
                        memcpy(pkey_inf.auth_key, tcon->ses->auth_key.response,
-                                       16 /* SMB2_NTLMV2_SESSKEY_SIZE */);
+                                 SMB2_NTLMV2_SESSKEY_SIZE);
                        memcpy(pkey_inf.smb3decryptionkey,
                              tcon->ses->smb3decryptionkey, SMB3_SIGN_KEY_SIZE);
                        memcpy(pkey_inf.smb3encryptionkey,