small amendments

This commit is contained in:
Dimitrij
2023-03-16 23:01:06 +00:00
parent a3a851e57f
commit 3e1ee0056d
4 changed files with 15 additions and 21 deletions

View File

@@ -11,8 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.Core" Version="3.7.105.17" />
<PackageReference Include="AWSSDK.EC2" Version="3.7.126.2" />
<PackageReference Include="AWSSDK.Core" Version="3.7.105.21" />
<PackageReference Include="AWSSDK.EC2" Version="3.7.127.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
</ItemGroup>

View File

@@ -19,8 +19,7 @@ public class PuttyKeyFileGenerator
public static string ToPuttyPrivateKey(RSACryptoServiceProvider cryptoServiceProvider, string Comment = "imported-openssh-key")
{
var publicParameters = cryptoServiceProvider.ExportParameters(false);
byte[] publicBuffer = new byte[3 + keyType.Length + GetPrefixSize(publicParameters.Exponent) + publicParameters.Exponent.Length +
GetPrefixSize(publicParameters.Modulus) + publicParameters.Modulus.Length + 1];
byte[] publicBuffer = new byte[3 + keyType.Length + GetPrefixSize(publicParameters.Exponent) + publicParameters.Exponent.Length + GetPrefixSize(publicParameters.Modulus) + publicParameters.Modulus.Length + 1];
using (var bw = new BinaryWriter(new MemoryStream(publicBuffer)))
{
@@ -32,7 +31,8 @@ public class PuttyKeyFileGenerator
var publicBlob = System.Convert.ToBase64String(publicBuffer);
var privateParameters = cryptoServiceProvider.ExportParameters(true);
byte[] privateBuffer = new byte[paddedPrefixSize + privateParameters.D.Length + paddedPrefixSize + privateParameters.P.Length + paddedPrefixSize + privateParameters.Q.Length + paddedPrefixSize + privateParameters.InverseQ.Length];
byte[] privateBuffer = new byte[paddedPrefixSize + privateParameters.D.Length + paddedPrefixSize + privateParameters.P!.Length + paddedPrefixSize + privateParameters.Q.Length + paddedPrefixSize + privateParameters.InverseQ.Length];
using (var bw = new BinaryWriter(new MemoryStream(privateBuffer)))
{
@@ -43,10 +43,9 @@ public class PuttyKeyFileGenerator
}
var privateBlob = System.Convert.ToBase64String(privateBuffer);
HMACSHA1 hmacSha1 = new HMACSHA1(SHA1.Create().ComputeHash(Encoding.ASCII.GetBytes("putty-private-key-file-mac-key")));
HMACSHA1 hmacSha1 = new(SHA1.Create().ComputeHash(Encoding.ASCII.GetBytes("putty-private-key-file-mac-key")));
//byte[] bytesToHash = new byte[4 + 7 + 4 + 4 + 4 + Comment.Length + 4 + publicBuffer.Length + 4 + privateBuffer.Length];
byte[] bytesToHash = new byte[prefixSize + keyType.Length + prefixSize + encryptionType.Length + prefixSize + Comment.Length +
prefixSize + publicBuffer.Length + prefixSize + privateBuffer.Length];
byte[] bytesToHash = new byte[prefixSize + keyType.Length + prefixSize + encryptionType.Length + prefixSize + Comment.Length + prefixSize + publicBuffer.Length + prefixSize + privateBuffer.Length];
using (var bw = new BinaryWriter(new MemoryStream(bytesToHash)))
{

View File

@@ -15,8 +15,8 @@ using System.Resources;
[assembly: AssemblyCulture("")]
// Version information
[assembly: AssemblyVersion("1.77.3.1826")]
[assembly: AssemblyFileVersion("1.77.3.1826")]
[assembly: AssemblyVersion("1.77.3.1828")]
[assembly: AssemblyFileVersion("1.77.3.1828")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
[assembly: AssemblyInformationalVersion("1.77.3 (Nightly Build 1826)")]
[assembly: AssemblyInformationalVersion("1.77.3 (Nightly Build 1828)")]

View File

@@ -1,11 +1,13 @@
using System;
using System;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Versioning;
using WeifenLuo.WinFormsUI.Docking;
namespace mRemoteNG.Themes
{
[SupportedOSPlatform("windows")]
/// <inheritdoc />
/// <summary>
/// Container class for all the color and style elements to define a theme
@@ -24,11 +26,7 @@ namespace mRemoteNG.Themes
#region Constructors
public ThemeInfo(string themeName,
ThemeBase inTheme,
string inURI,
VisualStudioToolStripExtender.VsVersion inVersion,
ExtendedColorPalette inExtendedPalette)
public ThemeInfo(string themeName, ThemeBase inTheme, string inURI, VisualStudioToolStripExtender.VsVersion inVersion, ExtendedColorPalette inExtendedPalette)
{
_name = themeName;
_theme = inTheme;
@@ -44,10 +42,7 @@ namespace mRemoteNG.Themes
setCustomExtenders();
}
public ThemeInfo(string themeName,
ThemeBase inTheme,
string inURI,
VisualStudioToolStripExtender.VsVersion inVersion)
public ThemeInfo(string themeName, ThemeBase inTheme, string inURI, VisualStudioToolStripExtender.VsVersion inVersion)
{
_name = themeName;
_theme = inTheme;