Menu

Tamir.SharpSSH Error/Windows Server 2012

Help
drdexter33
2014-06-16
2014-06-18
  • drdexter33

    drdexter33 - 2014-06-16

    We recently moved an application that uses SharpSSH from a Windows 2003 server to Windows 2012.

    While testing the SFTP functionality of our app we are receiving this error:

    {"Session.connect: System.NullReferenceException: Object reference not set to an instance of an object.\r\n at Tamir.SharpSsh.jsch.jce.HMACMD5.update(Byte[] foo, Int32 s, Int32 l)\r\n at Tamir.SharpSsh.jsch.jce.HMACMD5.update(Int32 i)\r\n at Tamir.SharpSsh.jsch.Session.read(Buffer buf)\r\n at Tamir.SharpSsh.jsch.UserAuth.start(Session session)\r\n at Tamir.SharpSsh.jsch.UserAuthNone.start(Session session)\r\n at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)"}

    I checked to make sure that the FIPS Compliant Algorithms are disabled and they are.

    Is SharpSSH compatible with Windows 2012 or is my problem elsewhere?

    Thanks.

    Doug

     
  • drdexter33

    drdexter33 - 2014-06-17

    Ok..

    So i've removed the dll's from my project and am stepping into the source code.

    It appears that the failure is occurring in HMACMD5.cs at line 69:

    public void update(byte[] foo, int s, int l)
    {
    //mac.update(foo, s, l);
    cs.Write( foo, s, l);
    }

    Where cs is NULL.

    It also appears that CS is an object reference to System.Security.Cryptography.CryptoStream and is set in the init() method of the same class.

    public void init(byte[] key)
    {
    if(key.Length>bsize)
    {
    byte[] tmp=new byte[bsize];
    Array.Copy(key, 0, tmp, 0, bsize);
    key=tmp;
    }
    // SecretKeySpec skey=new SecretKeySpec(key, "HmacMD5");
    // mac=Mac.getInstance("HmacMD5");
    // mac.init(skey);
    mentalis_mac = new Org.Mentalis.Security.Cryptography.HMAC(new System.Security.Cryptography.MD5CryptoServiceProvider(), key);
    cs = new System.Security.Cryptography.CryptoStream( System.IO.Stream.Null, mentalis_mac, System.Security.Cryptography.CryptoStreamMode.Write);
    }

    However this init method doesn't appear to be getting called so that object reference is NULL.

    Which is causing the error.

    At any rate I'm not sure exactly why this is failing.

    Thanks in advance for any help.

     
  • drdexter33

    drdexter33 - 2014-06-18

    I found that I was missing a reference to Org.Mentalis.Security.

    As soon as I added that, everything worked fine.

    Thanks

     

Log in to post a comment.

MongoDB Logo MongoDB