AndFTP fails connect to SSHD using elliptic curve crypto

FTP client for Android handsets.

AndFTP fails connect to SSHD using elliptic curve crypto

Postby bari » Sat May 10, 2014 4:18 pm

The OpenSSH SSHD servers I use for remote AndFTPPro SFTP backup targets have had their security tightened up. They've moved to support for specific/preferred Elliptic Curve crypto, and limited to strong(er) crypto, in general.

They're OpenSSH v6.6 servers, and their config's been changed to include:
Code: Select all
   Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,arcfour
   MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-64@openssh.com
   KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256

With any/all OpenSSH v6.6 clients, this works perfectly.

With AndFTP, if I switch to either an ECDSA or ed25519 openssh-generated private key on my mobile (both fully/officially supported by OpenSSH), at connect attempt to the same server, connection fails.

The 1st error reported at the server is:
Code: Select all
   May 10 09:05:13 server sshd[15941]: fatal: no matching mac found: client hmac-sha1-96,hmac-sha1,hmac-md5-96,hmac-md5 server hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-64@openssh.com [preauth]

Dropping MACs to default settings by commenting out the server's MACs assignment:
Code: Select all
   Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,arcfour
-   MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-64@openssh.com
+   #MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-64@openssh.com
   KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256

fixes that problem, and exposes the next error, @ server
Code: Select all
   May 10 09:07:04 server sshd[16023]: fatal: Unable to negotiate a key exchange method [preauth]

Dropping also KexAlgorithms to default settings:
Code: Select all
   Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,arcfour
   #MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-64@openssh.com
-   KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
+   #KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256

removes that second error @ server, but the connection still fails, this time error @ AndFTP:
Code: Select all
   PublicKey authentication failed: java.io.IOException:  Invalid PEM structure, '----BEGIN' missing.

But if I check the PRIV key (here a ed25519 variant) on the phone, it's structure is:
Code: Select all
   cat ssh.testkey.ed25519
      -----BEGIN OPENSSH PRIVATE KEY-----
      ...

where for the RSA privkey variant:
Code: Select all
   cat ssh.mobile.rsa
      -----BEGIN RSA PRIVATE KEY-----
      ...

How do we get AndFTP to communicate with modern OpenSSH versions using EC crypto? Is it additional local config, or an upgrade to AndFTP's OpenSSH that's required? Simplest would probably be to know/use OpenSSH 6.6 ...
bari
 
Posts: 12
Joined: Sat Dec 31, 2011 10:10 pm

Re: AndFTP fails connect to SSHD using elliptic curve crypto

Postby support » Sun May 25, 2014 8:18 am

We're going to see if we can add it.
support
 
Posts: 1010
Joined: Sun Apr 20, 2008 4:40 pm

Re: AndFTP fails connect to SSHD using elliptic curve crypto

Postby rajil.s » Mon Jan 12, 2015 2:59 am

Any update on this?
Andftp doesnt connect to my server with the following MACs
Code: Select all
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com
rajil.s
 
Posts: 1
Joined: Mon Jan 12, 2015 2:54 am

Re: AndFTP fails connect to SSHD using elliptic curve crypto

Postby support » Sun Jan 25, 2015 4:11 pm

It should work with AndFTP 4.2, we added DH-SHA256. We have a beta version if you want to test it. You can ask it to support(at)lysesoft(dot)com
support
 
Posts: 1010
Joined: Sun Apr 20, 2008 4:40 pm


Return to AndFTP



cron

Sitemap | Privacy Statement | Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
in the U.S. and other countries. All other company and/or product names are the property of their respective owners.