Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 35735e2

Browse files
authored
Include Cryptography.Cng 462OrNewer tests only when targetgroup is net462, net47 or netcoreapp (#19390)
* Include S.S.Cryptography.Cng 462OrNewer tests only when net462, net47 or netcoreapp
1 parent 2f86292 commit 35735e2

File tree

15 files changed

+65
-29
lines changed

15 files changed

+65
-29
lines changed

src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/AES/AesCipherTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public static void VerifyInPlaceDecryption()
168168
byte[] plainText = "f238882f6530ae9191c294868feed0b0df4058b322377dec14690c3b6bbf6ad1dd5b7c063a28e2cca2a6dce8cc2e668ea6ce80cee4c1a1a955ff46c530f3801b".HexToByteArray();
169169
byte[] cipher = "7c6e1bcd3c30d2fb2d92e3346048307dc6719a6b96a945b4d987af09469ec68f5ca535fab7f596fffa80f7cfaeb26eefaf8d4ca8be190393b2569249d673f042".HexToByteArray();
170170

171-
using (Aes a = Aes.Create())
171+
using (Aes a = AesFactory.Create())
172172
using (MemoryStream cipherStream = new MemoryStream(cipher))
173173
{
174174
a.Key = key;

src/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaStub.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm)
3131
throw new NotImplementedException();
3232
}
3333

34+
#if netcoreapp
3435
public override void ImportParameters(ECParameters parameters)
3536
{
3637
throw new NotImplementedException();
@@ -50,5 +51,6 @@ public override void GenerateKey(ECCurve curve)
5051
{
5152
throw new NotImplementedException();
5253
}
54+
#endif
5355
}
5456
}

src/System.Runtime.InteropServices.RuntimeInformation/ref/Configurations.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<BuildConfigurations>
55
netcoreapp;
66
netfx;
7+
net462;
8+
net47;
79
uap;
810
</BuildConfigurations>
911
</PropertyGroup>

src/System.Runtime.InteropServices.RuntimeInformation/ref/System.Runtime.InteropServices.RuntimeInformation.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@
88
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
99
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
1010
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
11+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net462-Debug|AnyCPU'" />
12+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net462-Release|AnyCPU'" />
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net47-Debug|AnyCPU'" />
14+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net47-Release|AnyCPU'" />
1115
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
1216
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
1317
<ItemGroup>
1418
<Compile Include="System.Runtime.InteropServices.RuntimeInformation.cs" />
1519
</ItemGroup>
16-
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
20+
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp' Or '$(TargetGroup)' == 'uap'">
1721
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
1822
</ItemGroup>
19-
<ItemGroup Condition="'$(TargetGroup)' == 'netfx'">
23+
<ItemGroup Condition="'$(TargetGroup)' == 'netfx' or '$(TargetGroup)' == 'net462' or '$(TargetGroup)' == 'net47'">
2024
<Reference Include="mscorlib" />
2125
</ItemGroup>
2226
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />

src/System.Runtime.InteropServices.RuntimeInformation/src/Configurations.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
wpa81-Windows_NT;
77
net45-Windows_NT;
88
netfx-Windows_NT;
9+
net462-Windows_NT;
10+
net47-Windows_NT;
911
uap-Windows_NT;
1012
netstandard1.1-AnyOS;
1113
netstandard1.1-Unix;

src/System.Runtime.InteropServices.RuntimeInformation/src/System.Runtime.InteropServices.RuntimeInformation.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<RootNamespace>System.Runtime.InteropServices</RootNamespace>
77
<AssemblyName>System.Runtime.InteropServices.RuntimeInformation</AssemblyName>
88
<ProjectGuid>{1CBC030D-B5D3-4AB5-A9FD-24EC5F6F38D2}</ProjectGuid>
9-
<DefineConstants Condition="'$(TargetGroup)'=='net45' OR '$(TargetGroup)'=='netfx'">$(DefineConstants);netfx</DefineConstants>
9+
<DefineConstants Condition="'$(TargetGroup)'=='net45' OR '$(TargetGroup)'=='netfx' OR '$(TargetGroup)'=='net462' OR '$(TargetGroup)'=='net47'">$(DefineConstants);netfx</DefineConstants>
1010
<DefineConstants Condition="'$(TargetGroup)'=='wpa81'">$(DefineConstants);wpa81</DefineConstants>
1111
<DefineConstants Condition="'$(TargetGroup)'=='win8'">$(DefineConstants);win8</DefineConstants>
1212
<DefineConstants Condition="'$(TargetGroup)'=='uap'">$(DefineConstants);uap</DefineConstants>
@@ -62,7 +62,7 @@
6262
</Compile>
6363
<Compile Include="System\Runtime\InteropServices\RuntimeInformation\RuntimeInformation.Unix.cs" />
6464
</ItemGroup>
65-
<ItemGroup Condition="'$(TargetsWindows)'=='true' And ('$(TargetGroup)' == 'netstandard1.1' OR '$(TargetGroup)' == 'netcoreapp' OR '$(TargetGroup)'=='net45' OR '$(TargetGroup)'=='netfx' OR '$(TargetGroup)'=='uap')">
65+
<ItemGroup Condition="'$(TargetsWindows)'=='true' And ('$(TargetGroup)' != 'win8' AND '$(TargetGroup)' != 'wpa81')">
6666
<Compile Include="$(CommonPath)\Interop\Windows\NtDll\Interop.RtlGetVersion.cs">
6767
<Link>Common\Interop\Windows\NtDll\Interop.RtlGetVersion.cs</Link>
6868
</Compile>
@@ -87,7 +87,7 @@
8787
<Link>Common\Interop\Windows\kernel32\Interop.GetSystemInfo.cs</Link>
8888
</Compile>
8989
</ItemGroup>
90-
<ItemGroup Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'netfx'">
90+
<ItemGroup Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'netfx' OR '$(TargetGroup)' == 'net462' OR '$(TargetGroup)' == 'net47'">
9191
<Reference Include="mscorlib" />
9292
<Reference Include="System" />
9393
</ItemGroup>

src/System.Security.Cryptography.Cng/ref/Configurations.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
netfx;
77
uap;
88
netstandard;
9+
net462;
10+
net47;
911
</BuildConfigurations>
1012
</PropertyGroup>
1113
</Project>

src/System.Security.Cryptography.Cng/ref/System.Security.Cryptography.Cng.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public DSACng(System.Security.Cryptography.CngKey key) { }
266266
public override string SignatureAlgorithm { get { throw null; } }
267267
protected override void Dispose(bool disposing) { }
268268
public override System.Security.Cryptography.DSAParameters ExportParameters(bool includePrivateParameters) { throw null; }
269-
#if FEATURE_HASHDATA // types missing from netfx targeting pack and netstandard
269+
#if FEATURE_HASHDATA // uap and netcoreapp specific
270270
protected override byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; }
271271
protected override byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; }
272272
#endif
@@ -278,23 +278,23 @@ public sealed partial class ECDsaCng : System.Security.Cryptography.ECDsa
278278
public ECDsaCng() { }
279279
public ECDsaCng(int keySize) { }
280280
public ECDsaCng(System.Security.Cryptography.CngKey key) { }
281-
#if !netfx // types missing from netfx targeting pack
281+
#if FEATURE_ECPARAMETERS // types missing from netfx and net462 targeting pack
282282
public ECDsaCng(System.Security.Cryptography.ECCurve curve) { }
283283
#endif
284284
public CngAlgorithm HashAlgorithm { get { throw null; } set { } }
285285
public System.Security.Cryptography.CngKey Key { get { throw null; } }
286286
public override int KeySize { get { throw null; } set { } }
287287
public override System.Security.Cryptography.KeySizes[] LegalKeySizes { get { throw null; } }
288288
protected override void Dispose(bool disposing) { }
289-
#if !netfx // types missing from netfx targeting pack
289+
#if FEATURE_ECPARAMETERS // types missing from netfx and net462 targeting pack
290290
public override System.Security.Cryptography.ECParameters ExportExplicitParameters(bool includePrivateParameters) { throw null; }
291291
public override System.Security.Cryptography.ECParameters ExportParameters(bool includePrivateParameters) { throw null; }
292292
public override void GenerateKey(System.Security.Cryptography.ECCurve curve) { }
293293
#endif
294294
public void FromXmlString(string xml, ECKeyXmlFormat format) { throw null; }
295295
protected override byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; }
296296
protected override byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; }
297-
#if !netfx // types missing from netfx targeting pack
297+
#if FEATURE_ECPARAMETERS // types missing from netfx and net462 targeting pack
298298
public override void ImportParameters(System.Security.Cryptography.ECParameters parameters) { }
299299
#endif
300300
public byte[] SignData(byte[] data) { throw null; }

src/System.Security.Cryptography.Cng/ref/System.Security.Cryptography.Cng.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
44
<PropertyGroup>
5-
<DefineConstants Condition="'$(TargetGroup)' == 'netfx'">$(DefineConstants);netfx</DefineConstants>
5+
<DefineConstants Condition="'$(TargetGroup)' != 'netfx' AND '$(TargetGroup)' != 'net462'">$(DefineConstants);FEATURE_ECPARAMETERS</DefineConstants>
66
<ProjectGuid>{9FD12550-3A7C-49D3-9A1E-C4B7410989DD}</ProjectGuid>
77
<DefineConstants Condition="'$(TargetGroup)' == 'uap' Or '$(TargeGroup)' == 'netcoreapp'">$(DefineConstants);FEATURE_HASHDATA</DefineConstants>
8-
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'netfx'">true</IsPartialFacadeAssembly>
8+
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'netfx' OR '$(TargetGroup)' == 'net462' OR '$(TargetGroup)' == 'net47'">true</IsPartialFacadeAssembly>
99
</PropertyGroup>
1010
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
1111
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
@@ -15,10 +15,14 @@
1515
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
1616
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
1717
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
18+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net462-Debug|AnyCPU'" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net462-Release|AnyCPU'" />
20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net47-Debug|AnyCPU'" />
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net47-Release|AnyCPU'" />
1822
<ItemGroup>
1923
<Compile Include="System.Security.Cryptography.Cng.cs" />
2024
</ItemGroup>
21-
<ItemGroup Condition="'$(TargetGroup)' == 'netfx'">
25+
<ItemGroup Condition="'$(IsPartialFacadeAssembly)' == 'true'">
2226
<Reference Include="mscorlib" />
2327
<Reference Include="System.Core" />
2428
</ItemGroup>

src/System.Security.Cryptography.Cng/src/Configurations.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
netfx-Windows_NT;
99
netcoreapp-Windows_NT;
1010
uap-Windows_NT;
11+
net462-Windows_NT;
12+
net47-Windows_NT;
1113
</BuildConfigurations>
1214
</PropertyGroup>
1315
</Project>

0 commit comments

Comments
 (0)