Implement NegotiateAuthentication API (#70720)
* WIP: Add implementation of NegotiateAuthentication
Switch System.Net.Http to use NegotiateAuthentication
Fix IsCompleted in managed NTLM implementation
* WIP: Update error code mapping
* Spanify input of GetOutgoingBlob
* Update comments
* Move NegotiateStreamPal.Encrypt/Decrypt to shared sources. Unix implementation already had them and they get trimmed anyway.
* Revert accidental change
* Build fixes.
* Fix error handling condition
* Update error mapping based on HttpListener usage.
* WIP: HttpListener test
* Move workaround from HttpListener to low-level SSPI code
* Fix build
* Clean up
* Revert "WIP: HttpListener test"
This reverts commit
18d7d93f04c93e048efcaca0f3c55c3f1f73516a.
* Convert System.Net.Http.FunctionalTests to use NegotiateAuthentication instead of NTAuthentication
* Dispose the identity along NegotiateAuthentication
* Modify unit tests to use the new API
* Add exceptions for invalid inputs/states
* Remove tvOS unsupported marker, managed NTLM is used on tvOS
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix typo
* Remove reference equality checks from IsNTLM/IsKerberos
* Remove NTAuthentication.AssociatedName to make it more obvious which exceptions are thrown
* Add comment
* Add more tests, handle unsupported protocols
* Handle NotSupportedException from NTAuthentication constructor
* Add workaround for linker issue
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>