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

Enable NegotiateStream For Unix#6469

Merged
kapilash merged 1 commit into
dotnet:masterfrom
kapilash:negotiatestream
Mar 18, 2016
Merged

Enable NegotiateStream For Unix#6469
kapilash merged 1 commit into
dotnet:masterfrom
kapilash:negotiatestream

Conversation

@kapilash
Copy link
Copy Markdown
Contributor

Problem

Enabling System.Net.Security.NegotiateStream for Unix.

Solution

This PR introduces the implementation of NegotiateStream based on native implementations of gssapi

The native implementations used are mit-krb5 on linux and the built-in GSS.Framework for OSX.

Also included are scripts to configure and deploy KDC on the host machine so as to run the associated tests.

cc: @stephentoub @bartonjs @CIPop @davidsh @vijaykota @shrutigarg

assert(outBuffer != nullptr);
// count refers to the length of the input message. That is, number of bytes of inputBytes
// starting at offset
// that need to be wrapped.
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.

Nit: why the extra line wrap here?

Debug.Assert(offset >= 0 && offset <= inputBytes.Length, "offset must be valid");
Debug.Assert( count >=0 && count <= inputBytes.Length, "count must be valid");
Debug.Assert(count + offset <= inputBytes.Length, "offset and count must be valid");
Debug.Assert(count >=0 && count <= inputBytes.Length, "count must be valid");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Missing space between >= and 0.

@bartonjs
Copy link
Copy Markdown
Member

Aside from the one missing space, the new commit looks good.

Pending changes I don't see reflected in the deferral issue:

Open questions:

I'm okay with those being deferred, if that's the plan; but the feedback shouldn't be lost. (And Steve and I had a few comments about improving the test code).

Since it was pointed out to me that while Ubuntu 14.04 OuterLoop failed previously, 3 other distros ran; so the tests have been seen to pass (e.g. http://dotnet-ci.cloudapp.net/job/dotnet_corefx/job/outerloop_ubuntu15.10_debug_tst_prtest/3/testReport/System.Net.Security.Tests/KerberosTest/), so I'm not concerned that it hasn't been tested.

As long as the other pending work/questions are tracked (or fixed) LGTM.

Enabling NegotiateStream for Unix using native gssapi implementation.
The native libraries used are mit-krb5 on linux and the built-in GSS.Framework for OSX.

Also included are the tests which rely on configuring and deploying KDC on the host machine.
@kapilash
Copy link
Copy Markdown
Contributor Author

Pending changes I don't see reflected in the deferral issue:
Incorrect comment: #6469 (diff)
Bad use of var: #6469 (comment)
Unexpected usages of UnsignedCast: #6469 (comment)

These are all fixed.

Open questions:

Reassigning freshly-built struct fields: #6469 (comment)
We assert that a ** isn't null, but do we also need to inspect the value it's pointing at?: #6469 (comment), others

Updated #7031 with these and other issues. I believe I did not miss any thing now.
I am merging this.

Thanks a lot @bartonjs , @stephentoub

kapilash added a commit that referenced this pull request Mar 18, 2016
Enable NegotiateStream For Unix
@kapilash kapilash merged commit f13855b into dotnet:master Mar 18, 2016
@kapilash kapilash deleted the negotiatestream branch March 18, 2016 19:56
internal class NegotiationInfoClass
internal partial class NegotiationInfoClass
{
internal const string NTLM = "NTLM";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What was the reason this got separated in two? I find it odd to have a partial class only to define 3 const strings. Shouldn't we create a new class for these strings instead if they can't live here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net os-linux Linux OS (any supported distro)

Projects

None yet

Development

Successfully merging this pull request may close these issues.