Commit Graph
233 Commits
Author SHA1 Message Date
Eric St. John cb42aba990 Fixup typo in Net.Security project.json
This should be dotnet5.4.


Commit migrated from https://github.com/dotnet/corefx/commit/a99a9e2aca8ab5e2aa2f66473c5a527c73216672
2016-03-14 17:32:05 -07:00
Eric St. John 9ccdabca91 Fix generation of Net.Security
This was regressed by https://github.com/dotnet/corefx/commit/dotnet/corefx@be08afd9701053f5f9369762db58b87c8ca9559f


Commit migrated from https://github.com/dotnet/corefx/commit/6799e64e851721d2d3a4be09e9cb641494bfb437
2016-03-14 16:45:32 -07:00
Christopher Costa aab016344e Fat package conversions
Commit migrated from https://github.com/dotnet/corefx/commit/be08afd9701053f5f9369762db58b87c8ca9559f
2016-03-10 16:15:19 -08:00
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
stephentoub 4e4871961d Fix AsyncResult.AsyncState cast to ExceptionDispatchInfo
Commit migrated from https://github.com/dotnet/corefx/commit/ca30a2e963c9beb233d80d357589b88badd41e80
2016-03-09 09:20:42 -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
stephentoub 54c817496d Pass Exception through SecurityStatusPal in SslStream
There isn't a good mapping between OpenSSL errors and most of the errors in SecurityStatusPal.  As a result, with the current set up, important information about errors that occurred is getting lost and translated into meaningless information by the time it makes it out to the developer, making it difficult to diagnose the cause of a failure.

This commit allows the original exception behind a failure to be passed through the PAL layer, such that when an exception is eventually thrown, the Unix implementation can choose to use the original exception rather than translating the error code.


Commit migrated from https://github.com/dotnet/corefx/commit/c728b965bf9eea09ea1d3b06a2d70768d60c468e
2016-03-08 14:10:34 -05:00
Eric St. John f4d3d8121e Undo X509Certificates workarounds
Fixes https://github.com/dotnet/corefx/issues/6718

Previously NETStandard1.3 packages couldn't consume X509Certificates
due to a missing reference assembly.  That's been fixed so we can undo
the workarounds.


Commit migrated from https://github.com/dotnet/corefx/commit/13f225a650f40b5661cccc93985facb1b07f3786
2016-03-08 08:46:51 -08: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
Eric St. John 1e65a7ae4b Remove S.Runtime 4.1.0 workarounds
Previously we were incorrectly lifting InteropServices references to
4.1.0.0 in the packages  https://github.com/dotnet/corefx/pull/6648.

This caused an issue when consuming those packages since it would
cause a typeforward to System.Runtime and we weren't referencing
the version of System.Runtiem to satisfy the forward.  Now that I've
fixed the incorrect baselining we can remove the System.Runtime
workarounds.


Commit migrated from https://github.com/dotnet/corefx/commit/d2b7863243eca913cd52c1f860261a053af1655c
2016-03-07 13:00:48 -08:00
Eric St. John 65d3d63e3e Workaround no NETStandard1.3 support in X509 pkg
Switches from package to project reference for projects that consume
X509Certificates and target NETStandard1.3.  Package refefences were
added to other crypto contracts to satisfy the closure walk done during
target framework validation.

Remove all of this when fixing https://github.com/dotnet/corefx/issues/6718


Commit migrated from https://github.com/dotnet/corefx/commit/4c7720dee1897bddd69be267d84261530a136c87
2016-03-07 13:00:12 -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
Eric St. John 7c5ac76238 Add support for new Xamarin frameworks
The latest build tools contains framework lists for two new Xamarin fxs:
  Xamarin.TVOS
  Xamarin.WatchOS

This adds placeholders for those frameworks so that they can support
the packages with inbox facades.


Commit migrated from https://github.com/dotnet/corefx/commit/baf425fa935f4ecd32712448be627604067cf1d3
2016-02-29 14:43:27 -08:00
Eric St. John 19554adc35 Update buildtools and change validation framework
Update BuildTools to 1.0.25-prerelease-00180

Change validation framework moniker from dnxcore50 to
netstandardapp1.5.


Commit migrated from https://github.com/dotnet/corefx/commit/7c50768be0a2008480aa22ddb8038fdcb0e8039b
2016-02-29 14:43:26 -08:00
Eric St. John afdeaf78b0 Remove use of DNXCore from packages
This changes every package that used the DNXCore50 moniker to use a
NETStandard moniker instead.


Commit migrated from https://github.com/dotnet/corefx/commit/6008326984df7bddff751d0fec678ee29d821a59
2016-02-29 14:43:25 -08:00
Pallavi Taneja 3f93bc1c13 Fix packages issues due to the update
Commit migrated from https://github.com/dotnet/corefx/commit/9b8403541bfbd4b1956944723b68167ad12fbf29
2016-02-29 13:09:16 -08: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
Stephen Toub 2e68295803 Merge pull request dotnet/corefx#6379 from stephentoub/openssl_decrypt_fix
Fix Interop.OpenSsl.Decrypt to handle decompression

Commit migrated from https://github.com/dotnet/corefx/commit/50238720efe40a8114bac9f83e02f89708f802f3
2016-02-24 21:39:59 -05: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
Eric St. John 5af200cd50 Rename "dotnet" to "NETStandard"
Fixes https://github.com/dotnet/corefx/issues/5707

We are changing the .NET packages to no longer use the ‘dotnet’, ‘dotnet5.x’, and ‘dnxcore50’ monikers.  This is thee first stage of the change for dotnet->netstandard.

The replacements are as follows

Old moniker | New moniker
----------------- | ------------------
dotnet5.x | netstandard1.y  (where y = x -1)
DNXCore50 | netstandardapp1.5
dotnet | netstandard1.3

To prepare for this change you can do the following to your project.json.  This change will require a recent build of NuGet or dotnet.exe and can be done prior to consuming the packages with the breaking change.  These packages will not work with DNX.

For a project targeting dotnet5.6
```
    "frameworks": {
        "netstandard1.5": {
            "imports": [ "dotnet5.6" ]
        }
    },
```

For a project targeting dnxcore50
```
    "frameworks": {
        "netstandardapp1.5": {
            "imports": [ "dnxcore50", "portable-net45+win8" ]
        }
    },
```

[tfs-changeset: 1578321]


Commit migrated from https://github.com/dotnet/corefx/commit/4435f9f2776ae007e05f4454675e56cf76a51975
2016-02-23 20:18:17 -08:00
Eric Mellino 803de07923 Consolidate all facade projects, cleanup project files
* Move all of the project configurations currently living in the
  "facade\<lib>.csproj" files into the root library project. This means
  there will now be only one project file for the source build of each
  library, regardless of how many configurations it has. The .builds file
  of each library will only reference that single project file multiple
  times.

* Do some minor cleanup of project files along the way. Fix up the VS
  default configuration blocks to be a bit more uniform. Remove redundant
  defaults (OutputType, PlatformTarget, etc. Fix some condition spacing.


Commit migrated from https://github.com/dotnet/corefx/commit/26edfd6839044ca6368e28502e0893c1b1819b4c
2016-02-22 11:11:10 -08:00
Christopher Costa b7275a6e29 Merge branch 'master' of https://github.com/dotnet/corefx into open_pkgs
Commit migrated from https://github.com/dotnet/corefx/commit/7df55caaad1d1e21866ec31b0e7161db9ae2179c
2016-02-19 14:21:24 -08: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
dotnet-bot 3184718282 Deploy nameof throughout corefx in exception construction
Mostly automated replacement of parameter name string literals with corresponding usage of nameof.


Commit migrated from https://github.com/dotnet/corefx/commit/396b41ddec99d01505c1bc4fa02fb0f0c5844990
2016-02-18 23:58:06 -05:00
Christopher Costa d95b14a3c4 Merge branch 'master' of https://github.com/dotnet/corefx into open_pkgs
Commit migrated from https://github.com/dotnet/corefx/commit/b70432898b7a00edb3303c0fbf4a1b98ebe442b4
2016-02-18 10:28:54 -08: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
Christopher Costa 23ac6d7e8d Merge branch 'master' of https://github.com/dotnet/corefx into open_pkgs
Commit migrated from https://github.com/dotnet/corefx/commit/ddcd78f8f2ccd3debefefb5e10164d7a038bb7e0
2016-02-17 10:46:00 -08: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
Christopher Costa 1df6eaae43 Open package conversions for corefx.
Commit migrated from https://github.com/dotnet/corefx/commit/030e29992f6be20ffb9d9d3e799118f3354bce22
2016-02-11 13:37:45 -08:00
stephentoub 685d9f5063 Add API review headers to ref files
Commit migrated from https://github.com/dotnet/corefx/commit/5240b324e50f9aabaa11d4b0c46acc34e370a724
2016-02-11 10:50:44 -05:00
Stephen Toub f581539eca Merge pull request dotnet/corefx#6016 from stephentoub/remove_cctors
Remove ~20 explicit static cctors across corefx

Commit migrated from https://github.com/dotnet/corefx/commit/11efc0d43d56e1c280653934b27ae5c1ef05af8c
2016-02-11 08:48:15 -05:00
stephentoub 0dc4f0e58f Remove a handful of explicit static cctors across corefx
Explicit static cctors cause the C# compiler to not mark types as beforefieldinit, which in turn means that the backend compiler needs to add checks to static methods to ensure that the type has been initialized.  We have a bunch of such cctors across corefx that can be easily removed; this commit does so.  In a few places, it also presizes some collections to help avoid unnecessary memory pressure.


Commit migrated from https://github.com/dotnet/corefx/commit/79ae21b1b9a113230da7ebfbffa4e3c3fe36f0ac
2016-02-11 07:59:21 -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