Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REL-4359 - KSM .NET SDK v16.6.5 #560

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdk/dotNet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

# Change Log

## 16.6.5

* KSM-476 - fix public key parsing
* KSM-484 - Update to latest Bouncy Castle version

## 16.6.4

* KSM-466 - Fixed ExpiresOn conversion from UnixTimeMilliseconds. Closes [Issue #533]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
Expand All @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0-preview-06">
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotNet/SecretManagement.Keeper/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if ($Package) {
@(
'./bin/Release/netstandard2.1/SecretManagement.Keeper.dll'
'./bin/Release/netstandard2.1/SecretsManager.dll'
'./bin/Release/netstandard2.1/BouncyCastle.Crypto.dll'
'./bin/Release/netstandard2.1/BouncyCastle.Cryptography.dll'
) | ForEach-Object {
Copy-Item -Path $_ -Destination $outDir -Force
}
Expand Down
9 changes: 7 additions & 2 deletions sdk/dotNet/SecretsManager/CryptoUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using Org.BouncyCastle.Asn1.Pkcs;
using Org.BouncyCastle.Asn1.Sec;

namespace SecretsManager
{
Expand Down Expand Up @@ -105,8 +107,11 @@ private static ECPublicKeyParameters ImportPublicKey(byte[] key)
}

private static ECPrivateKeyParameters ImportPrivateKey(byte[] privateKeyDer)
{
return new ECPrivateKeyParameters(new BigInteger(1, privateKeyDer.Skip(36).Take(32).ToArray()), ECParameters);
{
var privateKeyInfo = PrivateKeyInfo.GetInstance(privateKeyDer);
var privateKeyStructure = ECPrivateKeyStructure.GetInstance(privateKeyInfo.ParsePrivateKey());
var privateKeyValue = privateKeyStructure.GetKey();
return new ECPrivateKeyParameters(privateKeyValue, ECParameters);
}

private static byte[] GetECIESSymmetricKey(ICipherParameters privateKey, ICipherParameters recipientPublicKey)
Expand Down
12 changes: 6 additions & 6 deletions sdk/dotNet/SecretsManager/SecretsManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<LangVersion>9</LangVersion>
<Company>Keeper Security Inc.</Company>
<Product>SecretsManager .Net SDK</Product>
<AssemblyVersion>16.6.4</AssemblyVersion>
<FileVersion>16.6.4</FileVersion>
<PackageVersion>16.6.4</PackageVersion>
<AssemblyVersion>16.6.5</AssemblyVersion>
<FileVersion>16.6.5</FileVersion>
<PackageVersion>16.6.5</PackageVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageId>Keeper.SecretsManager</PackageId>
<Authors>Sergey Aldoukhov</Authors>
Expand All @@ -22,8 +22,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" />
<PackageReference Include="BouncyCastle.Cryptography" Version="2.2.1" />
<PackageReference Include="System.Text.Json" Version="8.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
</ItemGroup>
</Project>
Loading