Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

RSA authentication problem

From: mentus <mentus(at)terra.com.br>
Date: Sun Aug 03 2003 - 15:41:51 EDT

     I am having some weird crashes while using the ssh client. Sometimes it will work,but, apparently in a random fashion, it won't, giving me different errors. Most of them are like the following:

   $ssh user@host

         hash mismatch
         key_verify failed for server_host_key

     I know for sure there ISN'T a server problem. This happens once
in a while when I try to connect to any server.
     If I keep running the same 'ssh user@host' command many times,
I'll get a fine connection 80% of the time, hash mismatches 15% and  'Floating point exception' on the rest.

    I then removed my ~/.ssh/ folder and tried again. It will naturally complain about not knowing the host's authenticity, I reply
'yes' and it shows me

     "Warning: Permanently added 'host,ip' (RSA) to the list of known hosts".

    Then, sometimes it'll connect just fine to the server, and sometimes I get the same 'hash mismatch' error or, more rarely a
'floating point exception'.

     I had the openssh-3.6.1_p2 installed. What I tried first was recompiling it with nice CFLAGS (-O1 -march=i586), but it didn't wok. I then tried installing an older openssh version: openssh-3.5_p1. Same problem.

     After that I took more extreme measures. I copied the ssh binary from my Slackware 8.1 (openssh 3.2.1p1) to /usr/bin/ssh and tried it out a couple of times. It works most of the time but now I get a different error:

Do you need help?X

    ssh_rsa_verify: RSA_verify failed: error:04077068:rsa routines:RSA_verify:bad signature
  key_verify failed for server_host_key

     Now that started to get me mad. What I did next was looking through openssh's source code to track down where the heck this 'hash mismatch' was being triggered. It was on 'ssh-rsa.c'

      
        if (memcmp(decrypted + oidlen, hash, hlen) != 0) {
                error("hash mismatch");
                goto done;
        }

     Which didn't help me much since I never studied openssh's source
code before. What I tried then was a dirty out this
code snippet, patched openssh's and re-compiled it.

     It still works most of the time but now it'll give me a different error.

     ea45 6767 5834 eb50 0b3c 06d0 0baf 9d24   
     Disconnecting: Bad packet length -364550297. 

    Which means that my trick was useless. I then emerged installed openssh-3.6.1p2 again and now I'm back to zero and totally at loss.

    I've also noticed that the problem is not only on the client side but also on the daemon. When I try to connect from outside to my sshd I sometimes get:

   ssh_rsa_verify: RSA_verify failed: error:04077068:rsa routines:RSA_verify:bad signature

   key_verify failed for server_host_key

    Which makes me think it is not something directly related to the client but to the authentication routines.

Do you need more help?X

    I know it's not someone playing with my connection or trying to intercept it because openssh 3.2.1p1 (both client and deamon) work flawlessly on Slackware on the same machine.

    The Linux distribution I'm using is Gentoo (www.gentoo.org). I don't know if this is relevant but I've got openssl 0.9.6j installed, and the openssh versions aforementioned.

     What bothers me the most is this non-deterministic characteristic of it. Sometimes it will connect just fine, other's I'll get several
'hash mismatches'. Anyone has got any idea on what can I do about it?
Received on Sun Aug 3 17:31:37 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:03:01 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library