You are not logged in.

#1 2014-02-04 10:18:10

Desintegr
Member
From: Orléans - France
Registered: 2005-01-31
Posts: 20

[SOLVED] OpenSSH 6.5 6.6 hash mismatch error with H3C/HPswitches

Hi.

I have recently upgrade my OpenSSH client to version 6.5.
Now, I can't connect to some machines (H3C switches), I get the error : hash mismatch - key_verify failed for server_host_key

I downgrade to 6.4 : it works.

OpenSSH_6.4, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/damien/.ssh/config
debug1: /home/damien/.ssh/config line 1: Applying options for *
debug1: /home/damien/.ssh/config line 17: Applying options for rca*
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to rca0180913vsw254 [172.18.8.254] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/damien/.ssh/id_rsa-PERSO" as a RSA1 public key
debug1: identity file /home/damien/.ssh/id_rsa-PERSO type 1
debug1: identity file /home/damien/.ssh/id_rsa-PERSO-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/damien/.ssh/id_rsa-GIPRECIA" as a RSA1 public key
debug1: identity file /home/damien/.ssh/id_rsa-GIPRECIA type 1
debug1: identity file /home/damien/.ssh/id_rsa-GIPRECIA-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/damien/.ssh/id_rsa-TESSIE" as a RSA1 public key
debug1: identity file /home/damien/.ssh/id_rsa-TESSIE type 1
debug1: identity file /home/damien/.ssh/id_rsa-TESSIE-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.4
debug1: Remote protocol version 1.99, remote software version Comware-5.20
debug1: no match: Comware-5.20
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "rca0180913vsw254" from file "/home/damien/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/damien/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@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-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,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: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,des-cbc
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,des-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 126/256
debug2: bits set: 502/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 10:37:e4:6e:9e:ed:e6:49:11:49:93:04:92:b8:66:a0
debug3: load_hostkeys: loading entries for host "rca0180913vsw254" from file "/home/damien/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/damien/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "172.18.8.254" from file "/home/damien/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/damien/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'rca0180913vsw254' is known and matches the RSA host key.
debug1: Found key in /home/damien/.ssh/known_hosts:5
debug2: bits set: 528/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
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/damien/.ssh/id_rsa-PERSO (0x22ee180), explicit
debug2: key: /home/damien/.ssh/id_rsa-GIPRECIA (0x22ee1c0), explicit
debug2: key: /home/damien/.ssh/id_rsa-TESSIE (0x22ef9a0), explicit
debug3: input_userauth_banner

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*      Acces interdit a toutes personnes non autorisees       *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
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: Offering RSA public key: /home/damien/.ssh/id_rsa-PERSO
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/damien/.ssh/id_rsa-GIPRECIA
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/damien/.ssh/id_rsa-TESSIE
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp 20:d0:f7:5c:c0:97:92:bb:56:aa:7b:28:d6:76:6d:68
debug3: sign_and_send_pubkey: RSA 20:d0:f7:5c:c0:97:92:bb:56:aa:7b:28:d6:76:6d:68
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to rca0180913vsw254 ([172.18.8.254]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 131072 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0

******************************************************************************
* Copyright (c) 2004-2011 Hangzhou H3C Tech. Co., Ltd. All rights reserved.  *
* Without the owner's prior written consent,                                 *
* no decompiling or reverse-engineering shall be allowed.                    *
******************************************************************************

With OpenSSH 6.5 :

OpenSSH_6.5, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/damien/.ssh/config
debug1: /home/damien/.ssh/config line 1: Applying options for *
debug1: /home/damien/.ssh/config line 17: Applying options for rca*
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to rca0180913vsw254 [172.18.8.254] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/damien/.ssh/id_rsa-PERSO" as a RSA1 public key
debug1: identity file /home/damien/.ssh/id_rsa-PERSO type 1
debug1: identity file /home/damien/.ssh/id_rsa-PERSO-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/damien/.ssh/id_rsa-GIPRECIA" as a RSA1 public key
debug1: identity file /home/damien/.ssh/id_rsa-GIPRECIA type 1
debug1: identity file /home/damien/.ssh/id_rsa-GIPRECIA-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/damien/.ssh/id_rsa-TESSIE" as a RSA1 public key
debug1: identity file /home/damien/.ssh/id_rsa-TESSIE type 1
debug1: identity file /home/damien/.ssh/id_rsa-TESSIE-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.5
debug1: Remote protocol version 1.99, remote software version Comware-5.20
debug1: no match: Comware-5.20
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "rca0180913vsw254" from file "/home/damien/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/damien/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@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,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@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,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,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: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,des-cbc
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,des-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: bits set: 2060/4096
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 10:37:e4:6e:9e:ed:e6:49:11:49:93:04:92:b8:66:a0
debug3: load_hostkeys: loading entries for host "rca0180913vsw254" from file "/home/damien/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/damien/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "172.18.8.254" from file "/home/damien/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/damien/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'rca0180913vsw254' is known and matches the RSA host key.
debug1: Found key in /home/damien/.ssh/known_hosts:5
debug2: bits set: 2072/4096
hash mismatch
debug1: ssh_rsa_verify: signature incorrect
key_verify failed for server_host_key

From OpenSSH 6.5 release note :

* ssh(1), sshd(8): Refuse RSA keys from old proprietary clients and
   servers that use the obsolete RSA+MD5 signature scheme. It will
   still be possible to connect with these clients/servers but only
   DSA keys will be accepted, and OpenSSH will refuse connection
   entirely in a future release.

* ssh(1), sshd(8): Refuse old proprietary clients and servers that
   use a weaker key exchange hash calculation.

How do I know if I am in this case ?

Last edited by Desintegr (2014-05-07 09:26:28)

Offline

#2 2014-02-16 19:07:43

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [SOLVED] OpenSSH 6.5 6.6 hash mismatch error with H3C/HPswitches

diff wrote:

-debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
+debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
-debug2: dh_gen_key: priv key bits set: 126/256
-debug2: bits set: 502/1024
+debug2: bits set: 2060/4096
-debug2: bits set: 528/1024
-debug1: ssh_rsa_verify: signature correct
+debug2: bits set: 2072/4096
+hash mismatch
+debug1: ssh_rsa_verify: signature incorrect
+key_verify failed for server_host_key

I suggest you regenerate new keys and find out?


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#3 2014-05-07 07:28:37

Desintegr
Member
From: Orléans - France
Registered: 2005-01-31
Posts: 20

Re: [SOLVED] OpenSSH 6.5 6.6 hash mismatch error with H3C/HPswitches

Hi.

Thank you for you reply but it's not a key problem.

I have found this :
- https://red.libssh.org/issues/159 : curve25519-sha256@libssh.org KexAlgo Can Send Truncated 'K' Values, Failing Signature Validation
- https://bugzilla.mindrot.org/show_bug.cgi?id=2232 Signature Failures When 'ssh' Used with Dropbear, libssh Servers
- https://bugzilla.mindrot.org/show_bug.cgi?id=2233 Signature Failures When 'sshd' Used with Dropbear Clients

OpenSSH >6.5 have problems with Dropbear, libssh servers and certainly my H3C switches.

When testing a libssh server with a newer OpenSSH (anything at or beyond version 6.5p1,
when curve25519-sha256@libssh.org became the preferred key exchange algorithm), I hit
failures once in roughly every thousand key exchanges

Yes, there's a bug in 6.5 and 6.5 that causes one of the components of the shared secret to be encoded incorrectly in about 0.2% of cases.
OpenSSH 6.7 will disable the curve25519 KEX when speaking to <6.7. I suggest that Dropbear do the same.

OpenSSH 6.7 should fix this problem.

Offline

#4 2014-05-07 08:11:35

Desintegr
Member
From: Orléans - France
Registered: 2005-01-31
Posts: 20

Re: [SOLVED] OpenSSH 6.5 6.6 hash mismatch error with H3C/HPswitches

I tried to deactivate the curve25519-sha256@libssh.org KeyAlgo in my ssh_config file, but it seems to not fix my problem sad
I will keep OpenSSH 6.4 until 6.7 is release, but I don't know if 6.7 will solve my problem.

Offline

#5 2014-05-07 08:23:24

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [SOLVED] OpenSSH 6.5 6.6 hash mismatch error with H3C/HPswitches

Your previous post mentions a failure rate of 0.2%. Your initial post mentions a 100% failure rate.

Right?

Then these bugs are probably not the same as your issue.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#6 2014-05-07 09:25:09

Desintegr
Member
From: Orléans - France
Registered: 2005-01-31
Posts: 20

Re: [SOLVED] OpenSSH 6.5 6.6 hash mismatch error with H3C/HPswitches

I tried to connect to each H3C switch with OpenSSH 6.6p1.

I notice :
- switches with firmware release 1207, 2102, 2202 and 2221 work.
- switches with firmware release 2208 do not work : I get the hash mismatch error.

It may be a bug with this specific firmware and newer OpenSSH.
I think I'll keep OpenSSH 6.4 until I upgrade the switches firmware to the most recent 2221 firmware.

Thank you for your replies.

Offline

Board footer

Powered by FluxBB