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

Use values from TlsCipherSuiteData for SslConnectionInfo on Windows #66702

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 3 additions & 10 deletions src/libraries/System.Net.Security/src/System.Net.Security.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<Compile Include="System\Net\Security\SslCertificateTrust.cs" />
<Compile Include="System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="System\Net\Security\SslClientHelloInfo.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Unix.cs" />
<Compile Include="System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="System\Net\Security\SecureChannel.cs" />
<Compile Include="System\Net\Security\SslSessionsCache.cs" />
Expand All @@ -41,6 +42,7 @@
<Compile Include="System\Net\Security\StreamSizes.cs" />
<Compile Include="System\Net\Security\TlsAlertType.cs" />
<Compile Include="System\Net\Security\TlsAlertMessage.cs" />
<Compile Include="System\Net\Security\TlsCipherSuiteData.cs" />
<Compile Include="System\Net\Security\TlsFrameHelper.cs" />
<!-- NegotiateStream -->
<Compile Include="System\Net\NTAuthentication.cs" />
Expand Down Expand Up @@ -106,20 +108,13 @@
</Compile>
<None Include="System\Net\Security\TlsCipherSuiteNameParser.ttinclude" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\Security\TlsCipherSuiteData.Lookup.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuiteData.Lookup.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<None Include="System\Net\Security\TlsCipherSuiteData.Lookup.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuiteData.Lookup.tt</DependentUpon>
</None>
</ItemGroup>
Comment on lines -116 to -122
Copy link
Member

@krwq krwq Mar 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider preserving

<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuiteData.Lookup.tt</DependentUpon>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should be preserved in the ItemGroup above (I removed the part of the condition that excludes Windows there)

<ItemGroup Condition="'$(AllowTlsCipherSuiteGeneration)' == 'true'">
<None Include="System\Net\Security\TlsCipherSuite.tt">
<Generator>TextTemplatingFileGenerator</Generator>
Expand Down Expand Up @@ -257,8 +252,6 @@
Link="Common\System\Net\Security\Unix\SecChannelBindings.cs" />
<Compile Include="System\Net\Security\Pal.Managed\EndpointChannelBindingToken.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Unix.cs" />
<Compile Include="System\Net\Security\TlsCipherSuiteData.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.cs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ internal sealed partial class SslConnectionInfo
public SslConnectionInfo(SecPkgContext_ConnectionInfo interopConnectionInfo, TlsCipherSuite cipherSuite)
{
Protocol = interopConnectionInfo.Protocol;
DataCipherAlg = interopConnectionInfo.DataCipherAlg;
DataKeySize = interopConnectionInfo.DataKeySize;
DataHashAlg = interopConnectionInfo.DataHashAlg;
DataHashKeySize = interopConnectionInfo.DataHashKeySize;
KeyExchangeAlg = interopConnectionInfo.KeyExchangeAlg;
KeyExchKeySize = interopConnectionInfo.KeyExchKeySize;

TlsCipherSuite = cipherSuite;
MapCipherSuite(cipherSuite);

// TlsCipherSuiteData does not provide KeyExchKeySize, but WinAPI does
KeyExchKeySize = interopConnectionInfo.KeyExchKeySize;
}
}
}