Skip to content

Commit 65c597c

Browse files
author
Lee Fine
committed
1 parent 8282146 commit 65c597c

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
v4.1.0
22
- Add custom field to select legacy encryption for certificate stores
3+
- Improve error message when attempting a management or ODKG job and Ignore Private Key on Inventory is selected.
4+
- For RFKDB, retry gskcapicmd commands without "bash" on Linux if gskcapicmd CLI utility is a binary file.
35

46
v4.0.0
57
- Added ability to run post job commands for Management-Add and ODKG jobs.

RemoteFile/ImplementedStoreTypes/KDB/KDBCertificateStoreSerializer.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public Pkcs12Store DeserializeRemoteCertificateStore(byte[] storeContentBytes, s
3333
logger.MethodEntry(LogLevel.Debug);
3434

3535
string bashCommand = storePath.Substring(0, 1) == "/" ? "bash " : string.Empty;
36+
if (storePath.Substring(0, 1) == "|")
37+
storePath = "/" + storePath.Substring(1);
3638

3739
Pkcs12StoreBuilder storeBuilder = new Pkcs12StoreBuilder();
3840
Pkcs12Store store = storeBuilder.Build();
@@ -51,9 +53,15 @@ public Pkcs12Store DeserializeRemoteCertificateStore(byte[] storeContentBytes, s
5153
byte[] storeBytes = remoteHandler.DownloadCertificateFile($"{storePath}{tempCertFile}");
5254
store.Load(new MemoryStream(storeBytes), string.IsNullOrEmpty(storePassword) ? new char[0] : storePassword.ToCharArray());
5355
}
54-
catch (Exception)
56+
catch (Exception ex)
5557
{
56-
throw;
58+
if (ex.Message.Contains("cannot execute binary file", StringComparison.InvariantCultureIgnoreCase) && storePath.Substring(0, 1) == "/")
59+
{
60+
storePath = "|" + storePath.Substring(1);
61+
store = DeserializeRemoteCertificateStore(storeContentBytes, storePath, storePassword, remoteHandler, isInventory);
62+
}
63+
else
64+
throw;
5765
}
5866
finally
5967
{

0 commit comments

Comments
 (0)