mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-13 10:49:19 +02:00
SMB2Client: Fixed InvalidCastException on failed login to SMB 3.0 server
This commit is contained in:
parent
db68e84fb8
commit
21b0374519
1 changed files with 8 additions and 5 deletions
|
@ -223,6 +223,8 @@ namespace SMBLibrary.Client
|
||||||
if (response != null)
|
if (response != null)
|
||||||
{
|
{
|
||||||
m_isLoggedIn = (response.Header.Status == NTStatus.STATUS_SUCCESS);
|
m_isLoggedIn = (response.Header.Status == NTStatus.STATUS_SUCCESS);
|
||||||
|
if (m_isLoggedIn)
|
||||||
|
{
|
||||||
m_signingKey = SMB2Cryptography.GenerateSigningKey(m_sessionKey, m_dialect, null);
|
m_signingKey = SMB2Cryptography.GenerateSigningKey(m_sessionKey, m_dialect, null);
|
||||||
if (m_dialect == SMB2Dialect.SMB300)
|
if (m_dialect == SMB2Dialect.SMB300)
|
||||||
{
|
{
|
||||||
|
@ -230,6 +232,7 @@ namespace SMBLibrary.Client
|
||||||
m_encryptionKey = SMB2Cryptography.GenerateClientEncryptionKey(m_sessionKey, SMB2Dialect.SMB300, null);
|
m_encryptionKey = SMB2Cryptography.GenerateClientEncryptionKey(m_sessionKey, SMB2Dialect.SMB300, null);
|
||||||
m_decryptionKey = SMB2Cryptography.GenerateClientDecryptionKey(m_sessionKey, SMB2Dialect.SMB300, null);
|
m_decryptionKey = SMB2Cryptography.GenerateClientDecryptionKey(m_sessionKey, SMB2Dialect.SMB300, null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return response.Header.Status;
|
return response.Header.Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue