|
@@ -1613,6 +1613,21 @@ UnicodeString CutOpensshToken(UnicodeString & S)
|
|
|
return Result;
|
|
|
}
|
|
|
//---------------------------------------------------------------------
|
|
|
+static UnicodeString ConvertPathFromOpenssh(const UnicodeString & Path)
|
|
|
+{
|
|
|
+ // It's likely there would be forward slashes in OpenSSH config file and our load/save dialogs
|
|
|
+ // (e.g. when converting keys) work suboptimally when working with forward slashes.
|
|
|
+ UnicodeString Result = GetNormalizedPath(Path);
|
|
|
+ const UnicodeString HomePathPrefix = L"~";
|
|
|
+ if (StartsStr(HomePathPrefix, Result + L"\\"))
|
|
|
+ {
|
|
|
+ Result =
|
|
|
+ GetShellFolderPath(CSIDL_PROFILE) +
|
|
|
+ Result.SubString(HomePathPrefix.Length() + 1, Result.Length() - HomePathPrefix.Length());
|
|
|
+ }
|
|
|
+ return Result;
|
|
|
+}
|
|
|
+//---------------------------------------------------------------------
|
|
|
void TSessionData::ImportFromOpenssh(TStrings * Lines)
|
|
|
{
|
|
|
bool SkippingSection = false;
|
|
@@ -1705,17 +1720,11 @@ void TSessionData::ImportFromOpenssh(TStrings * Lines)
|
|
|
}
|
|
|
else if (SameText(Directive, L"IdentityFile"))
|
|
|
{
|
|
|
- // It's likely there would be forward slashes in OpenSSH config file and our load/save dialogs
|
|
|
- // (e.g. when converting keys) work suboptimally when working with forward slashes.
|
|
|
- UnicodeString Path = GetNormalizedPath(Value);
|
|
|
- const UnicodeString HomePathPrefix = L"~";
|
|
|
- if (StartsStr(HomePathPrefix, Path + L"\\"))
|
|
|
- {
|
|
|
- Path =
|
|
|
- GetShellFolderPath(CSIDL_PROFILE) +
|
|
|
- Path.SubString(HomePathPrefix.Length() + 1, Path.Length() - HomePathPrefix.Length());
|
|
|
- }
|
|
|
- PublicKeyFile = Path;
|
|
|
+ PublicKeyFile = ConvertPathFromOpenssh(Value);
|
|
|
+ }
|
|
|
+ else if (SameText(Directive, L"CertificateFile"))
|
|
|
+ {
|
|
|
+ DetachedCertificate = ConvertPathFromOpenssh(Value);
|
|
|
}
|
|
|
else if (SameText(Directive, L"KbdInteractiveAuthentication"))
|
|
|
{
|