Commit Graph
112 Commits
Author SHA1 Message Date
Jon Hanna 9e5785eb93 Fix Multiple Typos
Commit migrated from https://github.com/dotnet/corefx/commit/b0dd6b14fc845058b768fc7052b46aab0c1da22c
2016-03-20 16:37:09 +00:00
Jon Hanna 109feb6662 Fix multiple typos.
Commit migrated from https://github.com/dotnet/corefx/commit/3e57029abfd9b205857460b89b9907ccaac4a249
2016-03-20 14:55:31 +00:00
Stephen Toub 6c947edadf Merge pull request dotnet/corefx#6880 from justinvp/netsecurity
Break dependency on older collections in System.Net.Security

Commit migrated from https://github.com/dotnet/corefx/commit/41949d5fafd7cd283a71cf4332679c6179e8afbc
2016-03-19 13:27:58 -04:00
Eric St. John 6aeccb0bae Fix tests to restore using the latest packages
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
2016-03-19 08:01:11 -07:00
Eric St. John ff75367f93 Update packages to rc3-23918
Commit migrated from https://github.com/dotnet/corefx/commit/d3d217b2ab336b862c27a3e605e32dc0c0a6d472
2016-03-19 08:01:09 -07:00
Justin Van Patten f88ef2e2f9 System.Net.Security: Remove dependency on non-generic collections
Includes minor perf improvements and cleanup.


Commit migrated from https://github.com/dotnet/corefx/commit/9926a6fc52d957d181439a2a1371e2dac495a2a0
2016-03-19 09:35:33 +09:00
Hemanth Kapila 437267bc28 Enable NegotiateStream For Unix
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
2016-03-19 00:01:29 +05:30
stephentoub d5e591e45a Update packages to rc3-23910
Commit migrated from https://github.com/dotnet/corefx/commit/ab3948bfab039aac2afc1b521883425a171b982d
2016-03-10 09:37:40 -05:00
Eric St. John 8cba463a08 Update crypto package dependency versions
System.Security.Cryptography.Algorithms, Cng, and X509Certificates are
now 4.1.0.  Update dependencies to ensure we get the right build.


Commit migrated from https://github.com/dotnet/corefx/commit/6e3e29dbec3705094a539b6b2dc863c5a8ee270c
2016-03-08 21:40:47 -08:00
stephentoub f4959f5f54 Throw PlatformNotSupportedException for unsupported encryption policies
Commit migrated from https://github.com/dotnet/corefx/commit/774f5d02f1ac039cf23fafe4b7fc4089447050cb
2016-03-08 20:46:48 -05:00
stephentoub 7fb4ccd3dd Re-enable System.Net.Security "no encryption" tests on Linux
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
2016-03-08 20:37:13 -05:00
stephentoub c0eb281ce4 Fix version conflict warnings when building System.Net.Security.Tests
Commit migrated from https://github.com/dotnet/corefx/commit/fa3c609fd33d2943efd6ccd1035b17582c3b91ec
2016-03-08 14:10:34 -05:00
stephentoub f9b3bc26fd Use ExceptionDispatchInfo in SslStream
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
2016-03-08 14:10:34 -05:00
Eric St. John 04a73fbed6 Update packages to rc3-23908
Commit migrated from https://github.com/dotnet/corefx/commit/86a230845c4f1840dcb9b52165c6976fad5b5868
2016-03-08 08:46:50 -08:00
stephentoub 38f7d19954 Update packages to rc3-23907
Commit migrated from https://github.com/dotnet/corefx/commit/baed539ebb753fefc91da9870ddeee72df0a6e14
2016-03-07 10:12:40 -05:00
stephentoub f3434408bc Update xunit.netcore.extensions to 00187
Commit migrated from https://github.com/dotnet/corefx/commit/3cfd81e7369628d052da6367b28c6f5b5839f55d
2016-03-03 22:06:40 -05:00
stephentoub 9b4473ede7 Upgrade package versions to rc3-23901
Commit migrated from https://github.com/dotnet/corefx/commit/55246a7fc60807d021fded5e333784956a662a51
2016-03-02 07:40:12 -05:00
Pallavi Taneja 38e2f4de64 Update the packages
Commit migrated from https://github.com/dotnet/corefx/commit/be7151b45a54577c2e28c56977408d7d61ed0ea9
2016-02-29 13:09:16 -08:00
stephentoub ce3ff8cb9e Fix Interop.OpenSsl.Decrypt to handle decompression
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
2016-02-24 19:04:43 -05:00
dotnet-bot b32ddb5d98 Deploy nameof throughout corefx in MemberData
Commit migrated from https://github.com/dotnet/corefx/commit/9c3156b9ada06b8e58ac53d48fc303500bf3e476
2016-02-18 23:58:15 -05:00
stephentoub 95d7cc7534 Update packages to rc3-23818
Commit migrated from https://github.com/dotnet/corefx/commit/380a2ebf4a498f9ab0a819c71d8717377e601bfb
2016-02-18 07:28:09 -05:00
stephentoub 180fba592f Update packages to rc3-23816
Commit migrated from https://github.com/dotnet/corefx/commit/c2e6426b9b9494d5478f656396f4da5711e8729a
2016-02-16 11:05:43 -05:00
Davis Goodin 1bc755f9e7 Adds custom xplat nuget that can restore from VSTS feed, adds the VSTS feed, and upgrades project.jsons throughout NDP\FxCore to pass new nuget compatability checks.
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
2016-02-09 14:20:02 -08:00
Cristian Pop 60e09ea41b Merge pull request dotnet/corefx#5852 from CIPop/snstest
Test fixes for System.Net.Security

Commit migrated from https://github.com/dotnet/corefx/commit/4cd21f31004ca7205a5789fe22b334242ab766fc
2016-02-09 13:07:34 -08:00
Jeremy Barton 016afcf113 Merge pull request dotnet/corefx#5981 from bartonjs/osx_remotecert_test
Remove the stale ActiveIssue(5555) tag for OSX

Commit migrated from https://github.com/dotnet/corefx/commit/69e8882f0e1713411e7f51dea0f50a36819bf928
2016-02-08 23:06:11 -08:00
bartonjs 63b35f0cfd Remove the ActiveIssue(5555) tag for OSX
Since the default root store should have trust for this cert now,
consider this scenario to be Generally Regarded As Safe, like it is
for the other platforms.


Commit migrated from https://github.com/dotnet/corefx/commit/88b0d052a76ec90ec6fa575428a1d55d3901ae88
2016-02-08 18:21:54 -08:00
David Shulman 1f1410d4c8 Merge pull request dotnet/corefx#5953 from stephentoub/remove_client
Remove Client property from TcpClient and UdpClient

Commit migrated from https://github.com/dotnet/corefx/commit/1384104e25838004b230fc7f17fffb768c62fa5e
2016-02-08 16:21:28 -08:00
Cristian Pop 01d61b736f Fixing and adding tests for the in-memory VirtualNetwork/Stream. Adding
TaskTimeoutExtensions and fixing the System.Net.Security timeout pattern.


Commit migrated from https://github.com/dotnet/corefx/commit/27954497d635ff0f01fbb16e1b485156c51398ea
2016-02-08 16:02:01 -08:00
stephentoub 2e521c57c9 Update packages to rc3-23808
Commit migrated from https://github.com/dotnet/corefx/commit/31bb3a0cd271aebc9a4336a53b0fc3bb900fe22f
2016-02-08 07:26:49 -05:00
stephentoub 53f90194de Remove Client property from TcpClient and UdpClient
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
2016-02-07 10:40:27 -05:00
Stephen Toub 0062318ecb Merge pull request dotnet/corefx#5892 from stephentoub/large_write_test
Add a large write/read test for SslStream

Commit migrated from https://github.com/dotnet/corefx/commit/327fb365bc7a0cc388f8151927fa552c6178dfb7
2016-02-04 21:45:31 -05:00
stephentoub 22d4b057d7 Add large write/read test for SslStream
Commit migrated from https://github.com/dotnet/corefx/commit/bb58fe8011d0c461a2a57faf2647fd73799f2f29
2016-02-04 14:10:00 -05:00
Stephen Toub 37dc6fd97f Merge pull request dotnet/corefx#5835 from stephentoub/sslreadbyte
Override ReadByte on SslStream

Commit migrated from https://github.com/dotnet/corefx/commit/4e2632e194dff28fdf296e0f38c508ef0b95e532
2016-02-04 09:55:08 -05:00
stephentoub 318936cdab Override ReadByte on SslStream
In an application that's using the Redis client library, a significant portion of the allocations are coming from calls to ReadByte on an SslStream.  Since SslStream doesn't override ReadByte, the base Stream.ReadByte is used, and it ends up allocating a temporary array to use in a call to Read.

This commit adds an override of ReadByte on SslStream that returns data from the stream's internal buffer if any is available, otherwise falling back to the old behavior.

On a test that repeatedly writes 1000 bytes and then reads each of those with ReadByte, allocations are reduced by 10x and throughput is doubled. (Note that removing the Interlocked.Exchange in ReadByte yields another 20% improvement in throughput, but I've left it in so as not to impact guarantees of the type.)


Commit migrated from https://github.com/dotnet/corefx/commit/b999431c9c519a797aff3eb472b614e0f15c6650
2016-02-04 08:25:22 -05:00
stephentoub 30a19d4335 Update packages to rc3-23803
Commit migrated from https://github.com/dotnet/corefx/commit/d27ef6fb6092060e643c49a670e825e0cc01ff4d
2016-02-04 07:38:24 -05:00
stephentoub 715cbde1c2 Update dependencies to rc3-23729
Commit migrated from https://github.com/dotnet/corefx/commit/372c940deee1f81c452e69a0ad46ae9f18f6d803
2016-01-29 18:11:41 -08:00
Stephen Toub c82c776c03 Merge pull request dotnet/corefx#5758 from bartonjs/unix_sslstream_clientauth
Enable Client Auth Certs for Unix SslStream.

Commit migrated from https://github.com/dotnet/corefx/commit/f04c30f5ef95b5dd0f1ca5d5684b20c4cb0a2719
2016-01-28 23:23:19 -08:00
stephentoub de46cba923 Reenable cert validation test on Linux
Commit migrated from https://github.com/dotnet/corefx/commit/c7f630678f752e96a95f8fc53c208306981eb7ea
2016-01-28 18:27:29 -08:00
Jose Perez Rodriguez 88f2de884f Merge pull request dotnet/corefx#5711 from joperezr/RestoreMSBuild
Use .Net Core MSBuild for OS X and Linux Builds

Commit migrated from https://github.com/dotnet/corefx/commit/ab6ec2fa803a330e73809cf478753959a36185e5
2016-01-28 15:51:39 -08:00
bartonjs a0da1541af Enable Client Auth Certs for Unix SslStream.
Pass the handle:

The Windows SslStream flow is to start a TLS session as server auth, then
process a CredentialsRequired during the handshake, add credentials to
the existing session, and continue.

It's hard to maintain symmetry on that flow for the Unix pathway, due to
the API differences in OpenSSL and SChannel.  So, the Unix session will
always pass down to native the provided client auth credentials, and
OpenSSL can use them when it sees appropriate.

Untrusted certificates should still complete handshake:

The Unix SslStream implementation had two different places that a client
authentication certificate was validated.  The first one was from an
OpenSSL callback, and reporting an error will interrupt the TLS handshake.
The second was from after the handshake, and presents the results to the
user validation callback to determine if data should be sent after the handshake.

In the ideal case the first version is redundant, in a user-handled case it caused
a failure when success was expected; so it should just be removed.

Enable the client authentication cert test for Unix:

Also asserts that the IsMutuallyAuthenticated property gets set, the certificates
used were the correct ones, and that both forward and callback versions of
providing the certificate function.


Commit migrated from https://github.com/dotnet/corefx/commit/908a129d5f32a6b5d2737d651445fdd38e1937ea
2016-01-28 15:36:59 -08:00
Jose Perez Rodriguez 0df7c31e39 Use .Net Core MSBuild for OS X and Linux Builds
Commit migrated from https://github.com/dotnet/corefx/commit/4367ec4c791928c6b2f994e9602dbc75aea7934d
2016-01-28 08:46:24 -08:00
Stephen Toub 75b957414f Merge pull request dotnet/corefx#5723 from stephentoub/update_license_headers
Update licensing headers

Commit migrated from https://github.com/dotnet/corefx/commit/ac67ffac987d0c27236c4a6cf1255c2bcbc7fe7d
2016-01-27 14:10:52 -08:00
stephentoub 9ecf277528 Update package versions to rc3-23727
Commit migrated from https://github.com/dotnet/corefx/commit/c442e611d1b4dddc12703b8b80bea9f3889f141d
2016-01-27 08:08:48 -08:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
Stephen Toub 8d935f132d Merge pull request dotnet/corefx#5717 from CIPop/removeCsProjTodo
Removing/updating TODOs from System.Net CSProj files

Commit migrated from https://github.com/dotnet/corefx/commit/7ed0277b10518c257a907815b08762a8f77fa43c
2016-01-26 21:59:57 -08:00
Lakshmi Priya Sekar 1aa7a9ac09 Update packages version to 23726.
Commit migrated from https://github.com/dotnet/corefx/commit/213da430524eceb9e90883c3d08848f62c813a91
2016-01-26 16:30:20 -08:00
Cristian Pop 643a78f92f Removing/updating TODOs from System.Net CSProj files
Commit migrated from https://github.com/dotnet/corefx/commit/2e7bd14c5e55ecda926977eef6d5717644783059
2016-01-26 16:15:32 -08:00
Stephen Toub d3bec923b6 Enable System.Net.Security tests on OS X
Commit migrated from https://github.com/dotnet/corefx/commit/b75bcefbae1f1a650224869773fb2bff650dbced
2016-01-25 22:37:01 -05:00
stephentoub 4ef1e70a8a Update package dependencies to rc3-23725
Commit migrated from https://github.com/dotnet/corefx/commit/fad28575225858febd3069d41582a1502c5dda07
2016-01-25 14:38:56 -05:00
stephentoub 6545572fb1 Upgrade packages to rc3-23722
Commit migrated from https://github.com/dotnet/corefx/commit/02ece5061a33a7c12113cc4a52b2321d9e6db185
2016-01-23 11:36:29 -05:00