mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-04-30 02:37:49 +02:00
SMB2Client: Correctly handle signing when authenticated as guest
This commit is contained in:
parent
42ea6a5124
commit
9ff7adced4
1 changed files with 11 additions and 1 deletions
|
@ -272,7 +272,17 @@ namespace SMBLibrary.Client
|
||||||
if (m_isLoggedIn)
|
if (m_isLoggedIn)
|
||||||
{
|
{
|
||||||
SessionFlags sessionFlags = ((SessionSetupResponse)response).SessionFlags;
|
SessionFlags sessionFlags = ((SessionSetupResponse)response).SessionFlags;
|
||||||
m_signingKey = SMB2Cryptography.GenerateSigningKey(m_sessionKey, m_dialect, null);
|
if ((sessionFlags & SessionFlags.IsGuest) > 0)
|
||||||
|
{
|
||||||
|
// [MS-SMB2] 3.2.5.3.1 If the SMB2_SESSION_FLAG_IS_GUEST bit is set in the SessionFlags field of the SMB2
|
||||||
|
// SESSION_SETUP Response and if RequireMessageSigning is FALSE, Session.SigningRequired MUST be set to FALSE.
|
||||||
|
m_signingRequired = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_signingKey = SMB2Cryptography.GenerateSigningKey(m_sessionKey, m_dialect, null);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_dialect == SMB2Dialect.SMB300)
|
if (m_dialect == SMB2Dialect.SMB300)
|
||||||
{
|
{
|
||||||
m_encryptSessionData = (sessionFlags & SessionFlags.EncryptData) > 0;
|
m_encryptSessionData = (sessionFlags & SessionFlags.EncryptData) > 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue