Commit Graph
168 Commits
Author SHA1 Message Date
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
Cristian Pop 6247a71128 Merge pull request dotnet/corefx#5642 from CIPop/snsasserts1
Fixing assert conditions for System.Net.Security.

Commit migrated from https://github.com/dotnet/corefx/commit/fab477215a4ce42f0364a4f67244333ef7483310
2016-01-25 10:40:01 -08: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
Cristian Pop 7b2e6bafc7 Fixing assert conditions for System.Net.Security.
Commit migrated from https://github.com/dotnet/corefx/commit/1baa844d3a12a5fc225e4c3408726ed917f3cb6e
2016-01-22 17:59:39 -08:00
Cristian Pop 2c567ee8a4 Merge pull request dotnet/corefx#5541 from CIPop/snsrw
Porting async implementation and adding TPL overrides for SslStream Read/WriteAsync

Commit migrated from https://github.com/dotnet/corefx/commit/fac18d8b452438f476b2976c2b7809b677521208
2016-01-22 10:35:12 -08:00
Cristian Pop 4762440ff6 Porting APM functionality for SslStream's InnerStream. Adding TPL wrappers and a simple test proposed by the community.
Commit migrated from https://github.com/dotnet/corefx/commit/aa2e8a7f31077d1787027cd851b88f6a29e126e5
2016-01-21 17:02:05 -08:00
stephentoub f9329ef695 Disable tests failing on CentOS or OpenSUSE
Commit migrated from https://github.com/dotnet/corefx/commit/24dba75503899e794ffde2cf07a4ada57f22072a
2016-01-21 18:29:05 -05:00
stephentoub 0fbf6b8716 Re-enable System.Net.Security tests on Linux
Commit migrated from https://github.com/dotnet/corefx/commit/20199b506c8b1e624de69245ed9fa5b04628178e
2016-01-21 18:29:05 -05:00
stephentoub 891c3cd484 Fix clientCertificateRequired handling
The design of AuthenticateAsServerAsync has a clientCertificatesRequired flag.  On Unix we were mapping that to "SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT", which causes OpenSSL to fail the handshake if no cert is provided.  But the Windows code actually still allows this through, instead setting a policy error to indicate that no certificate was required.  I'm simply removing the SSL_VERIFY_FAIL_IF_NO_PEER_CERT flag to match that design.  I've also updated the test to assert that the error is actually being set.


Commit migrated from https://github.com/dotnet/corefx/commit/81f6c96f4f0562f1dfdf348f5ea9c126be28251e
2016-01-21 18:29:05 -05:00
stephentoub 607c97ab27 Update OpenSSL error handling
Fix handling of certain OpenSSL errors to ensure we don't confliate two different error schemes and don't lose error information in the interop code.


Commit migrated from https://github.com/dotnet/corefx/commit/b9d6a1a9a46bf4a74624a71cfe42b078c2f86dfc
2016-01-21 18:29:05 -05:00
stephentoub 6e02e979df Fix improper exception handling in ProcessAuthentication
The method sets a flag to indicate that an operation is in progress, then kicks off the operation, and then in a finally block potentially resets the flag.  The intent of resetting it is to reset the flag iff the operation is no longer in progress, which would be the case if the operation was synchronous or if the initiation of the asynchronous operation resulted in an exception.  As such, the finally block is checking whether the operation was synchronous or whether an exception has been captured.

However, for the exceptional case, this leads to race conditions.  The initiation of the asynchronous operaiton can lead to the operation running concurrently with the remainder of the ProcessAuthentication method, namely concurrently with the finally block.  If the operation starts quickly and fails quickly, it'll store the exception, which will cause the finally block to see that an exception has been captured and mistakenly believe that the operation failed synchronously, thus resetting the flag.  But the operation was actually asynchronous, and when EndAuthentication is called, it'll see that the flag has been reset and think that the EndAuthentication call is erroneous, thus throwing an exception.  While it should throw an exception (the one that caused the operation to fail), it ends up throwing an InvalidOperationException instead to signal that EndAuthentication was used incorrectly.

The fix is to move the check for the exceptional situation out of the finally and into a catch block.  The catch block is then used to reset the flag only if an exception emerges synchronously, and the finally block is used to reset the flag only for synchronous operations.  (It's possible that for synchronous operations that fail, the flag could be written as 0 twice... that's fine.)

This fixes the failure on both Windows and Unix.  The failure wasn't reproing on Windows but only because of differences in timing... adding a brief pause at the end of the try block would trigger the failure on Windows as well.


Commit migrated from https://github.com/dotnet/corefx/commit/9e63a418f6ab0dc01ab9e51f2ad9d498a35899cd
2016-01-21 18:27:22 -05:00
Eric StJohn ab95158a7e Merge pull request dotnet/corefx#5576 from ericstj/removeWindowsDependencies
Remove dependencies on WindowsIdentity from Unix binaries

Commit migrated from https://github.com/dotnet/corefx/commit/c8818d1907dc3c2313a18d92165c488dadfefa57
2016-01-21 11:59:15 -08:00
Eric Erhardt 4d42d8879e Bump ExpectedPrerelease version to latest (rc2-23713)
Commit migrated from https://github.com/dotnet/corefx/commit/ea4b19c136f3fa6355fd307b38cbe605b519b5eb
2016-01-21 09:46:18 -06:00
Eric St. John 23707936cb Remove dependencies on WindowsIdentity from Unix binaries
It looks like a couple libraries were using
System.Security.Principal.Windows unintentionally in their
Unix implementations.  @dagood discovered this when
trying to restore our tools-runtime project for unix RIDs.

This fix removes the dependencies from those libs
in the CoreFx repro.
/cc @CIPop @saurabh500

It looks like WCF also has this problem as well,
since it hasn't split System.Private.ServiceModel
into windows specific packages.
/cc @StephenBonikowsky


Commit migrated from https://github.com/dotnet/corefx/commit/6902316fed76f2a905ef626b7ef0a64b4749a237
2016-01-20 16:56:04 -08:00
Wes Haggard 389fa6745c Normalize .builds and .csproj file configurations
GenerateBuilds.ps1 generates the builds and default configurations
based on the configurations listed in the csproj. This commit is a
result of running the script to normalize and fixing any bad configurations.


Commit migrated from https://github.com/dotnet/corefx/commit/e7e275654026c2488f6a4116ff5f390e8ce015be
2016-01-18 00:42:32 -08:00
Stephen Toub 8b2dab2341 Merge pull request dotnet/corefx#5461 from CIPop/sn_disable_tests
Disabling System.Net intermittently failing tests

Commit migrated from https://github.com/dotnet/corefx/commit/cc5065b76ed50e10e24f5183db0d3e866f8a621d
2016-01-15 16:20:16 -05:00
Cristian Pop 4a4173d992 Disabling System.Net intermittently failing tests. Adding new tests for reported issues. Fixing test csproj file.
Commit migrated from https://github.com/dotnet/corefx/commit/be32a60de7e4eead5b7d3e045ea3ce4e1a34e855
2016-01-15 11:44:04 -08:00
stephentoub b349e58bc4 Add Debug.Fail calls at GlobalLog.Assert* call sites
Commit migrated from https://github.com/dotnet/corefx/commit/da4bf9a9a55b093614f645b2cd429146644f4d3c
2016-01-14 16:20:01 -05:00
stephentoub 2b6159d669 Replace globalLogEnabled caching with GlobalLog.IsEnabled
Per previous feedback.


Commit migrated from https://github.com/dotnet/corefx/commit/a2b956429fb10b771b2c9d5778b478d7e4b54904
2016-01-14 16:19:55 -05:00
Ian Hays e3311742d9 Bump ExpectedPrerelease version to latest (rc2-23712)
Commit migrated from https://github.com/dotnet/corefx/commit/01c61f62988e8abf39aecc64b0a97ea4e384de3f
2016-01-14 10:36:27 -08:00
Stephen Toub 2f43a6cb34 Merge pull request dotnet/corefx#5285 from stephentoub/more_net_logging
Mop up more System.Net logging guards

Commit migrated from https://github.com/dotnet/corefx/commit/4fc64ecb9046d15db4579a309bcef937f9ba889e
2016-01-13 21:08:15 -05:00
Stephen Toub ada5517874 Merge pull request dotnet/corefx#5388 from stephentoub/disable_net_test
Disable two more NegotiateStream tests

Commit migrated from https://github.com/dotnet/corefx/commit/700229d41764faa853679ef658636e01b59345e7
2016-01-13 18:38:29 -05:00
Stephen Toub 7e7598c93f Merge pull request dotnet/corefx#5350 from dagood/fix-project-dependencies-nugetexe
Fix project.json dependencies: xunit DNXCore incompatibility + invalid package dependencies

Commit migrated from https://github.com/dotnet/corefx/commit/d591a687578f01ead8421ee4898b7bf42e7d95d6
2016-01-13 16:06:59 -05:00
stephentoub eecb1c4983 Mop up more System.Net logging guards
Some more GlobalLog.IsEnabled guards. I noticed a few while doing some other profiling, and so did another set of searches across the whole codebase. Many of these came from the System.Net.Security PRs that were in-progress at the same time I was doing the previous logging changes.


Commit migrated from https://github.com/dotnet/corefx/commit/a04c9898b9bc6d06cd42e1dfd93a63633da4dd30
2016-01-13 16:01:18 -05:00
stephentoub 630172d362 Disable two more NegotiateStream tests
These have also been taking out multiple builds.


Commit migrated from https://github.com/dotnet/corefx/commit/0261628c6da0b09944e00b9ae82a064157188605
2016-01-13 15:34:05 -05:00
stephentoub 57fb36329d Disable failing NegotiateStream test
Commit migrated from https://github.com/dotnet/corefx/commit/6800636d5ff50601bc8fd84bab5c7fcc1d0ca379
2016-01-13 10:40:56 -05:00
dagood df455922aa Fix references to nonexistent packages by replacing with stable version where possible, otherwise the upgraded prerelease.
Commit migrated from https://github.com/dotnet/corefx/commit/063c9926f8b27cc987668deb4d75f18295506f17
2016-01-12 15:14:27 -06:00
dagood e401efd6af Add portable-net45+win8 import to tests.
Specifically, add the import to dnxcore50 frameworks entries where "xunit" is mentioned in the project.json.
This fixes `xunit.abstractions 2.0.0 is not compatible with DNXCore,Version=v5.0.`


Commit migrated from https://github.com/dotnet/corefx/commit/da2e8eb34efcaf70069223bc431d80909a2fc91d
2016-01-12 14:04:32 -06:00
Guillermo Rangel 54f514187f Deleting Logging.cs file
Substituting Logging calls to EventSource calls, or calls to
LoggingHash.

Formatting Changes

Fixing Aligment, and casing.

Changing Dump methods log the hash of the object calling it instead of the method

After some discussion, it was decided that it is more useful to log the
object where the dump happens, than the method. Doing the necessary
changes for it.

Changing usage of "this" to [CallerMemberName]

Instead of using this to know who called the logging method, using
[CallerMemberName] as an attribute to the parameter to fill that
information.

Adding a TODO item.

Making a note to not change NetEventSource or it can break.

Missing Underscore

Adding missing underscore in _wsaBuffer


Commit migrated from https://github.com/dotnet/corefx/commit/f39502ef910c90ba1e67d787df98b627d39ba6cc
2016-01-12 10:27:16 -08:00
Stephen Toub 1d5abed128 Merge pull request dotnet/corefx#5304 from stephentoub/switch_test_servers
Switch System.Net.Security test to use shared HttpTestServers

Commit migrated from https://github.com/dotnet/corefx/commit/4cdd4d9ab943546777dc67a0f30ed13d2eaa44bc
2016-01-11 13:50:28 -05:00
Stephen Toub b65f87769b Merge pull request dotnet/corefx#5301 from stephentoub/sockets_tests
Disable several System.Net tests that have been failing

Commit migrated from https://github.com/dotnet/corefx/commit/ac5dcc3ad4ebd93371ad82178cdccb55cc5eedff
2016-01-11 12:24:20 -05:00
stephentoub d66ba56618 Switch System.Net.Security test to use shared HttpTestServers
Commit migrated from https://github.com/dotnet/corefx/commit/d03c243c3676fc322f567e242ec47ee63ce096f6
2016-01-11 11:19:30 -05:00
stephentoub 6318ec9d57 Disable several System.Net tests that have been failing
Commit migrated from https://github.com/dotnet/corefx/commit/3456760d2e9fd755b4433b5516e656ce99607657
2016-01-11 09:08:31 -05:00
stephentoub 00e5ac2839 Fix URL used in System.Net.Security tests
An incorrect URL was causing the CertificateValidationRemoteServer_EndToEnd_Ok test to fail.


Commit migrated from https://github.com/dotnet/corefx/commit/3802cd82257433a3208f0ed20874e867af97a283
2016-01-11 09:07:04 -05:00
Cristian Pop 170be2da87 Merge pull request dotnet/corefx#5257 from stephentoub/socket_alloc
Remove ExecutionContext-related allocations from System.Net.Sockets

Commit migrated from https://github.com/dotnet/corefx/commit/17ddda61de3066c46107564435930a86daffcd61
2016-01-08 19:22:53 -08:00
dotnet-bot 8f7e954343 Porting NegotiateStream.
Commit migrated from https://github.com/dotnet/corefx/commit/9a414b0af4230b59a06dd9e255a36400582f482e
2016-01-08 16:51:31 -08:00
stephentoub 9a70801670 Remove ExecutionContext shim from System.Net
In profiling a client/server scenario where the client launches a bunch of async operations against the server, close to 15% of all allocated instances on the client are for System.Threading.ExecutionContext (~9% of the allocated space).  This didn't make sense, because on CoreCLR ExecutionContext is immutable and neither ExecutionContext.Capture() nor ExecutionContext.CreateCopy() should be allocating.

It turns out that some of the System.Net libraries had a custom System.Threading.ExecutionContext shim object with a comment in the file "Important: This is temporary code". Ugh.

I've removed it.  No more ExecutionContext allocations. And using the right ExecutionContext object from CoreCLR.

This also shrinks the size of SocketAsyncEventArgs by another field, as a separate ExecutionContext copy no longer need be maintained, due to ExecutionContext immutability on platforms other than the full framework.


Commit migrated from https://github.com/dotnet/corefx/commit/241eb27504a4e7bc774e202acc5447b09bb4a2d6
2016-01-08 15:39:37 -05:00
stephentoub 37bbb6330d Additional cleanup
- Remove dead Assert overloads that include a Boolean conditional
- Fix up several missed call sites.  Missed primarily due to code being conditionally included based on different build flavors (e.g. Windows vs Unix)
- Fix up GlobalLog fakes to include IsEnabled


Commit migrated from https://github.com/dotnet/corefx/commit/cc8a5d162d36efc8bd56ba406efea71ee3a8af6f
2016-01-08 12:26:18 -05:00
stephentoub 6683df773f Improve performance around logging code in System.Net.Security
Same treatment as in https://github.com/dotnet/corefx/pull/5238, but for System.Net.Security.  The call sites to GlobalLog methods often do a lot of allocation and other work, even in release builds and even when logging is disabled; this commit guards those call sites behind checks for whether logging is enabled.


Commit migrated from https://github.com/dotnet/corefx/commit/ba002b1f94c43e8616b457536c29244eabc79093
2016-01-08 11:13:02 -05:00
Wes Haggard a3e67fdf73 Update .builds files to include OSGroups
This these .builds files were updated and generated from a script
based on the configurations defined in the matching csproj files.

This updates the builds files to specify OSGroup and TargetGroup
as metadata instead of using AdditionalProperties and also sorts them by
TargetGroup followed by OSGroup.


Commit migrated from https://github.com/dotnet/corefx/commit/95efe37475916016a5fc6ee6f0ba584d990c4196
2016-01-02 23:50:23 -08:00
Wes Haggard f27c7dc024 Update project files adding default configurations
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.

Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.

Removed OutputType=Library property as it isn't necessary.


Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
2016-01-02 23:50:21 -08:00
Jeremy Barton 2c01aeaa10 Merge pull request dotnet/corefx#5139 from bartonjs/sslstream_use_x509certificate2
Make SslStream::RemoteCertificate return an X509Certificate2 object.

Commit migrated from https://github.com/dotnet/corefx/commit/cd5b2b79e62a66bc961d45cc589b4ee9801f2c3d
2015-12-29 14:22:55 -08:00
Guillermo Rangel 1a62aca39f System.Net EventSource Logging
Adding EventSources to substitute the previous logging model using
TraceSources.

In this PR 4 event sources are added:

-NetEventSource
-SocketsEventSource
-HttpEventSource
-SecurityEventSource

Event methods for NetEventSource, SocketsEventSource and HttpEventSource
are
fully added. SecurityEventSource has only a few of
the new event methods implemented.
Changes in production code are done to match this new implementation.
(Only changes for
events in Sockets and Http are done in this iteration).

Adding missing reference to LoggingHash

Missing Reference in Security csproj

Missing reference in NetworkInformation

Adding a reference and adding a missing new line.

Adding references and readonly modifier.

Adding another missing reference.
Adding some missing blank lines and making readonly the s_log in the
EventSources.

Completing SecurityEventSource

Adding missing all the security events that will substitute PrintInfo
calls.

Doing changes in code to reflect this.

Transforming SecurityEventSource into a Partial class

Some of the events were Windows specific, because of the enums they were
using. Those events are now in a partial class that is included when
those enums are defined.

Moving events to partial SecurityEventSource class

Some more events using Interop.SecurityStatus are moved into the partial
windows specific class.

Also, a missed non event header is added for Associate method in
HttpEventSource.

Deleting Logging reference to instead use LoggingHash

Addressing some of the PR feedback

Adding the Issue number to TODO for localization, and using BlockCopy
instead of a Loop to copy array. Also, correctly passing partialBuffer
instead of Buffer to the DumpArrayAsync method.


Commit migrated from https://github.com/dotnet/corefx/commit/1cd8bf635d4b9a6d8a7d1e25cd320814c993f38b
2015-12-29 12:14:39 -08:00
bartonjs 666e473744 Make SslStream::RemoteCertificate return an X509Certificate2 object.
This is the only place in all of corefx (outside of the X509Certificates tests) that instantiates an X509Certificate object (instead of an X509Certificate2).

Since the property still return an X509Certificate(1), the callers would have to cast it to use the X509Certificate2-only properties, but now an `as` will suffice, whereas before it required an up-converting operation.


Commit migrated from https://github.com/dotnet/corefx/commit/4db0e714272a195fc29d6f904ad6bb3422e94e43
2015-12-29 11:34:08 -08:00
Pallavi Taneja 95a3b67166 Expose Assembly.GetEntryAssembly and TypeInfo.IsEquivalentTo()
Expose Assembly.GetEntryAssembly and TypeInfo.IsEquivalentTo() in System.Reflection.
Fixes issues dotnet/corefx#4146 , dotnet/corefx#2101


Commit migrated from https://github.com/dotnet/corefx/commit/e28fdbd9dd98810a81207c665fdc4e6b40b24e64
2015-12-21 14:56:26 -08:00
Pallavi Taneja 90c2d27bf1 Update Corefx Repo to depend on newer package versions
Disable failing tests with the tracking active issue


Commit migrated from https://github.com/dotnet/corefx/commit/98fdc29624cd791bba42ec1e0cd5c256f331adfe
2015-12-21 11:48:15 -08:00
Shruti Garg 3ef249a8fa Fixing System.Net.Security.Unit.Tests failure
Commit migrated from https://github.com/dotnet/corefx/commit/584399101e2248b5197b9ba389c7e4fc6c953333
2015-12-18 18:40:37 +05:30
Cristian Pop 635b48f8a9 Disabling tests failing on *NIX. Fix dotnet/corefx#5037
Commit migrated from https://github.com/dotnet/corefx/commit/93395f04a1db3040a4b40e85df7d166b23076e92
2015-12-17 13:10:58 -08:00
Joel Hendrix 42d8d1a581 Use build tools task CopySupplementalTest data for copying test data.
The task for copying test data has been consolidated into build tools (see
build tools PRdotnet/corefx#363) and first appeared in build tools build 133. Update
projects that copy test data to use the new task.


Commit migrated from https://github.com/dotnet/corefx/commit/f1a4b51ffee958304d44b56296ec7f7e73e55549
2015-12-11 13:16:09 -08:00
stephentoub 77c4183d17 Update package validation to rc2-23610
Commit migrated from https://github.com/dotnet/corefx/commit/6f6303f0356be4d2dd4ac117373f1e37f8752248
2015-12-11 10:53:47 -05:00