Two issues:
1. It's calling ReadAsync and expecting that all bytes requested will be read, even though it's valid for ReadAsync to return fewer than the number requested.
2. It's expecting ContinueWith to automatically unwrap the inner task, and as a result it's not actually waiting for the second write or the second read to complete.
Commit migrated from https://github.com/dotnet/corefx/commit/64dd9b963a1b06d6a9e7d8b76a464f6a882fab6b
We removed the lifting from the lineup so tests should reference the
latest packages in order to ensure an implementation is available.
The latest pacakges exclude implementation dependencies so I needed to
add these to projects that were depending on them coming in transitively.
Commit migrated from https://github.com/dotnet/corefx/commit/bef9061fd1238adf47b864d8924d121e4134465b
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.
Commit migrated from https://github.com/dotnet/corefx/commit/facff9e8d04d9e7ddf53eabea365306266f48865
We'd disabled these tests on Linux because they were failing on OpenSUSE. The reason turned out to be that the openssl installed on OpenSUSE was built explicitly without null cipher support. This commit re-enables the tests, but as ConditionalFacts that check whether we're either on Windows or on a Unix with an openssl that sports null ciphers.
Commit migrated from https://github.com/dotnet/corefx/commit/28b0230bfbf8555a6af6993b7a86f639d4143f2e
Currently in SslStream, exceptions get captured and then later thrown with "throw exception;". This causes their stack traces to get overwritten, losing information about where the exception actually came from. This commit changes these locations to use ExceptionDispatchInfo instead, enabling the stacks and Watson bucket information to be preserved.
For example, instead of:
```
System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) in corefx\src\System.Net.Security\src\System\Net\SecureProtocols\SslState.cs:line 752
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) in corefx\src\System.Net.Security\src\System\Net\SecureProtocols\SslState.cs:line 722
at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult) in corefx\src\System.Net.Security\src\System\Net\SecureProtocols\SslStream.cs:line 125
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xunit.Assert.<RecordExceptionAsync>d__61.MoveNext()
```
we now get:
```
System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) in corefx\src\System.Net.Security\src\System\Net\SecureProtocols\SslState.cs:line 882
at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest) in corefx\src\System.Net.Security\src\System\Net\SecureProtocols\SslState.cs:line 1110
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) in corefx\src\System.Net.Security\src\System\Net\SecureProtocols\SslState.cs:line 752
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) in corefx\src\System.Net.Security\src\System\Net\SecureProtocols\SslState.cs:line 722
at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult) in corefx\src\System.Net.Security\src\System\Net\SecureProtocols\SslStream.cs:line 125
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xunit.Assert.<RecordExceptionAsync>d__61.MoveNext()
```
Commit migrated from https://github.com/dotnet/corefx/commit/be3b7c684d0cac65b02643821366eb596e658c65
The Interop.OpenSsl.Decrypt implementation is assuming that data to be decrypted will never have output larger than the input, but that's not a valid assumption, such as when compression is employed and the received data to be decrypted may get longer when decompressed. This is causing failures in SslStream on OS X, which appears to be using compression as part of the underlying OpenSSL implementation.
Commit migrated from https://github.com/dotnet/corefx/commit/3ddac0a769a6b7f21be550194ae15173bc9ff16a
Some fixes (adding imports, adding Platforms package) were tooled, but more complex ones (forking project.jsons, editing csproj's) were not.
Also makes dependency version validation rules case-insensitive. (I used this fix to update the versions of some packages.)
[tfs-changeset: 1573868]
Commit migrated from https://github.com/dotnet/corefx/commit/84af04317505d48feaa1e83dd5dc27ddc0f6de76
The property leaks through the abstraction. It's rarely used. And it complicates things on Unix due to exposing the underlying socket instance combined with difficulties with multiple connect calls on a single socket instance.
Until we have good reason to expose it in the contract, we're removing it from the contract before it's stable.
Commit migrated from https://github.com/dotnet/corefx/commit/30abd30421289509cd3bd18a9114501afdc0fb7c