Commit Graph
80 Commits
Author SHA1 Message Date
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
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
Shruti Garg b507a30c63 Updating SSLConnectionInfo with correct protocol version and Cipher algorithms
Commit migrated from https://github.com/dotnet/corefx/commit/8c45619b6c1101f80662717493d525dd7545dc75
2015-10-15 12:22:37 +05:30
Eric Erhardt 8107d387ab Adding shims for all Interop.Pkcs7 methods.
I also moved the existing GetPkcs7Certificates method from Interop.Crypto to Interop.Pkcs7, so System.Net.Security didn't need to include all the Pkcs7 files, which it doesn't use.


Commit migrated from https://github.com/dotnet/corefx/commit/690dc858675b726bbfd281b6dedd4a26ead975f0
2015-10-14 22:07:00 -05:00
Cristian Pop 02282010cd Adding original SSPI object model back to the Windows SslStream implementation.
Commit migrated from https://github.com/dotnet/corefx/commit/863ae5dfcc36b66a599c6b022a88b02046b0d8a4
2015-10-14 14:36:57 -07:00
Eric Erhardt 86057bd3af Shim X509Ext methods.
Adding shims for all methods in Interop.X509Ext.cs.

I also moved the decoding of X509 Basic Constraints into native code
so we don't have to marshal structs from native to managed.
This also saves on a few native calls.

I refactored some Basic Constraints tests to use a Theory, and split
the test into 2 - encoding and decoding. Encoding doesn't work on
Unix yet, so this allows the decoding test to run.


Commit migrated from https://github.com/dotnet/corefx/commit/460541583baed4e9f17d648eda42fe6631af7199
2015-10-14 14:02:31 -05:00
bartonjs 7e83dd9434 Implement RFC2812 IP Address matching for HTTP over TLS.
If the hostname looks like an IP Address then do exact matches against GEN_IPADDR Subject Alternative Name entries.  Unlike the GEN_DNS matching of text hostnames, the IP Address form always falls back to the CN text comparison if no other match has been found.


Commit migrated from https://github.com/dotnet/corefx/commit/b8ad721e56d09fc16016a8a961938be30aa7a114
2015-10-13 21:43:20 -07:00
Eric Erhardt 275ec1d52c Shim Interop.Bignum and Interop.BIO methods.
Commit migrated from https://github.com/dotnet/corefx/commit/9d0a7495cb4d820194d5baf7593539823ee5a120
2015-10-13 14:43:30 -05:00
Stephen Toub 85b49a74d6 Merge pull request dotnet/corefx#3801 from bartonjs/fixlocks
Update the project.lock.json files which were invalidating all locks

Commit migrated from https://github.com/dotnet/corefx/commit/1b732fd7225ed3f05a9fbf146376319213ec2e71
2015-10-13 08:12:12 -04:00
Rajan Singh 522a70642b Merge pull request dotnet/corefx#3742 from rajansingh10/Netfeature
Fixed consecutive SSL stream write issue in System.Net.Security, introduced by PRdotnet/corefx#3675

Commit migrated from https://github.com/dotnet/corefx/commit/b552a644c1c1ca107f795de15cecfe3d5edfacd4
2015-10-13 12:01:26 +05:30
Rajan Singh 385a6580be Fixed second write issue, introduced by PRdotnet/corefx#3675
Commit migrated from https://github.com/dotnet/corefx/commit/5a37b66d98464dba2aca5fe73b5ece2051837b83
2015-10-13 11:31:03 +05:30
bartonjs 17a6ccbb96 Update the project.lock.json files which were invalidating all locks
Commit migrated from https://github.com/dotnet/corefx/commit/460f7ff5241aa6575bb0742dc1c12a7ad4bba38c
2015-10-12 21:58:06 -07:00
dotnet-bot f04559d358 Adding NegotiateStream contract and a temporary no-op implementation within both System.Private.Networking and System.Net.Security within the Open partition.
[tfs-changeset: 1536739]


Commit migrated from https://github.com/dotnet/corefx/commit/a8e001d3bedad956fa36f535162577a0c1260905
2015-10-12 12:42:59 -07:00
Cristian Pop e7db69fe6f Merge pull request dotnet/corefx#3768 from CIPop/SNSecurityPalPR
Refactoring System.Net.Security PAL

Commit migrated from https://github.com/dotnet/corefx/commit/297c9895a886e95073f5244d6346423b586394c6
2015-10-12 12:33:49 -07:00
Stephen Toub 23a29b45cf Merge pull request dotnet/corefx#3756 from eerhardt/ShimEncoding
Shim ASN1 native calls to OpenSSL.

Commit migrated from https://github.com/dotnet/corefx/commit/eefccc4926db57cb48679cc425089dd9974bc33f
2015-10-12 15:09:43 -04:00
Cristian Pop d7d8e98cfc Refactoring SslStreamPal.
Commit migrated from https://github.com/dotnet/corefx/commit/b30a71bfd0919c2d69fedbe3e2139331c5110ae1
2015-10-12 11:09:29 -07:00
stephentoub ba9fea449f Reorganize src\Common\tests
Our common tests folder has gotten a bit unwieldy in its organization.  This change simply moves files around to better map to how src\Common\src is organized.  Files are now stored in a path based on functionality/namespace.

I mostly kept groups of functionality together and did not attempt to reorganize at that level, e.g. I moved the src\Common\tests\System.Xml.XPath\ folder to be src\Common\tests\System\Xml\XPath\ and did not further reorganize all of the folders/files it contains.  Such cleanup can be done separately on each individual area.

Some of the files also need to be cleaned up internally, e.g. the namespace (or lack thereof), so I put such things in a path that I thought made sense even if it differs from the current namespace in the file; I wanted this change to be relatively simple and just be about moving files around to clean up the main hierarchy.


Commit migrated from https://github.com/dotnet/corefx/commit/9a5546c439f7700d3462564678aa4206c7fbf4f1
2015-10-11 15:44:39 -04:00
Eric Erhardt b5313689e1 Shim ASN1 native calls to OpenSSL.
Added shims for all native calls in Interop.ASN1.cs.


Commit migrated from https://github.com/dotnet/corefx/commit/2988ead97f043f01213dc1097b2c9f6a0697493b
2015-10-09 15:12:20 -05:00
bartonjs 6b589bb44e Implement GetRequestCertificateAuthorities for the Unix PAL
Commit migrated from https://github.com/dotnet/corefx/commit/63b05c3daa624e166fe5b18de5f8e52b5c007f28
2015-10-09 07:43:56 -07:00
bartonjs 3e88a2d903 Create SafeInteriorHandle from SafeSharedX509StackHandle.
Extract the parent tracking logic to a base class to enable the generation of more SafeShared*Handle types without having to duplicate the logic.


Commit migrated from https://github.com/dotnet/corefx/commit/0d84ed5d7597ad29e3deddaf333b57736f5977de
2015-10-08 18:32:57 -07:00
Josh Free edbc673ff7 Merge pull request dotnet/corefx#3732 from dotnet-bot/from-tfs
Merge changes from TFS

Commit migrated from https://github.com/dotnet/corefx/commit/63155e1050ba52113699a41d5eabec4c2f9e8073
2015-10-08 16:22:18 -07:00
Christopher Costa 481a584fa6 XPlat packaging for System.Net.Security
[tfs-changeset: 1535271]


Commit migrated from https://github.com/dotnet/corefx/commit/01d8922dc2bb8ad79ec96c05e08a6aec2205a989
2015-10-08 14:37:26 -07:00
Eric Erhardt 239b75503f Shim OpenSSL ERR* methods.
Adding shims for all OpenSSL methods in Interop.ERR.cs.


Commit migrated from https://github.com/dotnet/corefx/commit/5b85112a9cc9c4b7338ed9eb8d718c50e22ebe99
2015-10-08 11:03:01 -05:00
Rajan Singh 63e6f5ae95 Added exception messages to *.resx file. using Debug.Fail wherever applicable. Fixed GetException.
Commit migrated from https://github.com/dotnet/corefx/commit/23e8c33df8557ff4cb16939f272f63d5ec99dffb
2015-10-08 15:19:49 +05:30
Jeremy Barton 34e48bdc05 Merge pull request dotnet/corefx#3678 from bartonjs/unix_sslstream_openstore
Implement EnsureStoreOpened for the Unix PAL

Commit migrated from https://github.com/dotnet/corefx/commit/bf803ccab28fd70a94a98f837bb15f12632fa8ef
2015-10-07 08:44:12 -07:00
bartonjs ef29a06944 Implement EnsureStoreOpened for the Unix PAL
Commit migrated from https://github.com/dotnet/corefx/commit/cf47694b707097d5fd0032a11f97b4f29a5a040a
2015-10-07 08:01:11 -07:00
Vijay Kota 11b5b17c1a Using SafeHandles instead of IntPtrs in Interop.libssl
- Also fixed an issue with handling of return code in Encrypt logic


Commit migrated from https://github.com/dotnet/corefx/commit/860c76acd11bbf123029ed270c594a874dc7a900
2015-10-07 18:32:02 +05:30
Pat Gavlin 490ac2340b Remove dead code from S.N.{Security,Sockets}.
Commit migrated from https://github.com/dotnet/corefx/commit/20720d890fe016a4934e7215d22cf35e7c1224b3
2015-10-06 14:48:44 -07:00
Stephen Toub 5dcc145481 Merge pull request dotnet/corefx#3638 from rajansingh10/NetFeature2
Fixed Renegotiate & sslV3 issue in System.Net.Security xplat. Made op…

Commit migrated from https://github.com/dotnet/corefx/commit/09a5343cfd6621669ad645bc786d0225ae8336c2
2015-10-06 17:15:22 -04:00
Rajan Singh 2e970dd7eb Fixed Renegotiate & sslV3 issue in System.Net.Security xplat. Made openSSL method initialization static.
Commit migrated from https://github.com/dotnet/corefx/commit/357db0467e6a635a1ddacab29925cf75a67c791d
2015-10-06 09:23:19 +05:30
dotnet-bot dfa25896ef Porting System.Net.NetworkInformation and System.Net.Utility to GitHub.
Completing dotnet/corefx#894


Commit migrated from https://github.com/dotnet/corefx/commit/5a67678925c2f2731fdb55eb3c88a287149e8db4
2015-10-05 17:24:18 -07:00
Stephen A. Imhoff 9f6e31a883 Remove custom error checking from System.Net.Security, per dotnet/corefx#516 .
- Remove .nuget.props for test project.


Commit migrated from https://github.com/dotnet/corefx/commit/9d7a7bdb5b56c33e48da1986be02e6b63c6360ee
2015-10-03 10:26:18 +09:00
Ian Hays 0f8197a86c Update CoreFX to xunit 2.1.0
Commit migrated from https://github.com/dotnet/corefx/commit/87b48c58936d66fcb201b3a8ad0961fa055f23b9
2015-10-01 19:56:49 -07:00
Stephen Toub aa9dffdb12 Merge pull request dotnet/corefx#3553 from bartonjs/sslstream_extrastore
Extract the whole cert chain during SSL handshake.

Commit migrated from https://github.com/dotnet/corefx/commit/94d289bb34834761be5480ee45f6e0199d5d7662
2015-10-01 08:45:12 -04:00
bartonjs a9d8f18565 Extract the whole cert chain during SSL handshake.
When the server sends the whole cert chain, extract the elements after the leaf/EE certificate to be passed into X509Chain.ChainPolicy.ExtraStore; this will prevent failures due to unknown intermediate CAs (and may also prevent the need to download that intermediate).


Commit migrated from https://github.com/dotnet/corefx/commit/69b872484086379160ea03bcfe8fa55fbeaec0db
2015-09-30 08:48:40 -07:00