Restructure NegotiateAuthentication implementation (#87930)
* Change NegotiateAuthentication implementation to use indirection through NegotiateAuthenticationPal to the actual implementation.
The PAL implementation are merged from different sources to follow the same structure:
- NTAuthentication.Managed.cs -> NegotiateAuthenticationPal.Managed.cs
- NTAuthentication.Common.cs + NegotiateStreamPal.Windows.cs -> NegotiateAuthenticationPal.Windows.cs
- NTAuthentication.Common.cs + NegotiateStreamPal.Unix.cs -> NegotiateAuthenticationPal.Unix.cs
This split allows to delete ContextFlagsPal, SafeDeleteNegoContext, and SafeFreeNegoCredentials abstractions that were used in NegotiateStreamPal.
* Unify impersonation level validation between Windows and Unix pllatforms
* Split managed NTLM and managed SPNEGO implementations; add UseManagedNtlm switch on Unix platforms
* Remove debug cruft
* Fix couple of errors in managed SPNEGO
* Remove debug print
* Fix message sequence in managed NTLM; remove unused method
* Fix fallbacks on macOS GSSAPI
* Cleanup and fallbacks for missing NTLM, GSSAPI
* Adjust tests to assume that NTLM is always available on Unix
* Don't claim NTLM support on Browser
* Revert "Don't claim NTLM support on Browser"
This reverts commit
87d0c56f67a5269d9b334ab17887338ac4cfe49b.
* Attempt to fix the browser tests
* Revert "Attempt to fix the browser tests"
This reverts commit
91d7ce289a7274b682803b1d5dfdf418a5c2120c.
* Browser test suppression
* Respect UseManagedNtlm=false on platforms without NTLM GSSAPI provider
* Update src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.Unix.cs
* Revert all the fallback code paths, System.Net.Security.UseManagedNtlm has to be enabled explicitly; NativeAOT on Linux Bionic does that by default because it doesn't have GSSAPI and native shim