Skip to content

Commit 2606aa5

Browse files
committed
Restore previous TFMs.
Signed-off-by: Bradley Grainger <[email protected]>
1 parent 7947a8a commit 2606aa5

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<PackageVersion Include="Dapper.StrongName" Version="2.1.35" />
1010
<PackageVersion Include="IndexRange" Version="1.0.3" />
1111
<PackageVersion Include="log4net" Version="2.0.17" />
12+
<PackageVersion Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="8.0.16" />
1213
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
1314
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
1415
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />

src/MySqlConnector.Authentication.Ed25519/CompatibilitySuppressions.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,4 @@
55
<DiagnosticId>PKV006</DiagnosticId>
66
<Target>.NETFramework,Version=v4.5</Target>
77
</Suppression>
8-
<Suppression>
9-
<DiagnosticId>PKV006</DiagnosticId>
10-
<Target>.NETStandard,Version=v2.0</Target>
11-
</Suppression>
128
</Suppressions>

src/MySqlConnector.Authentication.Ed25519/MySqlConnector.Authentication.Ed25519.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netstandard2.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net462;net472;netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
55
<Title>MySqlConnector Ed25519 Authentication Plugin</Title>
66
<Description>Implements the client_ed25519 and parsec authentication plugins for MariaDB.</Description>
77
<Copyright>Copyright 2019–2024 Bradley Grainger</Copyright>
@@ -15,6 +15,10 @@
1515
<ProjectReference Include="..\MySqlConnector\MySqlConnector.csproj" />
1616
</ItemGroup>
1717

18+
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
19+
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" />
20+
</ItemGroup>
21+
1822
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
1923
<Compile Remove="Chaos.NaCl\CryptoBytes.cs" />
2024
</ItemGroup>

src/MySqlConnector.Authentication.Ed25519/ParsecAuthenticationPlugin.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,13 @@ public void CreateResponseAndPasswordHash(string password, ReadOnlySpan<byte> au
6666
byte[] privateKeySeed;
6767
#if NET6_0_OR_GREATER
6868
privateKeySeed = Rfc2898DeriveBytes.Pbkdf2(Encoding.UTF8.GetBytes(password), salt, iterationCount, HashAlgorithmName.SHA512, 32);
69-
#else
69+
#elif NET472_OR_GREATER || NETSTANDARD2_1_OR_GREATER
7070
using (var pbkdf2 = new Rfc2898DeriveBytes(Encoding.UTF8.GetBytes(password), salt.ToArray(), iterationCount, HashAlgorithmName.SHA512))
7171
privateKeySeed = pbkdf2.GetBytes(32);
72+
#else
73+
privateKeySeed = Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivation.Pbkdf2(
74+
password, salt.ToArray(), Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivationPrf.HMACSHA512,
75+
iterationCount, numBytesRequested: 32);
7276
#endif
7377
Chaos.NaCl.Ed25519.KeyPairFromSeed(out var publicKey, out var privateKey, privateKeySeed);
7478

tests/IntegrationTests/IntegrationTests.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,8 @@
5353

5454
<ItemGroup Condition=" '$(Configuration)' != 'MySqlData' ">
5555
<ProjectReference Include="..\..\src\MySqlConnector\MySqlConnector.csproj" />
56-
<Using Include="MySqlConnector" />
57-
</ItemGroup>
58-
59-
<ItemGroup Condition=" '$(Configuration)' != 'MySqlData' and ($([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net472')) or $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0')))">
6056
<ProjectReference Include="..\..\src\MySqlConnector.Authentication.Ed25519\MySqlConnector.Authentication.Ed25519.csproj" />
57+
<Using Include="MySqlConnector" />
6158
</ItemGroup>
6259

6360
<ItemGroup Condition=" '$(Configuration)' == 'MySqlData' ">

0 commit comments

Comments
 (0)