diff mbox series

[SMB3] display debug information better for encryption

Message ID CAH2r5mtuuGd-OR-Ran9XWDzv7pW=pv6xUBGZExE87+NrChsRoQ@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [SMB3] display debug information better for encryption | expand

Commit Message

Steve French May 24, 2023, 1:38 a.m. UTC
Fix /proc/fs/cifs/DebugData to use the same case for "encryption"
(ie "Encryption" with init capital letter was used in one place).
In addition, if gcm256 encryption (intead of gcm128) is used on
a connection to a server, note that in the DebugData as well.

It now says (when gcm256 encryption negotiated):
Security type: RawNTLMSSP  SessionId: 0x86125800bc000b0d encrypted(gcm256)

Comments

ronnie sahlberg May 24, 2023, 1:44 a.m. UTC | #1
lgtm

acked-by me

On Wed, 24 May 2023 at 11:38, Steve French <smfrench@gmail.com> wrote:
>
> Fix /proc/fs/cifs/DebugData to use the same case for "encryption"
> (ie "Encryption" with init capital letter was used in one place).
> In addition, if gcm256 encryption (intead of gcm128) is used on
> a connection to a server, note that in the DebugData as well.
>
> It now says (when gcm256 encryption negotiated):
> Security type: RawNTLMSSP  SessionId: 0x86125800bc000b0d encrypted(gcm256)
>
> --
> Thanks,
>
> Steve
Steve French May 24, 2023, 1:50 a.m. UTC | #2
added trivial update to fix checkpatch warning about seq_puts vs. seq_printf

On Tue, May 23, 2023 at 8:44 PM ronnie sahlberg
<ronniesahlberg@gmail.com> wrote:
>
> lgtm
>
> acked-by me
>
> On Wed, 24 May 2023 at 11:38, Steve French <smfrench@gmail.com> wrote:
> >
> > Fix /proc/fs/cifs/DebugData to use the same case for "encryption"
> > (ie "Encryption" with init capital letter was used in one place).
> > In addition, if gcm256 encryption (intead of gcm128) is used on
> > a connection to a server, note that in the DebugData as well.
> >
> > It now says (when gcm256 encryption negotiated):
> > Security type: RawNTLMSSP  SessionId: 0x86125800bc000b0d encrypted(gcm256)
> >
> > --
> > Thanks,
> >
> > Steve
diff mbox series

Patch

From 944aaafb5051ad6a20abe9183900f1ed69efe7a1 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Tue, 23 May 2023 20:25:47 -0500
Subject: [PATCH] smb3: display debug information better for encryption

Fix /proc/fs/cifs/DebugData to use the same case for "encryption"
(ie "Encryption" with init capital letter was used in one place).
In addition, if gcm256 encryption (intead of gcm128) is used on
a connection to a server, note that in the DebugData as well.

Signed-off-by: Steven French <stfrench@microsoft.com>
---
 fs/cifs/cifs_debug.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index d4ed200a9471..74d2776e161f 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -108,7 +108,7 @@  static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
 	if ((tcon->seal) ||
 	    (tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) ||
 	    (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA))
-		seq_printf(m, " Encrypted");
+		seq_printf(m, " encrypted");
 	if (tcon->nocase)
 		seq_printf(m, " nocase");
 	if (tcon->unix_ext)
@@ -415,8 +415,12 @@  static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 
 			/* dump session id helpful for use with network trace */
 			seq_printf(m, " SessionId: 0x%llx", ses->Suid);
-			if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA)
+			if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) {
 				seq_puts(m, " encrypted");
+				/* can help in debugging to show encryption type */
+				if (server->cipher_type == SMB2_ENCRYPTION_AES256_GCM)
+					seq_puts(m, "(gcm256)");
+			}
 			if (ses->sign)
 				seq_puts(m, " signed");
 
-- 
2.34.1