From 1284a2168dc20bb082587d5373f0b32f0cfb2917 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Tue, 30 Jul 2024 22:57:28 +0300 Subject: [PATCH] NTLMAuthenticationClient: Set MechanismListMIC when applicable --- SMBLibrary/Client/Authentication/NTLMAuthenticationClient.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SMBLibrary/Client/Authentication/NTLMAuthenticationClient.cs b/SMBLibrary/Client/Authentication/NTLMAuthenticationClient.cs index 869b9f8..9d563e0 100644 --- a/SMBLibrary/Client/Authentication/NTLMAuthenticationClient.cs +++ b/SMBLibrary/Client/Authentication/NTLMAuthenticationClient.cs @@ -5,6 +5,7 @@ * either version 3 of the License, or (at your option) any later version. */ using SMBLibrary.Authentication.GSSAPI; +using SMBLibrary.Authentication.NTLM; using System.Collections.Generic; using Utilities; @@ -108,6 +109,9 @@ namespace SMBLibrary.Client.Authentication { SimpleProtectedNegotiationTokenResponse outputToken = new SimpleProtectedNegotiationTokenResponse(); outputToken.ResponseToken = authenticateMessageBytes; + List mechanismTypeList = new List() { GSSProvider.NTLMSSPIdentifier }; + byte[] mechListBytes = SimpleProtectedNegotiationTokenInit.GetMechanismTypeListBytes(mechanismTypeList); + outputToken.MechanismListMIC = NTLMCryptography.ComputeMechListMIC(m_sessionKey, mechListBytes); return outputToken.GetBytes(); } else