Cannot connect with ECDSA key - WeOnlyDo Discussion board

Cannot connect with ECDSA key (wodSFTP / wodSFTP.NET / wodSFTPdll)

by OvidiuC, Thursday, February 16, 2017, 14:07 (2624 days ago)

Hello,

I have a small application in DELPHI who use wodSFTP.ocx and wodKeys.dll and I tried to connect on a SSH server using RSA, DSA and ECDSA keys, protected with password. If I use a RSA or a DSA key the connection is OK. If I use ECDSA key the connection isn’t OK.
The connection procedure is:

[code]procedure TForm1.Button1Click(Sender: TObject);
var
mtkey: Tkeys;
begin
wodSFTP1.Hostname := Edit1.Text;
wodSFTP1.Login := Edit2.Text;
wodSFTP1.Authentication := authPubkey;
mtkey := TKeys.Create(nil);
mtkey.Load('id_pkey', Edit3.Text);
try
wodSFTP1.PrivateKey := mtkey.PrivateKey[0]; // RSAkey
except
try
wodSFTP1.PrivateKey := mtkey.PrivateKey[1]; // DSAkey
except
try
wodSFTP1.PrivateKey := mtkey.PrivateKey[2]; // ECDSAkey
except
ShowMessage('Unknown key type!');
end;
end;
end;
mtkey.Destroy;
wodSFTP1.Connect;
end;[/code]

The RSA, DSA and ECDSA key were generated with another small program who use wodKeys.dll.
Using the same ECDSA key I succeed to connect to same server using “ssh -i <ecdsa_key> <user>@<ip_server>”.
In the server sshd log we have:

Feb 16 13:57:39 cmctm19 sshd[5219]: SSH: Server;Ltype: Version;Remote: 135.247.162.250-49675;Protocol: 2.0;Client: WeOnlyDo DEMO 3.8.3.202
Feb 16 13:57:39 cmctm19 sshd[5219]: SSH: Server;Ltype: Kex;Remote: 135.247.162.250-49675;Enc: aes128-ctr;MAC: hmac-sha2-256-etm@openssh.com;Comp: none [preauth]
Feb 16 13:57:39 cmctm19 sshd[5219]: SSH: Server;Ltype: Authname;Remote: 135.247.162.250-49675;Name: security [preauth]
Feb 16 13:57:39 cmctm19 sshd[5219]: error: key_verify: key type does not match
Feb 16 13:57:39 cmctm19 sshd[5219]: Connection closed by 135.247.162.250 port 49675 [preauth]

Is necessary to connect otherwise when the ECDSA key is used?
Do I need to assign new parameters wodSFTP before connecting?

Thanks,
Ovidiu


Complete thread: