Subject: RE: IPv6 Support Query

RE: IPv6 Support Query

From: Kumar, Ashish <Ashish.Kumar_at_ca.com>
Date: Mon, 21 Dec 2009 12:15:36 +0530

Hello ,

 

Further to my investigation , I see some issues with below method .

 

int _libssh2_transport_read(LIBSSH2_SESSION * session)

 

in transport.c

 

 

Background : I have a linux BOX with IPv4 & IPv6 stack and IPv6 address
is a local-link address . sshd on linux box is listening on port 22
having ip6 socket . Now I have used libssh2 to do ssh in my code and it
has been working fine till we identified this issue .

I have created socket using IP4 address and port 22 and I did so because
I could connect using putty as well plink using ip4 address and port-22

 

 

I have used "libssh2_userauth_password" method for password
authentication which in-turn calls

int _libssh2_transport_read(LIBSSH2_SESSION * session)

to read from socket and data is even read from socket as in the below
call nread = 68 .

 

nread =

                _libssh2_recv(session->socket_fd, &p->buf[remainbuf],

                              PACKETBUFSIZE - remainbuf,

                              LIBSSH2_SOCKET_RECV_FLAGS(session));

 

 

And even below call shows the data in encrypted format

 

debugdump(session, "libssh2_transport_read() raw",&p->buf[remainbuf],
nread);

 

 

but as a result of call to below method

 

rc = decrypt(session, &p->buf[p->readidx], block, blocksize);

 

"p->buf" & "block" becomes an empty string with rc = 0 .

 

Although "p->init" as well as "p->buf" are empty string . Even "block"
is an empty string .

 

Furthere there is a call to

 

p->padding_length = block[4]; where-in Junk value is copied .

 

Further down below operation copies junk value

 

memcpy(p->wptr, &block[5], blocksize - 5);

 

Below method further down return 51.

rc = fullpacket(session, encrypted);

 

when I see in

 

static int

userauth_password(LIBSSH2_SESSION *session, const char *username,

                  unsigned int username_len, const char *password,

                  unsigned int password_len,

                  LIBSSH2_PASSWD_CHANGEREQ_FUNC((*passwd_change_cb)))

 

I see that

session->userauth_pswd_data[0] = 3

 

in password_response:

 

And finally there is a return of value "-1" meaning password
authentication failed .

 

On the contrary , I am easily able to login using putty using same user
password which I have used in the code .

 

 

I am sorry for being bit elaborate , but please help me identifying my
issue . I am even attaching a small screen-shot for your reference .

 

 

Thanks

Ashish

From: libssh2-devel-bounces_at_cool.haxx.se
[mailto:libssh2-devel-bounces_at_cool.haxx.se] On Behalf Of Jeremy Knope
Sent: Friday, December 18, 2009 8:38 PM
To: libssh2 development
Subject: Re: IPv6 Support Query

 

I use libssh2 just fine with both IPv6 & IPv4. Your program is the one
that has to establish the actual socket connection so it's up to you to
support it in you program.

--
Jeremy Knope / Software Developer / Ambrosia Software, Inc. -- 
http://www.AmbrosiaSW.com/
 
On Dec 18, 2009, at 8:11 AM, Kumar, Ashish wrote:
Can you please tell me if libssh2 supports IPv6 ssh ?
 
acm-suse9:/proc # lsof -i :22
COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME
sshd     4972 root    3u  IPv6   7480       TCP *:ssh (LISTEN)
sshd    25032 root    4u  IPv6 287309       TCP
acm-suse9.ca.com:ssh->kumas09-xp.ca.com:dsdn (ESTABLISHED)
sshd    25348 root    4u  IPv6 288321       TCP
acm-suse9.ca.com:ssh->kumas09-xp.ca.com:gv-us (ESTABLISHED)
 
"while ((rc = libssh2_userauth_password(session, username, password)) ==
LIBSSH2_ERROR_EAGAIN);"
 
this method is always returning -1 .
 
Thanks & Regards, 
Ashish Kumar 
 
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
 


_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Received on 2009-12-21