From b726837947e75e05f3e92a8fa7903373a683d655 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:50:36 -0400 Subject: [PATCH] [deps]: Update dotnet monorepo to v8 (major) (#59) * [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 Co-authored-by: Todd Martin <106564991+trmartin4@users.noreply.github.com> Co-authored-by: Ike <137194738+ike-kottlowski@users.noreply.github.com> --- .config/dotnet-tools.json | 10 ++++++++ global.json | 8 +++---- src/KeyConnector/Dockerfile | 12 +++++----- .../Exceptions/InvalidKeyTypeException.cs | 3 --- src/KeyConnector/KeyConnector.csproj | 23 ++++++++++--------- .../Services/CryptoFunctionService.cs | 4 ++-- 6 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 .config/dotnet-tools.json diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..04065cb --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "8.0.2", + "commands": ["dotnet-ef"] + } + } +} diff --git a/global.json b/global.json index a9b1166..391ba3c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { - "sdk": { - "version": "6.0.100", - "rollForward": "latestFeature" - } + "sdk": { + "version": "8.0.100", + "rollForward": "latestFeature" } +} diff --git a/src/KeyConnector/Dockerfile b/src/KeyConnector/Dockerfile index 90ea7c8..5772032 100644 --- a/src/KeyConnector/Dockerfile +++ b/src/KeyConnector/Dockerfile @@ -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 \ diff --git a/src/KeyConnector/Exceptions/InvalidKeyTypeException.cs b/src/KeyConnector/Exceptions/InvalidKeyTypeException.cs index 8d93125..88a7cbf 100644 --- a/src/KeyConnector/Exceptions/InvalidKeyTypeException.cs +++ b/src/KeyConnector/Exceptions/InvalidKeyTypeException.cs @@ -13,8 +13,5 @@ namespace Bit.KeyConnector.Exceptions public InvalidKeyTypeException(string message, Exception innerException) : base(message, innerException) { } - - protected InvalidKeyTypeException(SerializationInfo info, StreamingContext context) - : base(info, context) { } } } diff --git a/src/KeyConnector/KeyConnector.csproj b/src/KeyConnector/KeyConnector.csproj index 03b3ad1..78f7510 100644 --- a/src/KeyConnector/KeyConnector.csproj +++ b/src/KeyConnector/KeyConnector.csproj @@ -1,10 +1,11 @@ - net6.0 + net8.0 Bit.KeyConnector bitwarden-KeyConnector - True + True + 2024.3.1 @@ -18,22 +19,22 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + - - - + + + - \ No newline at end of file + diff --git a/src/KeyConnector/Services/CryptoFunctionService.cs b/src/KeyConnector/Services/CryptoFunctionService.cs index 1e69834..ce1126f 100644 --- a/src/KeyConnector/Services/CryptoFunctionService.cs +++ b/src/KeyConnector/Services/CryptoFunctionService.cs @@ -8,7 +8,7 @@ namespace Bit.KeyConnector.Services { public async Task 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]; @@ -25,7 +25,7 @@ namespace Bit.KeyConnector.Services public Task 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(data, 0, endDataLength); var tag = new ArraySegment(data, endDataLength, AesGcm.TagByteSizes.MaxSize);