NTLMAuthenticationClient: Set MechanismListMIC when applicable

This commit is contained in:
Tal Aloni 2024-07-30 22:57:28 +03:00
parent dc52d4efc1
commit 1284a2168d

View file

@ -5,6 +5,7 @@
* either version 3 of the License, or (at your option) any later version. * either version 3 of the License, or (at your option) any later version.
*/ */
using SMBLibrary.Authentication.GSSAPI; using SMBLibrary.Authentication.GSSAPI;
using SMBLibrary.Authentication.NTLM;
using System.Collections.Generic; using System.Collections.Generic;
using Utilities; using Utilities;
@ -108,6 +109,9 @@ namespace SMBLibrary.Client.Authentication
{ {
SimpleProtectedNegotiationTokenResponse outputToken = new SimpleProtectedNegotiationTokenResponse(); SimpleProtectedNegotiationTokenResponse outputToken = new SimpleProtectedNegotiationTokenResponse();
outputToken.ResponseToken = authenticateMessageBytes; outputToken.ResponseToken = authenticateMessageBytes;
List<byte[]> mechanismTypeList = new List<byte[]>() { GSSProvider.NTLMSSPIdentifier };
byte[] mechListBytes = SimpleProtectedNegotiationTokenInit.GetMechanismTypeListBytes(mechanismTypeList);
outputToken.MechanismListMIC = NTLMCryptography.ComputeMechListMIC(m_sessionKey, mechListBytes);
return outputToken.GetBytes(); return outputToken.GetBytes();
} }
else else