Skip to content

Commit

Permalink
Merge pull request #48 from mark-s/net8
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-s committed May 5, 2024
2 parents b2a0e1f + d46dfde commit 9210063
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CIBuildTest-Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Build
working-directory: src
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CIBuildTest-Win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Build
working-directory: src
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ReleaseAll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: BuildFrameworkDep
shell: bash
Expand All @@ -43,7 +43,7 @@ jobs:
release_name="QnapBackupDecryptor-FD-$tag-${{ matrix.target }}"
# Build everything
dotnet publish ./QnapBackupDecryptor.Console/QnapBackupDecryptor.Console.csproj -c Release -f net6.0 -r ${{ matrix.target }} --self-contained false -p:PublishSingleFile=true -o "./releases/$release_name"
dotnet publish ./QnapBackupDecryptor.Console/QnapBackupDecryptor.Console.csproj -c Release -f net8.0 -r ${{ matrix.target }} --self-contained false -p:PublishSingleFile=true --property:PublishDir="./releases/$release_name"
# bin the pdb files
rm ./releases/$release_name/*.pdb
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
release_name="QnapBackupDecryptor-SC-$tag-${{ matrix.target }}"
# Build everything
dotnet publish QnapBackupDecryptor.sln -c Release -f net6.0 -r ${{ matrix.target }} --self-contained true -o "./releases/$release_name"
dotnet publish QnapBackupDecryptor.sln -c Release -f net8.0 -r ${{ matrix.target }} --self-contained true --property:PublishDir="./releases/$release_name"
# bin the pdb files
rm ./releases/$release_name/*.pdb
Expand Down
9 changes: 4 additions & 5 deletions src/QnapBackupDecryptor.Console/Output.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private static List<string> DecryptResultToRow(DecryptResult decryptResult)
private static IEnumerable<string> DeleteResultToRow(DeleteResult? deleteResult)
{
if (deleteResult == null)
return new List<string>(0);
return [];

var colour = deleteResult.DeletedOk ? "green" : "red";
var status = deleteResult.DeletedOk ? "Deleted" : "Failed";
Expand Down Expand Up @@ -130,11 +130,10 @@ private static void ShowTiming(TimeSpan swElapsed)
}

public static ProgressColumn[] GetProgressColumns()
=> new ProgressColumn[]
{
=> [
new TaskDescriptionColumn(),
new ProgressBarColumn(),
new PercentageColumn(),
new SpinnerColumn(Spinner.Known.SimpleDots),
};
new SpinnerColumn(Spinner.Known.SimpleDots)
];
}
2 changes: 1 addition & 1 deletion src/QnapBackupDecryptor.Console/Prompts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public static bool EnsureDeleteWanted(Options options)
.AddChoice("y")
.AddChoice("n"));

return response.ToLowerInvariant() == "y";
return response.Equals("y", StringComparison.InvariantCultureIgnoreCase);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion src/QnapBackupDecryptor.Core/FileJobExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
internal static class FileJobExtensions
{
internal static List<FileJob> ToList(this FileJob job)
=> new List<FileJob>() { job };
=> [job];
}
4 changes: 1 addition & 3 deletions src/QnapBackupDecryptor.Core/OpenSsl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ private static (byte[] key, byte[] iv) DeriveKeyAndIV(byte[] password, byte[] sa

var currentHash = Array.Empty<byte>();

using var md5Hash = MD5.Create();

while (keyAndIvBytes.Count < COMBINED_KEY_AND_IV_LENGTH)
{
var preHashLength = currentHash.Length + password.Length + salt.Length;
Expand All @@ -68,7 +66,7 @@ private static (byte[] key, byte[] iv) DeriveKeyAndIV(byte[] password, byte[] sa
Buffer.BlockCopy(password, 0, preHash, currentHash.Length, password.Length);
Buffer.BlockCopy(salt, 0, preHash, currentHash.Length + password.Length, salt.Length);

currentHash = md5Hash.ComputeHash(preHash);
currentHash = MD5.HashData(preHash);
keyAndIvBytes.AddRange(currentHash);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down

0 comments on commit 9210063

Please sign in to comment.