From 42ea6a51241f1748de53f3bf2375dcda133b27a1 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Mon, 29 Jul 2024 21:41:40 +0300 Subject: [PATCH] SMB2Client: Minor code refactoring --- SMBLibrary/Client/SMB2Client.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SMBLibrary/Client/SMB2Client.cs b/SMBLibrary/Client/SMB2Client.cs index 78b0d73..1d34e2d 100644 --- a/SMBLibrary/Client/SMB2Client.cs +++ b/SMBLibrary/Client/SMB2Client.cs @@ -271,10 +271,11 @@ namespace SMBLibrary.Client m_isLoggedIn = (response.Header.Status == NTStatus.STATUS_SUCCESS); if (m_isLoggedIn) { + SessionFlags sessionFlags = ((SessionSetupResponse)response).SessionFlags; m_signingKey = SMB2Cryptography.GenerateSigningKey(m_sessionKey, m_dialect, null); if (m_dialect == SMB2Dialect.SMB300) { - m_encryptSessionData = (((SessionSetupResponse)response).SessionFlags & SessionFlags.EncryptData) > 0; + m_encryptSessionData = (sessionFlags & SessionFlags.EncryptData) > 0; m_encryptionKey = SMB2Cryptography.GenerateClientEncryptionKey(m_sessionKey, SMB2Dialect.SMB300, null); m_decryptionKey = SMB2Cryptography.GenerateClientDecryptionKey(m_sessionKey, SMB2Dialect.SMB300, null); }