Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Native shims for libheimntlm inorder to support NTLM#5919

Closed
kapilash wants to merge 8 commits into
dotnet:dev/negotiatestreamfrom
kapilash:devntlmstream
Closed

Native shims for libheimntlm inorder to support NTLM#5919
kapilash wants to merge 8 commits into
dotnet:dev/negotiatestreamfrom
kapilash:devntlmstream

Conversation

@kapilash
Copy link
Copy Markdown
Contributor

@kapilash kapilash commented Feb 5, 2016

Introducing native shims for libheimntlm inorder to support NTLM

This PR overwrites #5728

private const string ClientToServerSigningMagicKey = "session key to client-to-server signing key magic constant\0";
private const string ServerToClientSigningMagicKey = "session key to server-to-client signing key magic constant\0";
private const string ServerToClientSealingMagicKey = "session key to server-to-client sealing key magic constant\0";
private const string ClientToServerSealingMagicKey = "session key to client-to-server sealing key magic constant\0";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be pre- allocated/encoded, e.g.:

private static readonly byte[] s_clientToServerSigningMagicKey = Encoding.UTF8.GetBytes("session key to client-to-server signing key magic constant\0");
private static readonly byte[] s_serverToClientSigningMagicKey = Encoding.UTF8.GetBytes("session key to server-to-client signing key magic constant\0");
private static readonly byte[] s_serverToClientSealingMagicKey = Encoding.UTF8.GetBytes("session key to server-to-client sealing key magic constant\0");
private static readonly byte[] s_clientToServerSealingMagicKey = Encoding.UTF8.GetBytes("session key to client-to-server sealing key magic constant\0");

...to avoid having to allocate a new byte[] and encode each time they are used?

@stephentoub
Copy link
Copy Markdown
Member

@kapilash, @vijaykota, should this PR be closed?

@vijaykota
Copy link
Copy Markdown
Contributor

We are planning a few more changes to make the managed layer independent of the underlying library used by the shim (unmanaged) layer. After that we can close this till we figure out the library to use.

@stephentoub stephentoub added the * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Feb 15, 2016
kapilash and others added 7 commits February 23, 2016 14:55
Introducing native shims for libheimntlm inorder to support NTLM
Use IncrementalHash instead of implementing it
Use Names consistent with the other PR

Conflicts:
	src/Common/src/Interop/Linux/System.Net.Security.Native/Interop.Ntlm.cs
Native Layer:
     asserts
     Introduced struct PAL_NtlmBuffer to have a clearer ownership of the resources owned by ntlm_buf

Managed Layer:
     Cleaned up code that was a result of code evaluation.
     Refactored classes from SafeHandles to simple classes or Disposable objects.
     Proper handling of offsets in Debug.Asserts
1. UInt64 to ulong
2. Method name changed to fit the appropriate type being marshalled
3. Reduce the allocations done by using a static byte array
Renamed HeimdalNtlm to Ntlm
Renamed HeimdalNtlmException to NtlmException
Naming convention in the shim layer is NetNativeNtlm_<Functionality>
@vijaykota
Copy link
Copy Markdown
Contributor

Closing this since we don't want to pursue the libheimntlm option

@vijaykota vijaykota closed this Feb 25, 2016
@kapilash kapilash deleted the devntlmstream branch March 18, 2016 09:06
@karelz karelz added this to the 1.0.0-rtm milestone Jan 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants