Refactoring the Windows specific code in NegotiateStream#5772
Conversation
|
following up #5581 |
|
Adding a reference to #2483 |
|
ping .. This is on top of the PR in dotnet/Master #5581 and has all the comments incorporated. |
There was a problem hiding this comment.
Why is this changing from Win32Exception to Exception? I realize the naming is poor, but it is actually supported on Unix, and it has the key features of both storing the error code and mapping it to a string supplied by the OS. Changing it to be Exception as is done here would seem to lose both of those things.
There was a problem hiding this comment.
ohk ,, in that case , will revert back.
|
@shrutigarg The extracted new methods in NegoState.* look good, except for cases where more refactoring was made (e.g. splitting existing methods or morphing two or more methods in a single method). To be consistent between SslStream/NegotiateStream as well as make support between Desktop and CoreFX, could we extract the PAL in a separate class? We could create NegotiateStreamPal.Windows/Unix.cs similarly to how SslStreamPal is implemented. That way, we can create a very clear PAL internal contract between platforms. |
594d6b1 to
a06eea7
Compare
|
@CIPop I fixed the refactoring by moving pal implementation to NegotiateStreamPal and created adapter class in last commit iteration. and other nit-pick comments in second last iteration. PTAL. |
|
@stephentoub , @bartonjs. please take a look at the last 2 commits. Thanks! |
c28a4f1 to
b108787
Compare
b0d8a2c to
f7f4af7
Compare
|
@dotnet-bot test this please |
1 similar comment
|
@dotnet-bot test this please |
| else if (string.Compare(name, WDigest, StringComparison.OrdinalIgnoreCase) == 0) | ||
| { | ||
| AuthenticationPackage = WDigest; | ||
| } |
There was a problem hiding this comment.
|
A few more comments, but as long as they're tracked to be addressed subsequently, I think it's ok to merge this. We'll want to re-review everything before the dev branch gets merged to master. |
|
Thanks. Will track them in an issue. |
238674f to
f7f4af7
Compare
8757e71 to
5367683
Compare
|
fixed a few comments and test issue. A few remaining comments are listed in issue #6063. Other failures in build seems unrelated to me |
|
@dotnet-bot test this please |
Refactoring the Windows specific code in NegotiateStream
summary
Renaming NegoState.Windows.cs to InternalNegoState.cs as it had much common code applicable for Unix. (commit1)
Separating out the common code and windows specific code in InternalNegoState and NegoState.Windows.cs respectiviely.
Adding NegotiateInfoClass.cs to be used by Unix impl.
Tested locally both AuthenticateAsServer/Client on Windows.
/cc:@stephentoub @bartonjs @CIPop @vijaykota