Skip to content

Commit

Permalink
Rewrote NTLM support based on official specs.
Browse files Browse the repository at this point in the history
Currently only NTLMv2 is implemented.
  • Loading branch information
jstedfast committed Sep 11, 2021
1 parent 814a671 commit 5086078
Show file tree
Hide file tree
Showing 26 changed files with 3,209 additions and 1,323 deletions.
11 changes: 7 additions & 4 deletions MailKit/MailKit.csproj
Expand Up @@ -138,14 +138,17 @@
<Compile Include="Search\UidSearchQuery.cs" />
<Compile Include="Search\UnarySearchQuery.cs" />
<Compile Include="Security\Ntlm\BitConverterLE.cs" />
<Compile Include="Security\Ntlm\ChallengeResponse2.cs" />
<Compile Include="Security\Ntlm\DES.cs" Condition=" $(TargetFramework.StartsWith('netstandard1.')) " />
<Compile Include="Security\Ntlm\HMACMD5.cs" Condition=" $(TargetFramework.StartsWith('netstandard1.')) " />
<Compile Include="Security\Ntlm\MD4.cs" />
<Compile Include="Security\Ntlm\MessageBase.cs" />
<Compile Include="Security\Ntlm\NtlmAuthLevel.cs" />
<Compile Include="Security\Ntlm\NtlmAttribute.cs" />
<Compile Include="Security\Ntlm\NtlmAttributeValuePair.cs" />
<Compile Include="Security\Ntlm\NtlmFlags.cs" />
<Compile Include="Security\Ntlm\TargetInfo.cs" />
<Compile Include="Security\Ntlm\NtlmMessageBase.cs" />
<Compile Include="Security\Ntlm\NtlmSingleHostData.cs" />
<Compile Include="Security\Ntlm\NtlmTargetInfo.cs" />
<Compile Include="Security\Ntlm\NtlmUtils.cs" />
<Compile Include="Security\Ntlm\RC4.cs" />
<Compile Include="Security\Ntlm\Type1Message.cs" />
<Compile Include="Security\Ntlm\Type2Message.cs" />
<Compile Include="Security\Ntlm\Type3Message.cs" />
Expand Down
17 changes: 6 additions & 11 deletions MailKit/Security/Ntlm/BitConverterLE.cs
Expand Up @@ -26,14 +26,9 @@

using System;

namespace MailKit.Security.Ntlm
{
sealed class BitConverterLE
namespace MailKit.Security.Ntlm {
static class BitConverterLE
{
BitConverterLE ()
{
}

unsafe static byte[] GetULongBytes (byte *bytes)
{
if (BitConverter.IsLittleEndian)
Expand Down Expand Up @@ -73,7 +68,7 @@ unsafe static void UIntFromBytes (byte *dst, byte[] src, int startIndex)
}
}

unsafe internal static short ToInt16 (byte[] value, int startIndex)
public unsafe static short ToInt16 (byte[] value, int startIndex)
{
short ret;

Expand All @@ -82,7 +77,7 @@ unsafe internal static short ToInt16 (byte[] value, int startIndex)
return ret;
}

unsafe internal static int ToInt32 (byte[] value, int startIndex)
public unsafe static int ToInt32 (byte[] value, int startIndex)
{
int ret;

Expand All @@ -91,7 +86,7 @@ unsafe internal static int ToInt32 (byte[] value, int startIndex)
return ret;
}

unsafe internal static ushort ToUInt16 (byte[] value, int startIndex)
public unsafe static ushort ToUInt16 (byte[] value, int startIndex)
{
ushort ret;

Expand All @@ -100,7 +95,7 @@ unsafe internal static ushort ToUInt16 (byte[] value, int startIndex)
return ret;
}

unsafe internal static uint ToUInt32 (byte[] value, int startIndex)
public unsafe static uint ToUInt32 (byte[] value, int startIndex)
{
uint ret;

Expand Down
285 changes: 0 additions & 285 deletions MailKit/Security/Ntlm/ChallengeResponse2.cs

This file was deleted.

0 comments on commit 5086078

Please sign in to comment.