Skip to content

Commit

Permalink
Fixed Common.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelvds committed Jan 29, 2024
1 parent f13409a commit 325a927
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions src/fiskaltrust.Launcher/Commands/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,26 @@ public static async Task<int> HandleAsync<O, S>(
ECDiffieHellman? clientEcdh = null;
try
{
clientEcdh = await LoadCurve(launcherConfiguration.CashboxId!.Value, launcherConfiguration.AccessToken!, launcherConfiguration.ServiceFolder!, launcherConfiguration.UseOffline!.Value, useFallback: launcherConfiguration.UseLegacyDataProtection!.Value);
using var downloader = new ConfigurationDownloader(launcherConfiguration);
var exists = await downloader.DownloadConfigurationAsync(clientEcdh);
if (launcherConfiguration.UseOffline!.Value && !exists)
clientEcdh = await LoadCurve(launcherConfiguration.CashboxId!.Value, launcherConfiguration.AccessToken!, launcherConfiguration.ServiceFolder!, launcherConfiguration.UseOffline!.Value);
}
catch (Exception e)
{
Log.Fatal(e, "Could not load client curve.");
}

try
{
if (clientEcdh is not null)
{
Log.Warning("Cashbox configuration was not downloaded because UseOffline is set.");
using var downloader = new ConfigurationDownloader(launcherConfiguration);
var exists = await downloader.DownloadConfigurationAsync(clientEcdh);
if (launcherConfiguration.UseOffline!.Value && !exists)
{
Log.Warning("Cashbox configuration was not downloaded because UseOffline is set.");
}
}
}

catch (Exception e)
{
var message = "Could not download Cashbox configuration. ";
Expand Down

0 comments on commit 325a927

Please sign in to comment.