login about faq

if (!key.LoadText(m_identityFile,outString))
{
key.LastErrorText(errorString);
m_logger.AddInfo(_bstr_t(L"LoadText is not able to load key file: ")+m_identityFile +errorString.getString(), "NucleusLink.SFTPHandler.Connect:" ); return false;
}
if(key.get_IsRsaKey())
{
outString = key.toOpenSshPrivateKey(false);
}
if(!key.FromOpenSshPrivateKey(outString))
{
key.LastErrorText(errorString);
}; }

The above code snippet is failing for my VC++ code throwing the below error:

ChilkatLog: FromOpenSshPrivateKey: DllDate: Aug 23 2013 ChilkatVersion: 9.4.1.46 UnlockPrefix: REDPRASSH Username: ATLGILBARCOPC:j1015615 Architecture: Little Endian; 32-bit Language: Visual C++ 7.0 VerboseLogging: 0 privateKey_content: -----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY----- Not encrypted. validating the key... RSA key is 0 b

I could not figure out what is the error here.

another error is:

for the code snippet:

    **if(!m_identityFile.length() != 0)
    {
        bAuthenticate = m_sftpClient.AuthenticatePw(m_strUserName, m_strPwd);
    }
    else
    {
        bAuthenticate = m_sftpClient.AuthenticatePk(m_strUserName, key);
    }**

Authenticate failed for User: BOS_SFTPChilkatLog: Connect_SFtp: DllDate: Aug 23 2013 ChilkatVersion: 9.4.1.46 UnlockPrefix: * Username: Architecture: Little Endian; 32-bit Language: Visual C++ 7.0 VerboseLogging: 0 SftpVersion: 0 hostname: 192.168.1.1 port: 22 ConnectTimeoutMs_1: 30000 calling ConnectSocket2 IPV6 enabled connect with NO heartbeat. This is an IPV4 numeric address... AddrInfoList:*

I have a quick delivery to my client tomorrow, this is the last stage of my development, any help from you will be highly appreciated.

asked Jun 23 '14 at 11:45

Kiriti's gravatar image

Kiriti
11

edited Jun 23 '14 at 13:38


You are using an older version of the library - I recommend trying again with the latest version, just in case the problem has already been fixed.

If the problem persists, please post your code and entire contents of the LastErrorText property in <pre></pre> tags.

link

answered Jun 23 '14 at 15:43

jpbro's gravatar image

jpbro ♦
1.1k2618

edited Jun 23 '14 at 19:57

But, my code runs on vc++ 7.1 will the latest version will support my existing code ? which version do you suggest for me is the best suit ? I need it to run for both on 32 as well as 64 bit version off OS

link

answered Jun 23 '14 at 22:42

Kiriti's gravatar image

Kiriti
11

Though my code runs on VC++ 7.1, I have tried using chilkat-9.5.0-x86-vc6 version of chilkat library,

getting the below error while loading the key file from the piece key.FromOpenSshPrivateKey(outString):

if(m_sftpClient.UnlockComponent(chilkatUnlockCode))
    {
        key.put_Password("secret");

if (!key.LoadText(m_identityFile,outString))
        {
            key.LastErrorText(errorString);
            m_logger.AddInfo(_bstr_t(L"LoadText is not able to load key file: ")+m_identityFile +errorString.getString(), "NucleusLink.SFTPHandler.Connect:" );
            return false;
        }

if(key.get_IsRsaKey())
        {
            outString = key.toOpenSshPrivateKey(false);
        }

if (!key.FromOpenSshPrivateKey(outString))
        {
            key.LastErrorText(errorString);
            m_logger.AddInfo( _bstr_t(L"FromOpenSshPrivateKey has wrong pass phrase or key file: ")+m_identityFile +errorString.getString()
                              , "NucleusLink.SFTPHandler.Connect:"
                            );
            //return false;
        }
 FromOpenSshPrivateKey has wrong pass phrase or key file: C:\Program Files\BlueCube\POSLink\Bin\boskeyChilkatLog: FromOpenSshPrivateKey: DllDate: Jun 10 2014 ChilkatVersion: 9.5.0.40 UnlockPrefix: REDPRASSH Username: ATLGILBARCOPC:j1015615 Architecture: Little Endian; 32-bit Language: Visual C++ 6.0 VerboseLogging: 0 fromOpenSshPrivateKey: decryptPem: Not encrypted. --decryptPem validating the key... validateDecryptedKey:
link

answered Jun 23 '14 at 23:56

Kiriti's gravatar image

Kiriti
11

The above seems to be working and authenticating my private key, but the trick here is on the 2nd try its authenticating failing for the first try.

if(!m_identityFile.length() != 0)
        {
            bAuthenticate = m_sftpClient.AuthenticatePw(m_strUserName, m_strPwd);
        }
        else if(m_isConnected)
        {
            for(int i=0; !bAuthenticate && i<=3;)
            {
                bAuthenticate = m_sftpClient.AuthenticatePk(m_strUserName, key);

if(!bAuthenticate)
                {
                    i++;
                    m_logger.AddInfo(_bstr_t(L"Retrying Authentication for: ")+m_strUserName+errorString.getString(), "NucleusLink.SFTPHandler.Connect" );
                }
                else
                {
                    break;
                }
            }
        }
link

answered Jun 24 '14 at 01:13

Kiriti's gravatar image

Kiriti
11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×3

Asked: Jun 23 '14 at 11:45

Seen: 800 times

Last updated: Jun 24 '14 at 01:13

powered by OSQA