Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Modify System.Net.Security to throw PNSE #39358

Merged
merged 2 commits into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libraries/System.Net.Security/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,7 @@
<data name="net_ssl_ciphersuites_policy_not_supported" xml:space="preserve">
<value>CipherSuitesPolicy is not supported on this platform.</value>
</data>
<data name="SystemNetSecurity_PlatformNotSupported" xml:space="preserve">
<value>System.Net.Security is not supported on this platform.</value>
</data>
</root>
15 changes: 9 additions & 6 deletions src/libraries/System.Net.Security/src/System.Net.Security.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
<DefineConstants>$(DefineConstants);PRODUCT</DefineConstants>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsBrowser)' == 'true'">SR.SystemNetSecurity_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetsOSX)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">
<DefineConstants>$(DefineConstants);SYSNETSECURITY_NO_OPENSSL</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<Compile Include="System\Net\CertificateValidationPal.cs" />
<Compile Include="System\Net\Logging\NetEventSource.cs" />
<Compile Include="System\Net\SslStreamContext.cs" />
Expand Down Expand Up @@ -86,15 +89,15 @@
<!-- This file depends on IANA registry. We do not want anyone's build to break after the update -->
<!-- or if they don't have internet connection - explicit opt-in required -->
<!-- To expose newly generated APIs, generated file have to be deliberately copied -->
<ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<Compile Include="System\Net\Security\TlsCipherSuite.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuite.tt</DependentUpon>
</Compile>
<None Include="System\Net\Security\TlsCipherSuiteNameParser.ttinclude" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true' ">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="System\Net\Security\TlsCipherSuiteData.Lookup.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
Expand Down Expand Up @@ -206,7 +209,7 @@
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true' ">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Expand Down Expand Up @@ -245,7 +248,7 @@
<Compile Include="System\Net\Security\SslConnectionInfo.Unix.cs" />
<Compile Include="System\Net\Security\TlsCipherSuiteData.cs" />
</ItemGroup>
<ItemGroup Condition="('$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true') and '$(TargetsOSX)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true' and '$(TargetsOSX)' != 'true' and '$(TargetsiOS)' != 'true' and '$(TargetstvOS)' != 'true'">
<Compile Include="System\Net\CertificateValidationPal.Unix.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.Linux.cs" />
<Compile Include="System\Net\Security\SslStreamPal.Unix.cs" />
Expand Down Expand Up @@ -358,7 +361,7 @@
<Reference Include="System.Threading" />
<Reference Include="System.Threading.ThreadPool" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Reference Include="System.Console" Condition="'$(Configuration)' == 'Debug'" />
<Reference Include="System.Diagnostics.StackTrace" />
<Reference Include="System.Security.Cryptography.Algorithms" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
using Xunit;

[assembly: ActiveIssue("https://github.com/dotnet/runtime/issues/34690", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[assembly: SkipOnMono("System.Net.Security is not supported on Browser", TestPlatforms.Browser)]
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
<AllowUnsafeBlocks Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'">true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS</TargetFrameworks>
<Nullable>annotations</Nullable>
<IgnoreForCI Condition="'$(TargetOS)' == 'Browser'">true</IgnoreForCI>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<Compile Include="NotifyReadVirtualNetworkStream.cs" />
<Compile Include="DummyTcpServer.cs" />
<Compile Include="SslStreamExtensions.cs" />
Expand Down Expand Up @@ -84,7 +87,7 @@
<Compile Include="SslStreamCredentialCacheTest.cs" />
<Compile Include="SslStreamSystemDefaultsTest.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<Compile Include="LoggingTest.cs" />
<Compile Include="$(CommonTestPath)System\Diagnostics\Tracing\TestEventListener.cs"
Link="Common\System\Diagnostics\Tracing\TestEventListener.cs" />
Expand All @@ -94,7 +97,7 @@
<Compile Include="$(CommonTestPath)System\Net\Capability.Security.Windows.cs"
Link="Common\System\Net\Capability.Security.Windows.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'">
<ItemGroup Condition="'$(TargetsUnix)' == 'true'">
<Compile Include="IdentityValidator.Unix.cs" />
<Compile Include="$(CommonTestPath)System\Net\Capability.Security.Unix.cs"
Link="Common\System\Net\Capability.Security.Unix.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Xunit;

[assembly: SkipOnMono("System.Net.Security is not supported on Browser", TestPlatforms.Browser)]
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
<NoWarn>$(NoWarn);3021</NoWarn>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS</TargetFrameworks>
<Nullable>annotations</Nullable>
<IgnoreForCI Condition="'$(TargetOS)' == 'Browser'">true</IgnoreForCI>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<Compile Include="SslApplicationProtocolTests.cs" />
<Compile Include="SslAuthenticationOptionsTests.cs" />
<Compile Include="SslStreamAllowedProtocolsTest.cs" />
Expand All @@ -30,7 +34,7 @@
<Compile Include="$(CommonPath)System\HexConverter.cs"
Link="Common\System\HexConverter.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
<!-- Production code references -->
<Compile Include="..\..\src\System\Net\Security\NetEventSource.Security.cs"
Link="ProductionCode\System\Net\Security\NetEventSource.Security.cs" />
Expand Down
1 change: 0 additions & 1 deletion src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Primitives\tests\FunctionalTests\System.Net.Primitives.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Primitives\tests\PalTests\System.Net.Primitives.Pal.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Security\tests\FunctionalTests\System.Net.Security.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Sockets\tests\FunctionalTests\System.Net.Sockets.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.WebSockets.Client\tests\System.Net.WebSockets.Client.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.ObjectModel\tests\System.ObjectModel.Tests.csproj" />
Expand Down