NTLM: NEGOTIATE_MESSAGE: Do not include DomainName and WorkstationName if the appropriate flags are not set

This commit is contained in:
Tal Aloni 2017-09-01 18:40:53 +03:00
parent b3445530ac
commit 06a30bc92d

View file

@ -46,6 +46,16 @@ namespace SMBLibrary.Authentication.NTLM
public byte[] GetBytes() public byte[] GetBytes()
{ {
if ((NegotiateFlags & NegotiateFlags.DomainNameSupplied) == 0)
{
DomainName = String.Empty;
}
if ((NegotiateFlags & NegotiateFlags.WorkstationNameSupplied) == 0)
{
Workstation = String.Empty;
}
int fixedLength = 32; int fixedLength = 32;
if ((NegotiateFlags & NegotiateFlags.Version) > 0) if ((NegotiateFlags & NegotiateFlags.Version) > 0)
{ {