Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2016-08-30 11:00:48 +0300
committerKenneth Skovhede <kenneth@hexad.dk>2016-08-30 11:00:48 +0300
commitf3572892beb7f9c0fc6f8765998786ba5cf20b6f (patch)
tree702bb9ba906855777cc9ed8fbfc939141620eee3 /Duplicati/Library/Backend/SSHv2/SSHv2Backend.cs
parentc6c83b02464aa03e38e50288bc34a8bbd620a6b5 (diff)
Changed SSH backend to report invalid host keys via the HostKeyException
Diffstat (limited to 'Duplicati/Library/Backend/SSHv2/SSHv2Backend.cs')
-rw-r--r--Duplicati/Library/Backend/SSHv2/SSHv2Backend.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Duplicati/Library/Backend/SSHv2/SSHv2Backend.cs b/Duplicati/Library/Backend/SSHv2/SSHv2Backend.cs
index 4a7cd7543..fb7ab7d5a 100644
--- a/Duplicati/Library/Backend/SSHv2/SSHv2Backend.cs
+++ b/Duplicati/Library/Backend/SSHv2/SSHv2Backend.cs
@@ -32,7 +32,7 @@ namespace Duplicati.Library.Backend
public const string SSH_KEYFILE_OPTION = "ssh-keyfile";
public const string SSH_KEYFILE_INLINE = "ssh-key";
public const string SSH_FINGERPRINT_OPTION = "ssh-fingerprint";
- public const string SSH_FINGERPRINT_ACCEPT_ANY_OPTION = "shh-accept-any-fingerprints";
+ public const string SSH_FINGERPRINT_ACCEPT_ANY_OPTION = "ssh-accept-any-fingerprints";
public const string KEYFILE_URI = "sshkey://";
Dictionary<string, string> m_options;
@@ -255,10 +255,10 @@ namespace Duplicati.Library.Backend
string hostFingerprint = e.HostKeyName + " " + e.KeyLength.ToString() + " " + BitConverter.ToString(e.FingerPrint).Replace('-', ':');
if (string.IsNullOrEmpty(m_fingerprint))
- throw new Exception(Strings.SSHv2Backend.FingerprintNotSpecifiedManagedError(hostFingerprint.ToLower()));
+ throw new Library.Utility.HostKeyException(Strings.SSHv2Backend.FingerprintNotSpecifiedManagedError(hostFingerprint.ToLower(), SSH_FINGERPRINT_OPTION, SSH_FINGERPRINT_ACCEPT_ANY_OPTION), hostFingerprint, m_fingerprint);
if (hostFingerprint.ToLower() != m_fingerprint.ToLower())
- throw new Exception(Strings.SSHv2Backend.FingerprintNotMatchManagedError(hostFingerprint.ToLower()));
+ throw new Library.Utility.HostKeyException(Strings.SSHv2Backend.FingerprintNotMatchManagedError(hostFingerprint.ToLower()), hostFingerprint, m_fingerprint);
else
e.CanTrust = true;
};
@@ -293,7 +293,7 @@ namespace Duplicati.Library.Backend
public List<IFileEntry> List()
{
- List<IFileEntry> files = new List<IFileEntry>();
+ var files = new List<IFileEntry>();
string path = ".";