Skip to content

Commit 0f52f4d

Browse files
committedJun 29, 2017
Make sure to set proper NTLM flags when setting Domain and Host for Type3Messages
Also don't override the Domain if the user-supplied domain iss empty. *May* fix issue #532
1 parent 385ca8c commit 0f52f4d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎MailKit/Security/Ntlm/Type3Message.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public Type3Message (Type2Message type2, string userName, string hostName) : bas
6262
Level = NtlmSettings.DefaultAuthLevel;
6363

6464
challenge = (byte[]) type2.Nonce.Clone ();
65-
domain = type2.TargetName;
65+
Domain = type2.TargetName;
6666
Username = userName;
67-
host = hostName;
67+
Host = hostName;
6868

6969
Flags = (NtlmFlags) 0x8200;
7070
if ((type2.Flags & NtlmFlags.NegotiateUnicode) != 0)

‎MailKit/Security/SaslMechanismNtlm.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ static MessageBase GetChallengeResponse (string userName, string password, strin
149149
var type2 = new Type2Message (token, startIndex, length);
150150
var type3 = new Type3Message (type2, userName, string.Empty);
151151
type3.Password = password;
152-
type3.Domain = domain;
152+
153+
if (!string.IsNullOrEmpty (domain))
154+
type3.Domain = domain;
153155

154156
return type3;
155157
}

0 commit comments

Comments
 (0)