Commit Graph
113 Commits
Author SHA1 Message Date
Cristian Pop 086583dcad Updating and locking project.lock.json for Security UnitTests.
Commit migrated from https://github.com/dotnet/corefx/commit/570536ed5ae5c6b136b9a100ba6983eceaf17320
2015-12-01 11:54:28 -08:00
Hemanth Kapila 56a3abf10b Use libcurl+openssl to support TLS client certs
Make curlHandler support Client Certificates when the linked libcurl's
ssl backend is compatible with openssl. CurlHandler is also updated to
support ChannelBindingToken


Commit migrated from https://github.com/dotnet/corefx/commit/d3be6bbe9aee8f748f2688fb7bb00c577ac4b11e
2015-11-19 22:31:20 +05:30
Stephen Toub c90af416d3 Merge pull request dotnet/corefx#4495 from bartonjs/unix_sslstream_idna
Support IDNA host matching on Unix SslStream

Commit migrated from https://github.com/dotnet/corefx/commit/dc25e27e1349afaff2d5bf39c8f9f0d56cb16529
2015-11-16 18:28:43 -05:00
Cristian Pop 40dcf58810 Removing SSLv2 and SSLv3 support from System.Net.Security.
APIs will throw NotSupportedException if SSLv2 or v3 is used. This
behavior is different from .NET Desktop.
Tests have been changed to pin this new behavior.
Increased passing-test timeouts to 15s.

Fix dotnet/corefx#3114 (partial), dotnet/corefx#4467


Commit migrated from https://github.com/dotnet/corefx/commit/1f4deea8946d2e54dfd3c88e64c85bc3c3d9805c
2015-11-16 11:26:00 -08:00
stephentoub ab1f4c8fe8 Disable three System.Net.Security tests that repeatedly timeout
Commit migrated from https://github.com/dotnet/corefx/commit/59c9f299fba30a2ac3ca328d3013c70ca28bb1f5
2015-11-15 19:26:25 -05:00
Page-Not-Found 13eab7cbdf PR Comments changes.
Commit migrated from https://github.com/dotnet/corefx/commit/ab8fb5531134b4018b09d45040f334d2dcfdda54
2015-11-13 21:09:49 -05:00
bartonjs a23c5b7312 Support IDNA host matching on Unix SslStream
* Split the Unix and Windows project.json files for System.Net.Security since they have different dependencies at the implementation level.
* Use the managed IdnMapping to do the IDNA rules application
* Update comments in the native half of the match logic

This was verified against a private domain which uses a mix of ASCII and non-ASCII characters.
* Lowercase punycode form: Success before, success after
* Mixed-case punycode form: Failed before, success after
* Unicode form: Failed before, success after.


Commit migrated from https://github.com/dotnet/corefx/commit/d573223a0d99d41daf8ed26fa89647894a9770da
2015-11-13 08:24:20 -08:00
Page-Not-Found 9a903bf94a System.Net.Security File Renames
System.Net.Security File Renames


Commit migrated from https://github.com/dotnet/corefx/commit/db3748dd3f24b30f4d869c42886bb12e6bdac3a6
2015-11-11 16:00:34 -05:00
Page-Not-Found 835ffb1436 Commonfolder rename and __Error, __HResult
Commonfolder rename and __Error, __HResult


Commit migrated from https://github.com/dotnet/corefx/commit/0a1a2a024797091a645ea42561441fcd8586525c
2015-11-11 15:45:12 -05:00
Cristian Pop a0e0cfd64f Fixing code and removing the X509Store shim. Adding new tests and
changing the certificate used to allow end to end tests with valid
certificate chains.


Commit migrated from https://github.com/dotnet/corefx/commit/d2d810a2971fc56b55fc192e64038e8b4fa0c568
2015-11-10 17:16:41 -08:00
Eric St. John 692d33d3ce Add back more missing dependencies
Build on the CI is complaining about missing base types for many
reference assemblies (where we only pass the compiler direct
references, trimming transitive dependencies).

Additionally I removed the test data packages from some tests
because, of course, they were not directly referenced :).


Commit migrated from https://github.com/dotnet/corefx/commit/3348234db28a1c186f0bab9b0437bc48a81d0ad2
2015-11-10 08:04:44 -08:00
Eric St. John 65210efd31 Update project.lock.json to latest and lock
Commit migrated from https://github.com/dotnet/corefx/commit/6aeea5eabf2aff3baf15f501cabd156dfc5b3f8f
2015-11-09 22:38:10 -08:00
Eric St. John cddddd29f5 Remove unused dependencies
Commit migrated from https://github.com/dotnet/corefx/commit/78fd45ec74afc507a40df519b4df650ac9bd4c42
2015-11-09 22:37:37 -08:00
Stephen Toub ac0ca101f1 Merge pull request dotnet/corefx#4369 from stephentoub/delete_test_code
Delete SslStreamAPMExtensions.cs from System.Net.Security tests

Commit migrated from https://github.com/dotnet/corefx/commit/db143451ee06709c9aee7e865fb685afda90c68d
2015-11-06 11:00:03 -08:00
Shruti Garg 0390074a73 Fixing System.Net.Security test failures in OS X
Commit migrated from https://github.com/dotnet/corefx/commit/15b2d692c05619da3350d5f0ed2a26002ea6c646
2015-11-06 17:39:48 +05:30
stephentoub bf69c04cca Delete SslStreamAPMExtensions.cs from System.Net.Security tests
After https://github.com/dotnet/corefx/pull/4331, it's now dead code.


Commit migrated from https://github.com/dotnet/corefx/commit/0a2c023520bb890c5de8cc16b4391515e8b99c3a
2015-11-05 21:58:31 -08:00
stephentoub 0bb85f778a Fix 43 of the 44 failing System.Net.Security tests on Linux
- System.Net.Sockets removed a bunch of APIs.  They're somehow still in the contracts, so compilation succeeds, but they're not implementation, so the tests fail when trying to use methods like TcpClient.Connect and various Begin/End methods.  I've changed these to use the appropriate Async methods.
- SslStream has a Debug.Fail which has been failing regularly, but it wasn't being noticed.  Now that Debug.Fail will throw an exception, the tests that were previously asserting are now failing.  I've temporarily commented out the Debug.Fail with a TODO comment.

One test is still failing:
```
System.Net.Security.Tests.ClientAsyncAuthenticateTest.ClientAsyncAuthenticate_MismatchProtocols_Ssl2_Fails_Linux(server: Ssl2, client: Tls11, expected: typeof(System.Security.Authentication.AuthenticationException)) [FAIL]
      Assert.Throws() Failure
      Expected: typeof(System.Security.Authentication.AuthenticationException)
      Actual:   typeof(System.InvalidOperationException): EndAuthenticate can only be called once for each asynchronous operation.
      Stack Trace:
            at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
            at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
```


Commit migrated from https://github.com/dotnet/corefx/commit/c0aab82ea70453324f5e7d51902a0e1bb40db365
2015-11-04 21:31:26 -08:00
stephentoub 9e759283de Disable System.Net.Security tests on Unix
Commit migrated from https://github.com/dotnet/corefx/commit/13011914b9c9a8db574bd8562c3dab1691f300bc
2015-11-04 16:38:49 -08:00
shrutigarg 501a733bc8 Merge pull request dotnet/corefx#4262 from shrutigarg/ssl_TODO
Remove obsolete TODOs from xplat SslStream code

Commit migrated from https://github.com/dotnet/corefx/commit/5760b84a25fe007a2360d936736de3e2fb68f32a
2015-11-04 17:19:02 +05:30
Shruti Garg 94e521f0e4 Remove obsolete TODOs from xplat SslStream code
Commit migrated from https://github.com/dotnet/corefx/commit/2dc86c42cf97db170408c2cbdc4bda24a9be9d42
2015-11-04 16:22:29 +05:30
Cristian Pop 850e94bf69 Merge pull request dotnet/corefx#4297 from shrutigarg/ssl_test3
Fix FakeNetworkStream to remove direct Fix DoNetworkRead() use

Commit migrated from https://github.com/dotnet/corefx/commit/1c534a2a53e5b14264a9faaf252c43f434ff186f
2015-11-03 10:01:01 -08:00
Shruti Garg 4df32ccf77 Fix FakeNetwrokStream to remove direct Fix DoNetworkRead() use
Commit migrated from https://github.com/dotnet/corefx/commit/f144876d84fbfee06f4ad174d0c88944eb70eb47
2015-11-03 18:43:23 +05:30
Shruti Garg a53e0f5f6d Enabling ChannelBinding testcase in Unix
Commit migrated from https://github.com/dotnet/corefx/commit/7e8517315ffd7138e4c645df110a311a0124d0bb
2015-11-03 12:57:52 +05:30
shrutigarg 59668f5440 Merge pull request dotnet/corefx#4263 from shrutigarg/ssl_test1
Enabling System.Net.Security tests in Linux

Commit migrated from https://github.com/dotnet/corefx/commit/2e518000a747b758cdae8c2f8d48eb0a823ebcb3
2015-11-03 12:42:33 +05:30
Shruti Garg 23247f146b Resolved review comments
Commit migrated from https://github.com/dotnet/corefx/commit/2503efd50ecff681887246f6f2de8a20c1e6469a
2015-11-02 14:42:35 +05:30
Rajan Singh 860aeeab26 Added Support for GetChannelBinding() in xplat
Commit migrated from https://github.com/dotnet/corefx/commit/157e83aa4cd6511889f7075dc8400818de008048
2015-11-02 09:29:46 +05:30
Shruti Garg 70d782ce24 Enabling System.Net.Security tests in Linux
Commit migrated from https://github.com/dotnet/corefx/commit/a450fde974f7ff4514505b5b953af6deadae51ff
2015-10-30 15:47:37 +05:30
Shruti Garg cdc621a851 Populate DataHash key size in SslConnectionInfo
Commit migrated from https://github.com/dotnet/corefx/commit/86dec922c45391762b29c1da1563633cfb02f05a
2015-10-29 12:06:16 +05:30
bartonjs f6d49e5b0c Extract SslCtx methods for better sharing
Commit migrated from https://github.com/dotnet/corefx/commit/f3197d731d66b14cf2c87ebb643dd2bde44220e5
2015-10-27 08:08:40 -07:00
bartonjs 3ba0c1f90b Extract X509Stack and X509StoreCtx methods for better sharing
Commit migrated from https://github.com/dotnet/corefx/commit/2d2324bd8179c3fe7e597eefc356836da35ed8bf
2015-10-27 08:08:38 -07:00
Cristian Pop 85b69993cc Increasing test timeout for System.Net.Security (SslStream).
Fix dotnet/corefx#3845


Commit migrated from https://github.com/dotnet/corefx/commit/9a5712441b9d7eea761a57f6159bd5c00dbf081d
2015-10-26 16:56:31 -07:00
Eric Erhardt ae2f4b323d Merge pull request dotnet/corefx#4088 from eerhardt/LibSsl
Add shims for the remaining libssl methods.

Commit migrated from https://github.com/dotnet/corefx/commit/60efb9cabdf1101506282d6bbc9f888859bbdd7f
2015-10-23 16:36:37 -05:00
stephentoub d8da5edb5f Disable sporadically failing SslStream test
The timeout may simply need to be increased. For now, disabling. as it's failed several times.

dotnet/corefx#3845


Commit migrated from https://github.com/dotnet/corefx/commit/207fb12d26edc3b19ad888fe469a16116dfe6a26
2015-10-23 00:36:02 -04:00
Eric Erhardt b9a7803959 Add shims for the remaining libssl methods.
This change completely removes all managed code direct dependencies on libssl.
Instead, all calls are now invoked through our native shims.


Commit migrated from https://github.com/dotnet/corefx/commit/9ff5207e5114791836d3dfb0baeba513cf6bec74
2015-10-22 18:48:01 -05:00
Matt Ellis f23deed6ba Merge 'upstream/master' into from-tfs
Conflicts:
	src/Common/test-runtime/project.lock.json
	src/System.Reflection.TypeExtensions/src/project.json
	src/System.Reflection.TypeExtensions/src/project.lock.json


Commit migrated from https://github.com/dotnet/corefx/commit/262aebcb35b4e0b09b1e08d37cdd70de3fb092e8
2015-10-22 13:15:56 -07:00
Eric St. John 8cc3c24b51 Update lock files that were missed in previous restore.
A change was made to DNX to no longer restore project.jsons
that are in nested folders.  This caused my batch update to miss
a number of tests and reference assembly projects.

This fixes the stale lock files, but restore is still broken.

[tfs-changeset: 1540448]


Commit migrated from https://github.com/dotnet/corefx/commit/3622cccc1b22fa1947a72d5126b59864e9d2fd0d
2015-10-21 18:59:09 -07:00
Eric St. John 543808303a Update dnx to v1.0.0-rc1-15838, update dotnet projects to generations
We need a new DNX to understand the latest packages.

We also need to move all "dotnet" projects to use dotnetX.X (generations)
now that the packages no longer have "dotnet" assets.

The new version of DNX dropped support for the aspnetcore
so I needed to update a few projects/packages that depended
on old package versions that had this moniker.

[tfs-changeset: 1540388]


Commit migrated from https://github.com/dotnet/corefx/commit/38f8d7a3ca1ee819c2b8eabb1c07ee4e99683c97
2015-10-21 17:03:48 -07:00
Eric Erhardt 16c415a7a6 Rebase and respond to PR feedback.
Commit migrated from https://github.com/dotnet/corefx/commit/dc637b76523eac289bfddd854adca3117ca349ef
2015-10-21 16:17:24 -05:00
Eric Erhardt be2b75ffff Move SSL_CIPHER struct usage into native shim.
Instead of having managed code duplicate the SSL_CIPHER struct, moving all the code that uses the cipher struct into a native shim method.

That also pulled a lot of algorithm constants to be defined in native instead of managed.


Commit migrated from https://github.com/dotnet/corefx/commit/30c98cc053bcdd0f7aef556bbe203ada1b9f23a2
2015-10-21 15:56:34 -05:00
Eric Erhardt 601c368060 Add shims for the next set of SSL interop methods.
I also moved the SSL SafeHandle classes out of the Interop class to be
better aligned with the rest of the SafeHandles.


Commit migrated from https://github.com/dotnet/corefx/commit/d3939b58a14ec991b5c27939f6003f263b1ae138
2015-10-21 15:56:02 -05:00
Eric Erhardt 51ca2df2bb Clean up current libssl shim work.
There are a number of clean up tasks that came out of the first 2 rounds of libssl shim work.

1. Add some Debug.Asserts when reading/writing to buffers.
2. Split the SSL extern methods into a separate class from the Interop.Crypto class. This allows the minimum amount of intialization to occur as needed. It also better keeps libssl separate from libcrypto shims.
3. Use a configure.cmake and #cmakedefine01 feature in our CMake file to create defines. This is consistent with CoreCLR and the other of CoreFX shims.


Commit migrated from https://github.com/dotnet/corefx/commit/61bcd097aade191538cabe4cbc13b6c8bc0c3ea3
2015-10-21 13:25:16 -05:00
Eric Erhardt a76d163f73 Merge pull request dotnet/corefx#3979 from eerhardt/ShimLibSsl
1st shims for the LibSsl library.

Commit migrated from https://github.com/dotnet/corefx/commit/bdc6c8ff8e32890d5f6a9e95f92e6b4427fdc6d7
2015-10-21 00:42:15 -05:00
Eric Erhardt a5d257f1f2 Fixing build break on OSX by adding feature checks for the unsupported TLS methods on OSX.
Adding a decent exception message when SSL methods are not available.

Also responded to PR feedback by using an unsafe code block instead of the whole method being marked as unsafe.


Commit migrated from https://github.com/dotnet/corefx/commit/4fc85158a399ffb78bfc51907d5cd7a6a2fc5b05
2015-10-20 14:38:59 -05:00
bartonjs 293ecb216f Add support for ECDSA certificates on Unix SslStream.
Now the code tries RSA, falls back to ECDSA, then throws (vs asserting).

DSA, Diffie-Hellman, ECDH, etc, are the things that will throw, because we have no support for them in CoreFX (as of this time).


Commit migrated from https://github.com/dotnet/corefx/commit/3651e62baf07ee79557d4a62333357737e25346a
2015-10-20 10:54:46 -07:00
bartonjs a768025131 Update all project.lock.json files
Built Windows_NT, Linux, OSX with /p:LockDependencies=true.

CoreFX beta-* => 23419
xunit.netcore.extensions => 00107


Commit migrated from https://github.com/dotnet/corefx/commit/a14b22705df253508bd5f2dab0407bd2c7e4d639
2015-10-19 16:00:44 -07:00
Eric Erhardt 7f9fd5f34a 1st shims for the LibSsl library.
I added shims the first 8 libssl functions and did a little clean up.
- Put all Interop files under "Common\Interop" in System.Net.Security.
- Removed some unused fields from StreamSizes.
- Changed some unnecessary IntPtr usages to byte[] or byte*, where appropriate.


Commit migrated from https://github.com/dotnet/corefx/commit/cc364e67c841c4c7d49eeac87ae6f0feef412748
2015-10-19 17:44:52 -05:00
Eric St. John 8cd3109d56 Switch from using "dotnet" to using "dotnet<generation>"
All projects that previously used dotnet have been updated to specify the appropriate generation of the surface area they depend on or in the case of desktop inbox contracts, the generation that includes the set of platforms they can support.

Now all packages contain all generations of API that they have ever shipped.

In doing this I needed to change how we determine package version.  Before we ensured all assemblies would have the same version and used that.  Now we choose the max.

Additionally I needed to change how we chose which asset to use for netcore50 when the dotnet asset was obscured by a placeholder for a previous netcore release (eg System.Runtime will have placeholders for Win8 since it was inbox there).  To do this I wrote a task that uses nuget to evaluate the package assets with and without the placeholders.  In this way it chooses the "best" dotnet implementation and reference assembly to use for netcore50.

This new model made my old MSBuild-based validation impossible to carry forward, so I wrote better validation in a task that actually uses Nuget's asset resolution algorithm.  This uncovered many existing issues in packages that I have cleaned up.  The validation algorithm could use some polish but its working now.  Perf is not great, package build went from 15s to ~2 minutes.  I'll work on this some more by making it incremental (input: nuspec, output: marker created on success).  Profiling shows that most of the time is spent in calling the nuget APIs.  I'll see if I can reduce some of this with caching for things that don't change (eg: RID graph).  Ultimately I think its a reasonable tradeoff for the types of bugs I can find this way.

[tfs-changeset: 1539216]


Commit migrated from https://github.com/dotnet/corefx/commit/0931c347eb836c9da94d0d5ff9ad7a14403b9738
2015-10-18 21:12:23 -07:00
Eric Erhardt a93bd01f95 Add shims for all Interop.X509 methods.
I was able to remove all manage code dependencies on OpenSSL
constants, except for X509VerifyStatusCode, which I made static_assert
checks to ensure we are in sync with openssl's values.


Commit migrated from https://github.com/dotnet/corefx/commit/6c4956feef3e3e672906469dcf87bb68adecca39
2015-10-16 15:49:06 -05:00
Shruti Garg d4efbb308f Adding client cert validation logic and usage of EncryptionPolicy
Commit migrated from https://github.com/dotnet/corefx/commit/f7dfadba8e9372f1e960c273a4a31ab17e244d76
2015-10-17 00:04:26 +05:30
Eric Erhardt b858dede7a Merge pull request dotnet/corefx#3870 from eerhardt/ShimPcks
Shim Interop.Pkcs* methods

Commit migrated from https://github.com/dotnet/corefx/commit/48158afa12a7d290e09141f110809f36aca473ec
2015-10-15 18:38:07 -05:00