IntegratedNTLMAuthenticationProvider: The correct SessionKey will now be returned instead of EncryptedRandomSessionKey

This commit is contained in:
Tal Aloni 2017-03-02 13:10:34 +02:00
parent f1d65fedd2
commit 832b791fcc

View file

@ -23,7 +23,6 @@ namespace SMBLibrary.Win32.Security
public SecHandle ServerContext; public SecHandle ServerContext;
public string WorkStation; public string WorkStation;
public string UserName; public string UserName;
public byte[] SessionKey;
public bool IsGuest; public bool IsGuest;
public AuthContext(SecHandle serverContext, string workStation) public AuthContext(SecHandle serverContext, string workStation)
@ -74,7 +73,6 @@ namespace SMBLibrary.Win32.Security
} }
authContext.UserName = message.UserName; authContext.UserName = message.UserName;
authContext.SessionKey = message.EncryptedRandomSessionKey;
if ((message.NegotiateFlags & NegotiateFlags.Anonymous) > 0 || if ((message.NegotiateFlags & NegotiateFlags.Anonymous) > 0 ||
!IsUserExists(message.UserName)) !IsUserExists(message.UserName))
{ {
@ -153,7 +151,7 @@ namespace SMBLibrary.Win32.Security
case GSSAttributeName.MachineName: case GSSAttributeName.MachineName:
return authContext.WorkStation; return authContext.WorkStation;
case GSSAttributeName.SessionKey: case GSSAttributeName.SessionKey:
return authContext.SessionKey; return SSPIHelper.GetSessionKey(authContext.ServerContext);
case GSSAttributeName.UserName: case GSSAttributeName.UserName:
return authContext.UserName; return authContext.UserName;
} }