Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Fine committed Oct 2, 2024
1 parent 04b0f49 commit 0eb1602
Show file tree
Hide file tree
Showing 37 changed files with 848 additions and 1,092 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/keyfactor-starter-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ on:

jobs:
call-starter-workflow:
uses: keyfactor/actions/.github/workflows/starter.yml@v2
uses: keyfactor/actions/.github/workflows/starter.yml@v3
secrets:
token: ${{ secrets.V2BUILDTOKEN}}
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
scan_token: ${{ secrets.SAST_TOKEN }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v2.9.0
- Modify to create 2 builds - one for .net6 and one for .net8
- Update README to new DocTool format

v2.8.0
- Added new custom field - Remove Root Certificate from Chain - to allow adding certificate entries with the root CA certificate removed from the chain.
- Added SSH KeyboardInteractive Authentication support if Password Authentication is not enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public Pkcs12Store DeserializeRemoteCertificateStore(byte[] storeContentBytes, s
byte[] storeBytes = remoteHandler.DownloadCertificateFile($"{storePath}{tempCertFile}");
store.Load(new MemoryStream(storeBytes), string.IsNullOrEmpty(storePassword) ? new char[0] : storePassword.ToCharArray());
}
catch (Exception ex)
catch (Exception)
{
throw ex;
throw;
}
finally
{
Expand Down Expand Up @@ -90,9 +90,9 @@ public List<SerializedStoreInfo> SerializeRemoteCertificateStore(Pkcs12Store cer
storeInfo.Add(new SerializedStoreInfo() { Contents = storeContents, FilePath = storePath+storeFileName });
return storeInfo;
}
catch (Exception ex)
catch (Exception)
{
throw ex;
throw;
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public Pkcs12Store DeserializeRemoteCertificateStore(byte[] storeContentBytes, s
JKSCertificateStoreSerializer serializer = new JKSCertificateStoreSerializer(String.Empty);
store = serializer.DeserializeRemoteCertificateStore(storeBytes, $"{WorkFolder}{tempStoreFileJKS}", storePassword, remoteHandler, isInventory);
}
catch (Exception ex)
catch (Exception)
{
throw ex;
throw;
}
finally
{
Expand Down Expand Up @@ -101,9 +101,9 @@ public List<SerializedStoreInfo> SerializeRemoteCertificateStore(Pkcs12Store cer
storeInfo.Add(new SerializedStoreInfo() { Contents = storeContents, FilePath = storePath+storeFileName });
return storeInfo;
}
catch (Exception ex)
catch (Exception)
{
throw ex;
throw;
}
finally
{
Expand Down
2 changes: 1 addition & 1 deletion RemoteFile/Models/SerializedStoreInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Keyfactor.Extensions.Orchestrator.RemoteFile.Models
{
class SerializedStoreInfo : X509Certificate2
internal class SerializedStoreInfo
{
public string FilePath { get; set; }

Expand Down
13 changes: 8 additions & 5 deletions RemoteFile/RemoteFile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
Expand All @@ -20,10 +21,12 @@
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.2.12" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.5" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="SSH.NET" Version="2024.0.0" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="echo F | xcopy &quot;$(ProjectDir)config.json&quot; &quot;$(TargetDir)\config.json&quot; /Y&#xD;&#xA;echo F | xcopy &quot;$(ProjectDir)manifest.json&quot; &quot;$(TargetDir)\manifest.json&quot; /Y" />
</Target>
<None Update="manifest.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion RemoteFile/RemoteHandlers/LinuxLocalHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public override string RunCommand(string commandText, object[] arguments, bool w
catch (Exception ex)
{
_logger.LogError($"Exception during RunCommand...{RemoteFileException.FlattenExceptionMessages(ex, ex.Message)}");
throw ex;
throw;
}
}

Expand Down
2 changes: 1 addition & 1 deletion RemoteFile/RemoteHandlers/SSHHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal SSHHandler(string server, string serverLogin, string serverPassword, bo
privateKeyFile = new PrivateKeyFile(ms);
}
}
catch (Exception ex)
catch (Exception)
{
using (MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(ConvertToPKCS1(serverPassword))))
{
Expand Down
151 changes: 0 additions & 151 deletions RemoteFile/RemoteHandlers/SSHHelper.cs

This file was deleted.

6 changes: 3 additions & 3 deletions RemoteFile/RemoteHandlers/WinRMHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public override string RunCommand(string commandText, object[] parameters, bool
catch (Exception ex)
{
_logger.LogError($"Exception during RunCommand...{RemoteFileException.FlattenExceptionMessages(ex, ex.Message)}");
throw ex;
throw;
}
}

Expand Down Expand Up @@ -182,8 +182,8 @@ private byte[] RunCommandBinary(string commandText)

catch (Exception ex)
{
_logger.LogError("Exception during RunCommandBinary...{RemoteFileException.FlattenExceptionMessages(ex, ex.Message)}");
throw ex;
_logger.LogError($"Exception during RunCommandBinary...{RemoteFileException.FlattenExceptionMessages(ex, ex.Message)}");
throw;
}
}

Expand Down
Loading

0 comments on commit 0eb1602

Please sign in to comment.