Merge pull request #1160 from hbons/key_types
fetcher: look for other host keys, not just RSA
This commit is contained in:
commit
2aef57c577
|
@ -270,10 +270,13 @@ namespace SparkleLib {
|
||||||
process.StartInfo.CreateNoWindow = true;
|
process.StartInfo.CreateNoWindow = true;
|
||||||
process.EnableRaisingEvents = true;
|
process.EnableRaisingEvents = true;
|
||||||
|
|
||||||
|
string [] key_types = {"rsa", "dsa", "ecdsa"};
|
||||||
|
|
||||||
|
foreach (string key_type in key_types) {
|
||||||
if (RemoteUrl.Port < 1)
|
if (RemoteUrl.Port < 1)
|
||||||
process.StartInfo.Arguments = "-t rsa -p 22 " + RemoteUrl.Host;
|
process.StartInfo.Arguments = "-t " + key_type + " -p 22 " + RemoteUrl.Host;
|
||||||
else
|
else
|
||||||
process.StartInfo.Arguments = "-t rsa -p " + RemoteUrl.Port + " " + RemoteUrl.Host;
|
process.StartInfo.Arguments = "-t " + key_type + " -p " + RemoteUrl.Port + " " + RemoteUrl.Host;
|
||||||
|
|
||||||
SparkleLogger.LogInfo ("Cmd", process.StartInfo.FileName + " " + process.StartInfo.Arguments);
|
SparkleLogger.LogInfo ("Cmd", process.StartInfo.FileName + " " + process.StartInfo.Arguments);
|
||||||
|
|
||||||
|
@ -281,9 +284,10 @@ namespace SparkleLib {
|
||||||
string host_key = process.StandardOutput.ReadToEnd ().Trim ();
|
string host_key = process.StandardOutput.ReadToEnd ().Trim ();
|
||||||
process.WaitForExit ();
|
process.WaitForExit ();
|
||||||
|
|
||||||
if (process.ExitCode == 0 && !string.IsNullOrEmpty (host_key))
|
if (process.ExitCode == 0 && !string.IsNullOrWhiteSpace (host_key))
|
||||||
return host_key;
|
return host_key;
|
||||||
else
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue