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 (129 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

Cannot connect with ECDSA key

by Jasmine, Thursday, February 16, 2017, 16:48 (129 days ago) @ OvidiuC

Hi Ovidiu,

I just tried wodSFTP (latest version) and I was able to connect to the server without any problems. Can you please try the same, just to make sure we're using same code and it's not something that's fixed in latest version, since there were many changes on wodSFTP in last month.

If problem persists, we may need a way to duplicate it with same environment as yours.

Kind regards,
Jasmine.

Cannot connect with ECDSA key

by OvidiuC, Friday, February 17, 2017, 08:08 (128 days ago) @ Jasmine

Hi,

I tried the latest version of wodSFTP (3.8.3) and the connection using ECDSA key was successful.

Thank you and best regards,
Ovidiu