Trouble using authPubkey authentication (wodSFTP / wodSFTP.NET / wodSFTPdll)
Hi, I'm developing a simple program in vc that has to extract a private key from a db and then do an ssh to an host using that key.
When I connect using password authentication everything works fine, but when I to use key auth the connect() method returns me a strange value (-2146798272).
I can't figure out what I'm doing wrong, can you help me ?
Thanks.
Damiano
Here's a sample of my code
m_SSH2->put_Blocking(VARIANT_TRUE);
m_SSH2->put_Hostname(ip);
m_SSH2->put_Login(user);
m_SSH2->put_Protocol(protocol);
m_SSH2->put_Authentication(authPubkey);
m_SSH2->put_Port(2222);
m_SSH2->put_Prompt(vExpectedPrompt);
//gets the private key from db
//row[1] holds is a pointer (char *) to the private key data
row= get_private_key();
numchar = (long) (strlen(row[1]));
Bufsize = (long) (sizeof(char *) * numchar);
SAFEARRAY *psa;
SAFEARRAYBOUND rgsabound[1];
char HUGEP *data;
rgsabound[0].lLbound=0;
rgsabound[0].cElements=Bufsize;
psa = SafeArrayCreate(VT_UI1,1,rgsabound);
if (!psa)
return WSA_NOT_ENOUGH_MEMORY;
SafeArrayAccessData(psa, (void HUGEP* FAR*)&data);
memcpy(data,row[1], Bufsize);
SafeArrayUnaccessData(psa);
VARIANT var;
var.vt =VT_ARRAY | VT_UI1;
var.parray=psa;
m_SSH2->put_PrivateKey(var);
ConnectRetCode = m_SSH2->Connect();
//Here ConnectRetCode is - 2146798272
Complete thread:
- Trouble using authPubkey authentication - Damiano, 2004-10-20, 09:46
- Re: Trouble using authPubkey authentication - wodSupport, 2004-10-20, 11:47
- Re: Trouble using authPubkey authentication - Damiano, 2004-10-20, 12:15
- Re: Trouble using authPubkey authentication - wodSupport, 2004-10-20, 12:17
- Re: Trouble using authPubkey authentication - Damiano, 2004-10-20, 12:32
- Re: Trouble using authPubkey authentication - wodSupport, 2004-10-20, 13:46
- Re: Trouble using authPubkey authentication - Damiano, 2004-10-20, 14:15
- Re: Trouble using authPubkey authentication - A. McDermott, 2005-11-21, 23:58
- Re: Trouble using authPubkey authentication - wodSupport, 2005-11-22, 00:00
- Re: Trouble using authPubkey authentication - A. McDermott, 2005-11-21, 23:58
- Re: Trouble using authPubkey authentication - Damiano, 2004-10-20, 14:15
- Re: Trouble using authPubkey authentication - wodSupport, 2004-10-20, 13:46
- Re: Trouble using authPubkey authentication - Damiano, 2004-10-20, 12:32
- Re: Trouble using authPubkey authentication - wodSupport, 2004-10-20, 12:17
- Re: Trouble using authPubkey authentication - Damiano, 2004-10-20, 12:15
- Re: Trouble using authPubkey authentication - wodSupport, 2004-10-20, 11:47