Skip to content

Commit

Permalink
[deps]: Update dotnet monorepo to v8 (major) (#59)
Browse files Browse the repository at this point in the history
* [deps]: Update dotnet monorepo to v8

* Additional changes for full .NET 8 upgrade

* Bump library versions available in Bookworm

* Bump YubiHSM package to match up with Bookworm

* Few more bumps

* Update KeyConnector.csproj

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Matt Bishop <[email protected]>
Co-authored-by: Todd Martin <[email protected]>
Co-authored-by: Ike <[email protected]>
  • Loading branch information
4 people authored Apr 15, 2024
1 parent 0bf221f commit b726837
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 26 deletions.
10 changes: 10 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.2",
"commands": ["dotnet-ef"]
}
}
}
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.100",
"rollForward": "latestFeature"
}
"sdk": {
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
12 changes: 6 additions & 6 deletions src/KeyConnector/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0

LABEL com.bitwarden.product="bitwarden"

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gosu=1.12* \
curl=7.74.0* \
libc6-dev=2.31* \
opensc=0.21.0* \
gosu=1.14* \
curl=7.88.1* \
libc6-dev=2.36* \
opensc=0.23.0* \
&& rm -rf /var/lib/apt/lists/*

# Install YubiHSM2 SDK
RUN curl -O https://developers.yubico.com/YubiHSM2/Releases/yubihsm2-sdk-2021-08-debian10-amd64.tar.gz \
RUN curl -O https://developers.yubico.com/YubiHSM2/Releases/yubihsm2-sdk-2023-11-debian12-amd64.tar.gz \
&& tar -xzf yubihsm2-sdk-*.tar.gz \
&& rm yubihsm2-sdk-*.tar.gz \
&& dpkg -i yubihsm2-sdk/libyubihsm-http1_*_amd64.deb \
Expand Down
3 changes: 0 additions & 3 deletions src/KeyConnector/Exceptions/InvalidKeyTypeException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@ public InvalidKeyTypeException(string message) : base(message) { }

public InvalidKeyTypeException(string message, Exception innerException)
: base(message, innerException) { }

protected InvalidKeyTypeException(SerializationInfo info, StreamingContext context)
: base(info, context) { }
}
}
23 changes: 12 additions & 11 deletions src/KeyConnector/KeyConnector.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Bit.KeyConnector</RootNamespace>
<UserSecretsId>bitwarden-KeyConnector</UserSecretsId>
<GenerateRuntimeConfigurationFiles>True</GenerateRuntimeConfigurationFiles>
<GenerateRuntimeConfigurationFiles>True</GenerateRuntimeConfigurationFiles>

<Version>2024.3.1</Version>
</PropertyGroup>

Expand All @@ -18,22 +19,22 @@
<PackageReference Include="Google.Cloud.Kms.V1" Version="3.7.0"/>
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1"/>
<PackageReference Include="JsonFlatFileDataStore" Version="2.4.2"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.14"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.14"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.14"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.2"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2"/>
<PackageReference Include="MongoDB.Driver" Version="2.22.0"/>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11"/>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2"/>
<PackageReference Include="Pkcs11Interop" Version="5.1.2"/>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0"/>
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0"/>
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.1"/>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.1"/>
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1"/>
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0"/>
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1"/>
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0"/>
<PackageReference Include="VaultSharp" Version="1.7.0"/>
</ItemGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions src/KeyConnector/Services/CryptoFunctionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class CryptoFunctionService : ICryptoFunctionService
{
public async Task<byte[]> AesGcmEncryptAsync(byte[] data, byte[] key)
{
using var aes = new AesGcm(key);
using var aes = new AesGcm(key, AesGcm.TagByteSizes.MaxSize);
var iv = await GetRandomBytesAsync(AesGcm.NonceByteSizes.MaxSize);
var tag = new byte[AesGcm.TagByteSizes.MaxSize];
var encData = new byte[data.Length];
Expand All @@ -25,7 +25,7 @@ public async Task<byte[]> AesGcmEncryptAsync(byte[] data, byte[] key)

public Task<byte[]> AesGcmDecryptAsync(byte[] data, byte[] key)
{
using var aes = new AesGcm(key);
using var aes = new AesGcm(key, AesGcm.TagByteSizes.MaxSize);
var endDataLength = data.Length - AesGcm.TagByteSizes.MaxSize - AesGcm.NonceByteSizes.MaxSize;
var encData = new ArraySegment<byte>(data, 0, endDataLength);
var tag = new ArraySegment<byte>(data, endDataLength, AesGcm.TagByteSizes.MaxSize);
Expand Down

0 comments on commit b726837

Please sign in to comment.