diff --git a/Sparkles/SSHFetcher.cs b/Sparkles/SSHFetcher.cs index 19931553..9f3d609f 100644 --- a/Sparkles/SSHFetcher.cs +++ b/Sparkles/SSHFetcher.cs @@ -34,6 +34,7 @@ namespace Sparkles { public override bool Fetch () { string host_key = FetchHostKey (); + bool host_key_warning; if (string.IsNullOrEmpty (RemoteUrl.Host) || host_key == null) { Logger.LogInfo ("Auth", "Could not fetch host key"); @@ -42,8 +43,6 @@ namespace Sparkles { return false; } - bool warn = true; - if (RequiredFingerprint != null) { string host_fingerprint; @@ -59,22 +58,21 @@ namespace Sparkles { return false; } - if (host_fingerprint == null || !RequiredFingerprint.Equals (host_fingerprint)) { + if (host_fingerprint == null || RequiredFingerprint!= host_fingerprint) { Logger.LogInfo ("Auth", "Fingerprint doesn't match"); errors.Add ("error: Host fingerprint doesn't match"); - + return false; } - - warn = false; + Logger.LogInfo ("Auth", "Fingerprint matches"); - + } else { Logger.LogInfo ("Auth", "Skipping fingerprint check"); + host_key_warning = true; } - - AcceptHostKey (host_key, warn); - + + AcceptHostKey (host_key, host_key_warning); return true; }