ECDSA fails from client OpenSSH_7.1p1, OpenSSL 1.0.2d to server Cerberus 8.0.0.3 SFTP

Think you've found a bug? Post a description here.

Moderator: Serin

Post Reply
thecon
Posts: 2
Joined: Tue Oct 11, 2011 8:04 am

ECDSA fails from client OpenSSH_7.1p1, OpenSSL 1.0.2d to server Cerberus 8.0.0.3 SFTP

Post by thecon » Tue Nov 24, 2015 1:51 pm

Cerberus 8.0.0.3 reports the following:

Incoming connection request on SSH interface 10 at 192.168.1.3
SSH FTP connection request accepted from 192.168.1.3
Client Identification: SSH-2.0-OpenSSH_7.1
Algorithm negotiation complete: Proceeding with key exchange
Kex: 'ecdh-sha2-nistp256' Host Key: 'ssh-rsa' C2S : 'aes128-ctr, hmac-sha2-256, none' S2C : 'aes128-ctr, hmac-sha2-256, none'
Public key presented matches public key for user 'root'
verifySignatureECC: Bad signature length 140 != 40
Error validating signature: error:00000000:lib(0):func(0):reason(0)
Signature failed verification with ecdsa-sha2-nistp521 type public key presented by user 'root'
User 'root' attempting password authentication but only public key authentication accepted
The client closed the connection
Connection terminated

The scenario is this:

Client is OpenSSH_7.1p1 connecting to Cerberus at SFTP 192.168.1.3, port 9314 using only keyfile with the following command:
sftp -P 9314 root@192.168.1.3

Server is Cerberus FTP 8.0.0.3 with:
Group: SSH Authenticate method: Public Key (only) with ECDSA (public ECDSA file specified)
User: root with permission from its Group
Server Manager - Security:
+Enable SSL/TLS (FIPS irrelevant)
Advanced irrelevant
Server key pair RSA 4096 Verified ok. (Irrelevant if, instead, it was a ECDSA)
Client Certificate Verification No.

The ECDSA key pair was created with the command:
ssh-keygen -b 521 -t ecdsa -o
the public was specified on the Cerberus, the private was in ~/.ssh/id_ecdsa.

Now, if I use another pair (on the Group SSH Authenticate Method: Public key (only) with RSA (public RSA file specified)
and private key at ~/.ssh/id_rsa, cerberus works as planned. Everything goes ok.

Mind you, if I use ECDSA without Cerberus (for example on an OpenSSH server), this ECDSA keypair works ok.

For your refernce: Logfile for the sftp command (ECDSA):

OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.1.3 [192.168.1.3] port 9314.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version SshServer
debug1: no match: SshServer
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 192.168.1.3:9314 as 'root'
debug3: put_host_port: [192.168.1.3]:9314
debug3: hostkeys_foreach: reading file "/home/root/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/root/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from [192.168.1.3]:9314
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa
debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc,3des-cbc
debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc,3des-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-md5
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-md5
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: en-US
debug2: kex_parse_kexinit: en-US
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug1: kex: server->client aes128-ctr hmac-sha2-256 none
debug1: kex: client->server aes128-ctr hmac-sha2-256 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:+{{{{{REMOVED FOR PRIVACY}}}}}
debug3: put_host_port: [192.168.1.3]:9314
debug3: put_host_port: [192.168.1.3]:9314
debug3: hostkeys_foreach: reading file "/home/root/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/root/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from [192.168.1.3]:9314
debug3: hostkeys_foreach: reading file "/home/root/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /home/root/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys from [192.168.1.3]:9314
debug1: Host '[192.168.1.3]:9314' is known and matches the RSA host key.
debug1: Found key in /home/root/.ssh/known_hosts:1
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/root/.ssh/id_rsa (0x0),
debug2: key: /home/root/.ssh/id_dsa (0x0),
debug2: key: /home/root/.ssh/id_ecdsa (0x0),
debug2: key: /home/root/.ssh/id_ed25519 (0x0),
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/root/.ssh/id_rsa
debug3: no such identity: /home/root/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /home/root/.ssh/id_dsa
debug3: no such identity: /home/root/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/root/.ssh/id_ecdsa
Enter passphrase for key '/home/root/.ssh/id_ecdsa':
debug3: sign_and_send_pubkey: ECDSA SHA256:{{{{{REMOVED FOR PRIVACY}}}}}
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/root/.ssh/id_ed25519
debug3: no such identity: /home/root/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

After which, password is requested (I only want keyfile authentication)

User avatar
Serin
Site Administrator
Posts: 1785
Joined: Sat Jan 01, 2005 6:57 pm
Location: United States
Contact:

Re: ECDSA fails from client OpenSSH_7.1p1, OpenSSL 1.0.2d to server Cerberus 8.0.0.3 SFTP

Post by Serin » Wed Nov 25, 2015 2:15 pm

Hello,

Thanks for the bug report. I can duplicate the issue, and I have a fix ready. It will be included in the next minor release.

Post Reply