From libssh2-devel-bounces@cool.haxx.se  Thu Mar  3 08:07:19 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2376sRv011550;
	Thu, 3 Mar 2016 08:07:15 +0100
Received: from nm35-vm1.bullet.mail.sg3.yahoo.com
 (nm35-vm1.bullet.mail.sg3.yahoo.com [106.10.151.44])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2376m6p011338
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Thu, 3 Mar 2016 08:06:51 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1456988802; bh=lWRXK9A18kaiDtuBbnPCviUfjAg/unGWAbfQ0mum/bw=;
 h=Date:From:Reply-To:To:Subject:References:From:Subject;
 b=i1PZd3PjWSGNKhLnq1cvFdBB6spOXsmwYt46sPkhRhUPiKOCPGg58ER+joLjxp1PwisWKfHx3rOVUbSmAG+a14Wvp4SQ9HprhJOXM5+MMcm1eMWv0PZAXAsIs4r9a9FAxhEq6EHNsC8hbmVYIDFtW/POgFaMti27JjAzpnO0Z8G7u996cBtZUAscGfaGFY2JUTr8tIpbRb1dwvBHk/2qSl5+ErCMt6/nFrto4NDrybbhcC9a6oqamaxQcL0ajSJJECBh+VY5pWQnIzyR5JbeBhxWffDBXVKAoj4OyEV+x0LH+enTtTLwyVIbn9FIvk+EQzGfo+TnXRC8Mydf3rBVsQ==
Received: from [106.10.166.123] by nm35.bullet.mail.sg3.yahoo.com with NNFMP;
 03 Mar 2016 07:06:42 -0000
Received: from [106.10.151.138] by tm12.bullet.mail.sg3.yahoo.com with NNFMP;
 03 Mar 2016 07:06:42 -0000
Received: from [127.0.0.1] by omp1006.mail.sg3.yahoo.com with NNFMP;
 03 Mar 2016 07:06:42 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 650599.92664.bm@omp1006.mail.sg3.yahoo.com
X-YMail-OSG: HZOHJkAVM1kIfEOOGTqMwqneKe8d6bNUjRJamhP4QV9aIALDMSfcZv8NATt19oe
 PYvXJWtRkZTISPkmzncripdG8RcHPBXg9Z0JL6bvqlxnqrTZn_sOcBVHZ44Snfm7Srb4d7HfUp2V
 fgY1YejWdtVWH2wLEFyVoA6mK3mFZlqXQ_pZLxJSPixO5ubGUJCKuiyS5HzxtjjbzXkLlcI7n2rw
 wm173fJQkaMvsEqrOqV6YBR8BIXZpTA6qHdNLfvtKQmixe8.RfwU2FuJXQRScwXrIqOFRVQ.pEsq
 0WQSP5jHE4cE.BAi8eKw6UQbryvML6BIzM1IPkSqEsN0N.ThPorkZ3RGDDjEkZe40DR8phXK8.eA
 Gu3rJe3HOTH.nDnx2449pr4yNiJd.FITpnAq8y7SLIuiV.nhPjuWK04IwwE5BSMPA91W7mlHsUrn
 D7f_7RNPLL1WOWGUt.TS4jLSs2pFKOIwW_Ehbgsuj3B.571rjs3z.HDYfSPZ4JUaKqYomjwa6Z.c
 n3YJK9V5OOJj1TasL4sZLfhMibB3sXpJaOtyKKw--
Received: by 106.10.196.89; Thu, 03 Mar 2016 07:06:42 +0000 
Date: Thu, 3 Mar 2016 07:06:41 +0000 (UTC)
From: Minal Patil <minalkpatil9@yahoo.com>
To: "libssh2-devel@cool.haxx.se" <libssh2-devel@cool.haxx.se>
Message-ID: <464166377.1942839.1456988801863.JavaMail.yahoo@mail.yahoo.com>
Subject: receiving LIBSSH2_ERROR_SOCKET_RECV in libssh2_channel_read though
 connection seems to be fine
MIME-Version: 1.0
References: <464166377.1942839.1456988801863.JavaMail.yahoo.ref@mail.yahoo.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: Minal Patil <minalkpatil9@yahoo.com>,
        libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============1416465803=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============1416465803==
Content-Type: multipart/alternative; 
	boundary="----=_Part_1942838_1247764434.1456988801860"

------=_Part_1942838_1247764434.1456988801860
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello Sir/madam,
I am writing a multi threaded application which connects to multiple hosts =
and executes multiple commands on remote hosts and returns the result using=
 libssh2 version 1.6.00.

I am getting LIBSSH2_ERROR_SOCKET_RECV in libssh2_channel_read if i add any=
 host which exists but donot have sshd running on it. The error is observed=
 when main thread is attempting to connect the host host which exists but d=
onot have sshd running (I will call this as a bad host). Though not everyti=
me this is seen. Also if i go ahead and reattempt the libssh2_channel_read =
the same seems to be working perfectly fine.
Now if is remove the bad host from host list, everything seems to be workin=
g perfectly fine.=20
Can you please help me identify what could be the reason for libssh2_channe=
l_readto return LIBSSH2_ERROR_SOCKET_RECV.
Appreciate you time and feedback on this.=20

Thanks & Regards,=C2=A0
MINAL PATIL
Pune | Mobile : +91 7350014029 | Mail : minalkpatil9@yahoo.com
------=_Part_1942838_1247764434.1456988801860
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div style=3D"color:#000; background-color:#fff; f=
ont-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, =
Sans-Serif;font-size:12px"><div id=3D"yui_3_16_0_1_1456988022905_4312"><spa=
n>Hello Sir/madam,</span></div><div id=3D"yui_3_16_0_1_1456988022905_4471">=
<br><span></span></div><div dir=3D"ltr" id=3D"yui_3_16_0_1_1456988022905_44=
87"><span id=3D"yui_3_16_0_1_1456988022905_4486">I am writing a multi threa=
ded application which connects to multiple hosts and executes multiple comm=
ands on remote hosts and returns the result using libssh2 version 1.6.00.<b=
r></span></div><div id=3D"yui_3_16_0_1_1456988022905_4507"><br></div><div d=
ir=3D"ltr" id=3D"yui_3_16_0_1_1456988022905_4514">I am getting LIBSSH2_ERRO=
R_SOCKET_RECV in libssh2_channel_read if i add any host which exists but do=
not have sshd running on it. The error is observed when main thread is atte=
mpting to connect the host host which exists but donot have sshd running (I=
 will call this as a bad host).<span id=3D"yui_3_16_0_1_1456988022905_4486"=
></span> Though not everytime this is seen. Also if i go ahead and reattemp=
t the libssh2_channel_read the same seems to be working perfectly fine.</di=
v><div id=3D"yui_3_16_0_1_1456988022905_4584" dir=3D"ltr"><br></div><div id=
=3D"yui_3_16_0_1_1456988022905_4585" dir=3D"ltr">Now if is remove the bad h=
ost from host list, everything seems to be working perfectly fine. <br></di=
v><div id=3D"yui_3_16_0_1_1456988022905_4586" dir=3D"ltr">Can you please he=
lp me identify what could be the reason  for libssh2_channel_readto return =
LIBSSH2_ERROR_SOCKET_RECV.</div><div id=3D"yui_3_16_0_1_1456988022905_4594"=
><br></div><div>Appreciate you time and feedback on this. <br></div><div id=
=3D"yui_3_16_0_1_1456988022905_4608"><br></div><div id=3D"yui_3_16_0_1_1456=
988022905_4234" class=3D"signature"><div id=3D"yui_3_16_0_1_1456988022905_4=
233" dir=3D"ltr" style=3D"margin-right:0px;font-family:verdana, helvetica, =
sans-serif;" align=3D"left"><span id=3D"yui_3_16_0_1_1456988022905_4232" la=
ng=3D"en-us"><font id=3D"yui_3_16_0_1_1456988022905_4231" face=3D"Verdana" =
color=3D"#808080" size=3D"1"><strong id=3D"yui_3_16_0_1_1456988022905_4230"=
>Thanks &amp; Regards,</strong></font></span><span id=3D"yui_3_16_0_1_14569=
88022905_4237" lang=3D"en-us"><font face=3D"Verdana">&nbsp;<br></font><b id=
=3D"yui_3_16_0_1_1456988022905_4236"><font id=3D"yui_3_16_0_1_1456988022905=
_4235" face=3D"Verdana" color=3D"#0000ff" size=3D"1">MINAL PATIL</font></b>=
<font face=3D"Verdana"><br></font><b id=3D"yui_3_16_0_1_1456988022905_4239"=
><font id=3D"yui_3_16_0_1_1456988022905_4238" face=3D"Verdana" color=3D"#9d=
9d9d" size=3D"1">Pune | Mobile : +91 7350014029 | Mail : minalkpatil9@yahoo=
.com</font></b></span></div></div></div></body></html>
------=_Part_1942838_1247764434.1456988801860--

--===============1416465803==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============1416465803==--

From libssh2-devel-bounces@cool.haxx.se  Tue Mar  8 07:31:35 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u286VBfb031788;
	Tue, 8 Mar 2016 07:31:31 +0100
Received: from nm28-vm10.bullet.mail.sg3.yahoo.com
 (nm28-vm10.bullet.mail.sg3.yahoo.com [106.10.151.153])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u286V5Z6031489
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 8 Mar 2016 07:31:08 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1457418659; bh=qs5ypv23EjY1RCtl/OeYtMoOe5x5VzQo3RS0/3M1790=;
 h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject;
 b=bZ7dCpNnW8rffOmrYtxV1sUBSQ30FajwdZVwWgLiGwc6tVxiOF8r4lnext6pdgcHxUl3WLLin474z2H9yJredb9imzcacFXhxlVDLMEIgp3lrQc4SuE3fIAduQaWscHOrWA9F+PpbbnlBWdDtEBoezTIeZoDfhrLChGEcQVEptGgOM9cOUCIiZ5Fc5m4mjAYagl3Ri5t4TiX6TGqJJHai0SPOZwblO+Sqx3xXXyYOc6OpsmpBEciAHUs2riolffMbMunhP78yhBCjw6iO4XP1znA12fnChKX8n1XxhoUJIVE81PQH+4CgF6xhn59ykdsrjKGE4BwFRLMUq+gQ20L5w==
Received: from [106.10.166.62] by nm28.bullet.mail.sg3.yahoo.com with NNFMP;
 08 Mar 2016 06:30:59 -0000
Received: from [106.10.150.25] by tm19.bullet.mail.sg3.yahoo.com with NNFMP;
 08 Mar 2016 06:30:59 -0000
Received: from [127.0.0.1] by omp1026.mail.sg3.yahoo.com with NNFMP;
 08 Mar 2016 06:30:59 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 657711.31572.bm@omp1026.mail.sg3.yahoo.com
X-YMail-OSG: z3iEm6cVM1mCyMquI5PHMwlnhACiyGeVK0lUjlD933aX9C1OHR_83fpcEYq28GI
 qqzLs9kOLG_zg0M_V7Gf8Ke9EQF_kGpWNIcc8q8caFRjhlfS0BYyFW2uBLwwbo6LUw47rG2Roxe_
 nl1FrpJ30ageSQAoDZpwoB_m5Q7bl5TyvfBeqNkCxOrqBShIh.YVjd_vvV7.zgHiK0NYKOfyMKuF
 3Z030nk5LzLfX0UE_kIQfEbknSnBVpLQ9.tmeY0RhKRqrOWA2cbRzZ70TuU7kX9DJJD44Pp4RfZO
 5V.GOWiDmO8oiuLTE6duREBrOF9toIsIE1LGJG8Nq3pd9E2O4oJ7euSUjkLZCKBtq6hMrlS0hCYG
 qyhGLNlpjSB3qhlENm7_LQDDNdibrPkmO28H77Sw8ua30VeIPP.J4lpFNBE3sqftLjLijq0T4e3N
 ZWzbaaoKT9eQqCiiwKFQiasif8YnC4OF2xe8eicnOMKX86sLvWFh6pc3rJZmryg6V70mTHpepYyB
 WP4rYhrFv2Z2_vYSDLJ693zdJz4M4cILOg.xXRw--
Received: by 106.10.196.88; Tue, 08 Mar 2016 06:30:59 +0000 
Date: Tue, 8 Mar 2016 06:30:58 +0000 (UTC)
From: Minal Patil <minalkpatil9@yahoo.com>
To: "libssh2-devel@cool.haxx.se" <libssh2-devel@cool.haxx.se>
Message-ID: <1450468371.3803616.1457418658927.JavaMail.yahoo@mail.yahoo.com>
In-Reply-To: <464166377.1942839.1456988801863.JavaMail.yahoo@mail.yahoo.com>
References: <464166377.1942839.1456988801863.JavaMail.yahoo.ref@mail.yahoo.com>
 <464166377.1942839.1456988801863.JavaMail.yahoo@mail.yahoo.com>
Subject: Re: receiving LIBSSH2_ERROR_SOCKET_RECV in libssh2_channel_read
 though connection seems to be fine
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: Minal Patil <minalkpatil9@yahoo.com>,
        libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============0239829161=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============0239829161==
Content-Type: multipart/alternative; 
	boundary="----=_Part_3803615_521785256.1457418658917"

------=_Part_3803615_521785256.1457418658917
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Would like to add that the issue observed only on AIX, whereas the issue no=
t reproducible when same code is used on Linux with the same remote hosts.
=C2=A0Thanks & Regards,=C2=A0
MINAL PATIL
Pune | Mobile : +91 9823613614 | Mail : minalkpatil9@yahoo.com=20

    On Thursday, 3 March 2016 12:36 PM, Minal Patil <minalkpatil9@yahoo.com=
> wrote:
=20

 Hello Sir/madam,
I am writing a multi threaded application which connects to multiple hosts =
and executes multiple commands on remote hosts and returns the result using=
 libssh2 version 1.6.00.

I am getting LIBSSH2_ERROR_SOCKET_RECV in libssh2_channel_read if i add any=
 host which exists but donot have sshd running on it. The error is observed=
 when main thread is attempting to connect the host host which exists but d=
onot have sshd running (I will call this as a bad host). Though not everyti=
me this is seen. Also if i go ahead and reattempt the libssh2_channel_read =
the same seems to be working perfectly fine.
Now if is remove the bad host from host list, everything seems to be workin=
g perfectly fine.=20
Can you please help me identify what could be the reason for libssh2_channe=
l_readto return LIBSSH2_ERROR_SOCKET_RECV.
Appreciate you time and feedback on this.=20

Thanks & Regards,=C2=A0
MINAL PATIL
Pune | Mobile : +91 7350014029 | Mail : minalkpatil9@yahoo.com

  
------=_Part_3803615_521785256.1457418658917
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div style=3D"color:#000; background-color:#fff; f=
ont-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, =
Sans-Serif;font-size:12px">Would like to add that the issue observed only o=
n AIX, whereas the issue not reproducible when same code is used on Linux w=
ith the same remote hosts.<br><div id=3D"yui_3_16_0_1_1457418205093_3485"><=
span></span></div><div id=3D"yui_3_16_0_1_1457418205093_3491">&nbsp;</div><=
div id=3D"yui_3_16_0_1_1457418205093_3388" class=3D"signature"><div id=3D"y=
ui_3_16_0_1_1457418205093_3387" dir=3D"ltr" style=3D"margin-right:0px;font-=
family:verdana, helvetica, sans-serif;" align=3D"left"><span lang=3D"en-us"=
><font face=3D"Verdana" color=3D"#808080" size=3D"1"><strong>Thanks &amp; R=
egards,</strong></font></span><span id=3D"yui_3_16_0_1_1457418205093_3386" =
lang=3D"en-us"><font face=3D"Verdana">&nbsp;<br></font><b><font face=3D"Ver=
dana" color=3D"#0000ff" size=3D"1">MINAL PATIL</font></b><font face=3D"Verd=
ana"><br></font><b id=3D"yui_3_16_0_1_1457418205093_3385"><font id=3D"yui_3=
_16_0_1_1457418205093_3384" face=3D"Verdana" color=3D"#9d9d9d" size=3D"1">P=
une | Mobile : +91 9823613614 | Mail : minalkpatil9@yahoo.com</font></b></s=
pan></div></div> <div class=3D"qtdSeparateBR"><br><br></div><div style=3D"d=
isplay: block;" class=3D"yahoo_quoted"> <div style=3D"font-family: Helvetic=
aNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-si=
ze: 12px;"> <div style=3D"font-family: HelveticaNeue, Helvetica Neue, Helve=
tica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir=3D"ltr"=
><font face=3D"Arial" size=3D"2"> On Thursday, 3 March 2016 12:36 PM, Minal=
 Patil &lt;minalkpatil9@yahoo.com&gt; wrote:<br></font></div>  <br><br> <di=
v class=3D"y_msg_container"><div id=3D"yiv6802028085"><div><div style=3D"co=
lor:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, H=
elvetica, Arial, Lucida Grande, Sans-Serif;font-size:12px;"><div id=3D"yiv6=
802028085yui_3_16_0_1_1456988022905_4312"><span>Hello Sir/madam,</span></di=
v><div id=3D"yiv6802028085yui_3_16_0_1_1456988022905_4471"><br><span></span=
></div><div dir=3D"ltr" id=3D"yiv6802028085yui_3_16_0_1_1456988022905_4487"=
><span id=3D"yiv6802028085yui_3_16_0_1_1456988022905_4486">I am writing a m=
ulti threaded application which connects to multiple hosts and executes mul=
tiple commands on remote hosts and returns the result using libssh2 version=
 1.6.00.<br></span></div><div id=3D"yiv6802028085yui_3_16_0_1_1456988022905=
_4507"><br></div><div dir=3D"ltr" id=3D"yiv6802028085yui_3_16_0_1_145698802=
2905_4514">I am getting LIBSSH2_ERROR_SOCKET_RECV in libssh2_channel_read i=
f i add any host which exists but donot have sshd running on it. The error =
is observed when main thread is attempting to connect the host host which e=
xists but donot have sshd running (I will call this as a bad host).<span id=
=3D"yiv6802028085yui_3_16_0_1_1456988022905_4486"></span> Though not everyt=
ime this is seen. Also if i go ahead and reattempt the libssh2_channel_read=
 the same seems to be working perfectly fine.</div><div id=3D"yiv6802028085=
yui_3_16_0_1_1456988022905_4584" dir=3D"ltr"><br></div><div id=3D"yiv680202=
8085yui_3_16_0_1_1456988022905_4585" dir=3D"ltr">Now if is remove the bad h=
ost from host list, everything seems to be working perfectly fine. <br></di=
v><div id=3D"yiv6802028085yui_3_16_0_1_1456988022905_4586" dir=3D"ltr">Can =
you please help me identify what could be the reason  for libssh2_channel_r=
eadto return LIBSSH2_ERROR_SOCKET_RECV.</div><div id=3D"yiv6802028085yui_3_=
16_0_1_1456988022905_4594"><br></div><div>Appreciate you time and feedback =
on this. <br></div><div id=3D"yiv6802028085yui_3_16_0_1_1456988022905_4608"=
><br></div><div id=3D"yiv6802028085yui_3_16_0_1_1456988022905_4234" class=
=3D"yiv6802028085signature"><div id=3D"yiv6802028085yui_3_16_0_1_1456988022=
905_4233" dir=3D"ltr" style=3D"margin-right:0px;font-family:verdana, helvet=
ica, sans-serif;" align=3D"left"><span id=3D"yiv6802028085yui_3_16_0_1_1456=
988022905_4232" lang=3D"en-us"><font id=3D"yiv6802028085yui_3_16_0_1_145698=
8022905_4231" face=3D"Verdana" color=3D"#808080" size=3D"1"><strong id=3D"y=
iv6802028085yui_3_16_0_1_1456988022905_4230">Thanks &amp; Regards,</strong>=
</font></span><span id=3D"yiv6802028085yui_3_16_0_1_1456988022905_4237" lan=
g=3D"en-us"><font face=3D"Verdana">&nbsp;<br></font><b id=3D"yiv6802028085y=
ui_3_16_0_1_1456988022905_4236"><font id=3D"yiv6802028085yui_3_16_0_1_14569=
88022905_4235" face=3D"Verdana" color=3D"#0000ff" size=3D"1">MINAL PATIL</f=
ont></b><font face=3D"Verdana"><br></font><b id=3D"yiv6802028085yui_3_16_0_=
1_1456988022905_4239"><font id=3D"yiv6802028085yui_3_16_0_1_1456988022905_4=
238" face=3D"Verdana" color=3D"#9d9d9d" size=3D"1">Pune | Mobile : +91 7350=
014029 | Mail : minalkpatil9@yahoo.com</font></b></span></div></div></div><=
/div></div><br><br></div>  </div> </div>  </div></div></body></html>
------=_Part_3803615_521785256.1457418658917--

--===============0239829161==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============0239829161==--

From libssh2-devel-bounces@cool.haxx.se  Tue Mar 15 06:42:01 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2F5fZ9v004347;
	Tue, 15 Mar 2016 06:41:58 +0100
Received: from pv33p03im-asmtp001.me.com (pv33p03im-asmtp001.me.com
 [17.143.180.10])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2F5fWtD004278
 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 15 Mar 2016 06:41:33 +0100
Received: from [172.16.52.2]
 (c-24-14-137-179.hsd1.il.comcast.net [24.14.137.179])
 by pv33p03im-asmtp001.me.com
 (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015))
 with ESMTPSA id <0O4200F567GU6600@pv33p03im-asmtp001.me.com> for
 libssh2-devel@cool.haxx.se; Tue, 15 Mar 2016 02:41:20 +0000 (GMT)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,,
 definitions=2016-03-15_01:,, signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 clxscore=1011 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0
 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1510270003 definitions=main-1603150037
From: "Craig A. Berry" <craigberry@mac.com>
Content-type: multipart/mixed;
 boundary="Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC"
Subject: [PATCH] VMS updates
Message-id: <F535B35F-73D9-42E5-96A0-C59976A90B19@mac.com>
Date: Mon, 14 Mar 2016 21:41:18 -0500
To: libssh2-devel@cool.haxx.se
MIME-version: 1.0 (Mac OS X Mail 9.2 \(3112\))
X-Mailer: Apple Mail (2.3112)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>


--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

A few years ago Jose Baars ported libssh2 to OpenVMS.  I took it for a =
spin recently and there were a handful of changes necessary to catch up =
with changes since.  I=E2=80=99ve attached five patches generated with =
git format-patch and also include the commit messages inline below.  =
Please let me know if there are any questions or a better way to submit =
these.


commit 57f7f6e2a92b3cc1699e569ccdc489be79421791
Author: Craig A. Berry <craigberry@mac.com>
Date:   Sun Mar 13 13:29:16 2016 -0500

    Tweak VMS help file building.

    Primarily this is handling cases where top-level files moved into
    the docs/ directory.  I also corrected a typo and removed the
    claim that libssh2 is public domain.


commit 54fe6cef48102c73c5dac3ea15d18eb216c76359
Author: Craig A. Berry <craigberry@mac.com>
Date:   Sun Mar 13 10:20:10 2016 -0500

    Build with standard stat structure on VMS.

    This gets us large file support, is available on any VMS release
    in the last decade and more, and gives stat other modern features
    such as 64-bit ino_t.


commit 7b539d654e5aa4670866742dbe719999afffd1d7
Author: Craig A. Berry <craigberry@mac.com>
Date:   Sat Mar 12 18:46:04 2016 -0600

    Update vms/libssh2_config.h.

    VMS does have stdlib.h, gettimeofday(), and OpenSSL.  The latter
    is appropriate to hard-wire in the configuration because it's
    installed by default as part of the base operating system and
    there is currently no libgcrypt port.


commit 49aeaf04138e0fe90f7c691d568ff0baa2454cbe
Author: Craig A. Berry <craigberry@mac.com>
Date:   Sat Mar 12 18:32:21 2016 -0600

    VMS can't use %zd for off_t format.

    %z is a C99-ism that VMS doesn't currently have; even though the
    compiler is C99-compliant, the library isn't quite.  The off_t used
    for the st_size element of the stat can be 32-bit or 64-bit, so
    detect what we've got and pick a format accordingly.


commit e1b1ba0c8fef782717c90f816507bd3d991ae1ac
Author: Craig A. Berry <craigberry@mac.com>
Date:   Sat Mar 12 18:11:33 2016 -0600

    Normalize line endings in libssh2_sftp_get_channel.3.

    Somehow it got Windows-style CRLF endings so convert to just LF,
    for consistency as well as not to confuse tools that will regard
    the \r as content (e.g. the OpenVMS help librarian).


________________________________________
Craig A. Berry
mailto:craigberry@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser


--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Disposition: attachment;
	filename=0001-Normalize-line-endings-in-libssh2_sftp_get_channel.3.patch
Content-Type: application/octet-stream;
	name="0001-Normalize-line-endings-in-libssh2_sftp_get_channel.3.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20e1b1ba0c8fef782717c90f816507bd3d991ae1ac=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20"Craig=20A.=20Berry"=20<craigberry@mac.com>=0A=
Date:=20Sat,=2012=20Mar=202016=2018:11:33=20-0600=0ASubject:=20[PATCH=20=
1/5]=20Normalize=20line=20endings=20in=20libssh2_sftp_get_channel.3.=0A=0A=
Somehow=20it=20got=20Windows-style=20CRLF=20endings=20so=20convert=20to=20=
just=20LF,=0Afor=20consistency=20as=20well=20as=20not=20to=20confuse=20=
tools=20that=20will=20regard=0Athe=20\r=20as=20content=20(e.g.=20the=20=
OpenVMS=20help=20librarian).=0A---=0A=20docs/libssh2_sftp_get_channel.3=20=
|=2042=20++++++++++++++++++++---------------------=0A=201=20file=20=
changed,=2021=20insertions(+),=2021=20deletions(-)=0A=0Adiff=20--git=20=
a/docs/libssh2_sftp_get_channel.3=20b/docs/libssh2_sftp_get_channel.3=0A=
index=20f3d364a..d1d82bc=20100644=0A---=20=
a/docs/libssh2_sftp_get_channel.3=0A+++=20=
b/docs/libssh2_sftp_get_channel.3=0A@@=20-1,21=20+1,21=20@@=0A-.TH=20=
libssh2_sftp_get_channel=203=20"9=20Sep=202011"=20"libssh2=201.4.0"=20=
"libssh2=20manual"=0D=0A-.SH=20NAME=0D=0A-libssh2_sftp_get_channel=20-=20=
return=20the=20channel=20of=20sftp=0D=0A-.SH=20SYNOPSIS=0D=0A-.nf=0D=0A=
-#include=20<libssh2.h>=0D=0A-#include=20<libssh2_sftp.h>=0D=0A-=0D=0A=
-.fi=0D=0A-LIBSSH2_CHANNEL=20*libssh2_sftp_get_channel(LIBSSH2_SFTP=20=
*sftp);=0D=0A-.SH=20DESCRIPTION=0D=0A-\fIsftp\fP=20-=20SFTP=20instance=20=
as=20returned=20by=20=0D=0A-.BR=20libssh2_sftp_init(3)=0D=0A-=0D=0A=
-Return=20the=20channel=20of=20the=20given=20sftp=20handle.=0D=0A-.SH=20=
RETURN=20VALUE=0D=0A-The=20channel=20of=20the=20SFTP=20instance=20or=20=
NULL=20if=20something=20was=20wrong.=0D=0A-.SH=20AVAILABILITY=0D=0A=
-Added=20in=201.4.0=0D=0A-.SH=20SEE=20ALSO=0D=0A-.BR=20=
libssh2_sftp_init(3)=0D=0A+.TH=20libssh2_sftp_get_channel=203=20"9=20Sep=20=
2011"=20"libssh2=201.4.0"=20"libssh2=20manual"=0A+.SH=20NAME=0A=
+libssh2_sftp_get_channel=20-=20return=20the=20channel=20of=20sftp=0A=
+.SH=20SYNOPSIS=0A+.nf=0A+#include=20<libssh2.h>=0A+#include=20=
<libssh2_sftp.h>=0A+=0A+.fi=0A+LIBSSH2_CHANNEL=20=
*libssh2_sftp_get_channel(LIBSSH2_SFTP=20*sftp);=0A+.SH=20DESCRIPTION=0A=
+\fIsftp\fP=20-=20SFTP=20instance=20as=20returned=20by=0A+.BR=20=
libssh2_sftp_init(3)=0A+=0A+Return=20the=20channel=20of=20the=20given=20=
sftp=20handle.=0A+.SH=20RETURN=20VALUE=0A+The=20channel=20of=20the=20=
SFTP=20instance=20or=20NULL=20if=20something=20was=20wrong.=0A+.SH=20=
AVAILABILITY=0A+Added=20in=201.4.0=0A+.SH=20SEE=20ALSO=0A+.BR=20=
libssh2_sftp_init(3)=0A--=20=0A2.2.1=0A=0A=

--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii



--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Disposition: attachment;
	filename=0002-VMS-can-t-use-zd-for-off_t-format.patch
Content-Type: application/octet-stream;
	name="0002-VMS-can-t-use-zd-for-off_t-format.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=2049aeaf04138e0fe90f7c691d568ff0baa2454cbe=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20"Craig=20A.=20Berry"=20<craigberry@mac.com>=0A=
Date:=20Sat,=2012=20Mar=202016=2018:32:21=20-0600=0ASubject:=20[PATCH=20=
2/5]=20VMS=20can't=20use=20%zd=20for=20off_t=20format.=0A=0A%z=20is=20a=20=
C99-ism=20that=20VMS=20doesn't=20currently=20have;=20even=20though=20the=0A=
compiler=20is=20C99-compliant,=20the=20library=20isn't=20quite.=20=20The=20=
off_t=20used=0Afor=20the=20st_size=20element=20of=20the=20stat=20can=20=
be=2032-bit=20or=2064-bit,=20so=0Adetect=20what=20we've=20got=20and=20=
pick=20a=20format=20accordingly.=0A---=0A=20include/libssh2.h=20|=2011=20=
++++++++++-=0A=201=20file=20changed,=2010=20insertions(+),=201=20=
deletion(-)=0A=0Adiff=20--git=20a/include/libssh2.h=20=
b/include/libssh2.h=0Aindex=20c157757..9ef9ff1=20100644=0A---=20=
a/include/libssh2.h=0A+++=20b/include/libssh2.h=0A@@=20-202,7=20+202,16=20=
@@=20typedef=20off_t=20libssh2_struct_stat_size;=0A=20#endif=0A=20=0A=20=
#ifndef=20LIBSSH2_STRUCT_STAT_SIZE_FORMAT=0A-#=20=20define=20=
LIBSSH2_STRUCT_STAT_SIZE_FORMAT=20=20=20=20=20=20"%zd"=0A+#=20=20ifdef=20=
__VMS=0A+/*=20We=20have=20to=20roll=20our=20own=20format=20here=20=
because=20%z=20is=20a=20C99-ism=20we=20don't=20have.=20*/=0A+#=20=20=20=20=
if=20__USE_OFF64_T=20||=20__USING_STD_STAT=0A+#=20=20=20=20=20=20define=20=
LIBSSH2_STRUCT_STAT_SIZE_FORMAT=20=20=20=20=20=20"%Ld"=0A+#=20=20=20=20=
else=0A+#=20=20=20=20=20=20define=20LIBSSH2_STRUCT_STAT_SIZE_FORMAT=20=20=
=20=20=20=20"%d"=0A+#=20=20=20=20endif=0A+#=20=20else=0A+#=20=20=20=20=
define=20LIBSSH2_STRUCT_STAT_SIZE_FORMAT=20=20=20=20=20=20"%zd"=0A+#=20=20=
endif=0A=20typedef=20struct=20stat=20libssh2_struct_stat;=0A=20typedef=20=
off_t=20libssh2_struct_stat_size;=0A=20#endif=0A--=20=0A2.2.1=0A=0A=

--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii



--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Disposition: attachment;
	filename=0003-Update-vms-libssh2_config.h.patch
Content-Type: application/octet-stream;
	name="0003-Update-vms-libssh2_config.h.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=207b539d654e5aa4670866742dbe719999afffd1d7=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20"Craig=20A.=20Berry"=20<craigberry@mac.com>=0A=
Date:=20Sat,=2012=20Mar=202016=2018:46:04=20-0600=0ASubject:=20[PATCH=20=
3/5]=20Update=20vms/libssh2_config.h.=0A=0AVMS=20does=20have=20stdlib.h,=20=
gettimeofday(),=20and=20OpenSSL.=20=20The=20latter=0Ais=20appropriate=20=
to=20hard-wire=20in=20the=20configuration=20because=20it's=0Ainstalled=20=
by=20default=20as=20part=20of=20the=20base=20operating=20system=20and=0A=
there=20is=20currently=20no=20libgcrypt=20port.=0A---=0A=20=
vms/libssh2_config.h=20|=208=20+++++++-=0A=201=20file=20changed,=207=20=
insertions(+),=201=20deletion(-)=0A=0Adiff=20--git=20=
a/vms/libssh2_config.h=20b/vms/libssh2_config.h=0Aindex=20=
2eb09a8..b8f73e2=20100644=0A---=20a/vms/libssh2_config.h=0A+++=20=
b/vms/libssh2_config.h=0A@@=20-14,6=20+14,7=20@@=20typedef=20unsigned=20=
int=20socklen_t;=20/*=20missing=20in=20headers=20on=20VMS=20*/=0A=20/*=20=
Have's=20*/=0A=20=0A=20#define=20HAVE_UNISTD_H=0A+#define=20=
HAVE_STDLIB_H=0A=20#define=20HAVE_INTTYPES_H=0A=20#define=20=
HAVE_SYS_TIME_H=0A=20#define=20HAVE_SELECT=0A@@=20-23,6=20+24,8=20@@=20=
typedef=20unsigned=20int=20socklen_t;=20/*=20missing=20in=20headers=20on=20=
VMS=20*/=0A=20#define=20HAVE_NETINET_IN_H=0A=20#define=20=
HAVE_ARPA_INET_H=0A=20=0A+#define=20HAVE_GETTIMEOFDAY=201=0A+=0A=20=
#define=20POSIX_C_SOURCE=0A=20=0A=20/*=20Enable=20the=20possibility=20of=20=
using=20tracing=20*/=0A@@=20-68,8=20+71,11=20@@=20typedef=20unsigned=20=
int=20socklen_t;=20/*=20missing=20in=20headers=20on=20VMS=20*/=0A=20=0A=20=
#endif=0A=20=0A+/*=20Use=20OpenSSL=20*/=0A+#define=20LIBSSH2_OPENSSL=201=0A=
+=0A=20/*=20Compile=20in=20zlib=20support.=20We=20link=20against=20=
gnv$libzshr,=20as=20available=0A-=20*=20on=20encompasserve.com.=0A+=20*=20=
from=20https://sourceforge.net/projects/vms-ports/files/.=0A=20=20*/=0A=20=
=0A=20#define=20LIBSSH2_HAVE_ZLIB=0A--=20=0A2.2.1=0A=0A=

--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii



--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Disposition: attachment;
	filename=0004-Build-with-standard-stat-structure-on-VMS.patch
Content-Type: application/octet-stream;
	name="0004-Build-with-standard-stat-structure-on-VMS.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=2054fe6cef48102c73c5dac3ea15d18eb216c76359=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20"Craig=20A.=20Berry"=20<craigberry@mac.com>=0A=
Date:=20Sun,=2013=20Mar=202016=2010:20:10=20-0500=0ASubject:=20[PATCH=20=
4/5]=20Build=20with=20standard=20stat=20structure=20on=20VMS.=0A=0AThis=20=
gets=20us=20large=20file=20support,=20is=20available=20on=20any=20VMS=20=
release=0Ain=20the=20last=20decade=20and=20more,=20and=20gives=20stat=20=
other=20modern=20features=0Asuch=20as=2064-bit=20ino_t.=0A---=0A=20=
vms/libssh2_make_example.dcl=20|=203=20++-=0A=20vms/libssh2_make_lib.dcl=20=
=20=20=20=20|=207=20++++---=0A=202=20files=20changed,=206=20=
insertions(+),=204=20deletions(-)=0A=0Adiff=20--git=20=
a/vms/libssh2_make_example.dcl=20b/vms/libssh2_make_example.dcl=0Aindex=20=
d8191f3..af4116d=20100644=0A---=20a/vms/libssh2_make_example.dcl=0A+++=20=
b/vms/libssh2_make_example.dcl=0A@@=20-29,6=20+29,7=20@@=20$=20this=20=3D=20=
f$search("exadir:*.c;0")=0A=20$=20if=20this=20.eqs.=20""=20then=20goto=20=
EndLoop=0A=20$!=0A=20$=20what=20=3D=20f$parse(=20this,,,"name")=0A+$=20=
if=20what=20.eqs.=20"x11"=20then=20goto=20loop=20!=20not=20portable=20=
yet=0A=20$=20call=20Make=0A=20$!=0A=20$=20goto=20Loop=0A@@=20-84,7=20=
+85,7=20@@=20$=20define=20objdir=20'objdir'=0A=20$=20define=20exadir=20=
'exadir'=0A=20$!=0A=20$=20cc_include=20=3D=20"/include=3D([],[-.include])"=
=0A-$=20cc_flags=20=20=20=3D=20"/name=3Dshortened/show=3Dall"=0A+$=20=
cc_flags=20=20=20=3D=20=
"/name=3Dshortened/show=3Dall/define=3D(_USE_STD_STAT=3D1)"=0A=20$=20=
link_opts=20=20=3D=20"objdir:libssh2_''thisid'.opt"=0A=20$!=0A=20$!=0A=
diff=20--git=20a/vms/libssh2_make_lib.dcl=20b/vms/libssh2_make_lib.dcl=0A=
index=206d8b13b..56d168f=20100644=0A---=20a/vms/libssh2_make_lib.dcl=0A=
+++=20b/vms/libssh2_make_lib.dcl=0A@@=20-46,7=20+46,8=20@@=20$!=0A=20$=20=
define=20objdir=20'objdir'=0A=20$=20define=20srcdir=20'srcdir'=0A=20$!=0A=
-$=20cc_include=20=3D=20"/include=3D([],[-.include])"=0A+$=20cc_include=20=
=3D=20"/include=3D([],[-.include],""/gnv$zlib_include"")"=0A+$=20=
cc_define=20=3D=20"/DEFINE=3D(_USE_STD_STAT=3D1)"=0A=20$=20link_opts=20=20=
=3D=20"objdir:libssh2_''thisid'.opt"=0A=20$!=0A=20$=20pipe=20search=20=
[-.include]libssh2.h=20libssh2_version_major/nohead=20|=20(read=20=
sys$input=20l=20;=20l=20=3D=20f$element(2,"=20=
",f$edit(l,"trim,compress"))=20;=20-=20=0A@@=20-137,7=20+138,7=20@@=20=
$CaseLoop:=0A=20$!=0A=20$=20if=20case=20.eq.=200=20=0A=20$=20then!camel=20=
case=20names=20=0A-$=20=20=20cc_flags=20=3D=20"/names=3D(shortened,as_is)"=
=0A+$=20=20=20cc_flags=20=3D=20"/names=3D(shortened,as_is)''cc_define'"=0A=
=20$=20=20=20objlib=20=3D=20"libssh2_asis.olb"=0A=20$=20endif=0A=20$!=0A=
@@=20-149,7=20+150,7=20@@=20$=20=20=20=20=20=20rename=20=
[.cxx_repository]cxx$demangler_db.;=20*.lowercase=0A=20$=20=20=20=20=20=20=
purge=20=20[.cxx_repository]cxx$demangler_db.lowercase=0A=20$=20=20=20=
endif=0A=20$!=0A-$=20=20=20cc_flags=20=3D=20"/names=3D(shortened)"=0A+$=20=
=20=20cc_flags=20=3D=20"/names=3D(shortened)''cc_define'"=0A=20$=20=20=20=
objlib=20=3D=20"libssh2_up.olb"=0A=20$=20endif=0A=20$!=0A--=20=0A2.2.1=0A=
=0A=

--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii



--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Disposition: attachment;
	filename=0005-Tweak-VMS-help-file-building.patch
Content-Type: application/octet-stream;
	name="0005-Tweak-VMS-help-file-building.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=2057f7f6e2a92b3cc1699e569ccdc489be79421791=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20"Craig=20A.=20Berry"=20<craigberry@mac.com>=0A=
Date:=20Sun,=2013=20Mar=202016=2013:29:16=20-0500=0ASubject:=20[PATCH=20=
5/5]=20Tweak=20VMS=20help=20file=20building.=0A=0APrimarily=20this=20is=20=
handling=20cases=20where=20top-level=20files=20moved=20into=0Athe=20=
docs/=20directory.=20=20I=20also=20corrected=20a=20typo=20and=20removed=20=
the=0Aclaim=20that=20libssh2=20is=20public=20domain.=0A---=0A=20=
vms/libssh2_make_help.dcl=20|=2024=20++++++++++++++----------=0A=201=20=
file=20changed,=2014=20insertions(+),=2010=20deletions(-)=0A=0Adiff=20=
--git=20a/vms/libssh2_make_help.dcl=20b/vms/libssh2_make_help.dcl=0A=
index=20b28265d..b36512e=20100644=0A---=20a/vms/libssh2_make_help.dcl=0A=
+++=20b/vms/libssh2_make_help.dcl=0A@@=20-11,23=20+11,27=20@@=20$=20=
man2help=20sys$input:=20libssh2.hlp=20-b=201=0A=20=0A=20LIBSSH2=0A=20=0A=
-OpenVMS=20port=20of=20the=20public=20domain=20libssh2=20library,=20=
which=20=0A-provides=20an=20API=20to=20implement=20client=20SSH=20=
communciation.=0A+OpenVMS=20port=20of=20the=20libssh2=20library,=20which=20=
provides=20an=0A+API=20to=20implement=20client=20SSH=20communication.=0A=20=
=0A-License=20information=20is=20available=20at=20the=20copying=20=
subtopic.=0A+License=20information=20is=20available=20at=20the=20Copying=20=
subtopic.=0A=20=0A=20$!=0A=20$=20open/append=20mh=20libssh2.hlp=0A=20$=20=
write=20mh=20helpversion=0A=20$=20close=20mh=0A=20$!=0A-$=20man2help=20=
-a=20[-]readme.;=20libssh2.hlp=20=20=20=20=20=20=20=20-b=202=0A-$=20=
man2help=20-a=20[-]authors.;=20libssh2.hlp=20=20=20=20=20=20=20-b=202=0A=
-$=20man2help=20-a=20[-]copying.;=20libssh2.hlp=20=20=20=20=20=20=20-b=20=
2=0A-$=20man2help=20-a=20[-]news.;=20libssh2.hlp=20=20=20=20=20=20=20=20=20=
=20-b=202=0A-$=20man2help=20-a=20[-]release-notes.;=20libssh2.hlp=20-b=20=
2=0A-$=20man2help=20-a=20[-]hacking.;=20libssh2.hlp=20=20=20=20=20=20=20=
-b=202=0A-$=20man2help=20-a=20[-]todo.;=20libssh2.hlp=20=20=20=20=20=20=20=
=20=20=20-b=202=0A+$=20man2help=20-a=20[-]README.;=20libssh2.hlp=20=20=20=
=20=20=20=20=20-b=202=0A+$=20man2help=20-a=20[-]COPYING.;=20libssh2.hlp=20=
=20=20=20=20=20=20-b=202=0A+$=20man2help=20-a=20[-]NEWS.;=20libssh2.hlp=20=
=20=20=20=20=20=20=20=20=20-b=202=0A+$=20man2help=20-a=20=
[-]RELEASE-NOTES.;=20libssh2.hlp=20-b=202=0A+$=20man2help=20-a=20=
[-.docs]AUTHORS.;=20libssh2.hlp=20=20-b=202=0A+$=20man2help=20-a=20=
[-.docs]BINDINGS.;=20libssh2.hlp=20-b=202=0A+$=20man2help=20-a=20=
[-.docs]HACKING.;=20libssh2.hlp=20=20-b=202=0A+$=20if=20=
f$search("[]HACKING_CRYPTO.")=20.nes.=20""=20then=20delete=20=
[]HACKING_CRYPTO.;*=0A+$=20copy=20[-.docs]HACKING.CRYPTO;=20=
[]HACKING_CRYPTO.=0A+$=20man2help=20-a=20[]HACKING_CRYPTO.;=20=
libssh2.hlp=20-b=202=0A+$=20man2help=20-a=20[-.docs]TODO.;=20libssh2.hlp=20=
=20=20=20=20-b=202=0A=20$!=0A=20$=20man2help=20-a=20sys$input:=20=
libssh2.hlp=20=20=20=20=20=20=20=20=20-b=202=0A=20=0A--=20=0A2.2.1=0A=0A=

--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii




--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--Apple-Mail=_A7F17130-3CC2-4DF4-81D8-857D694B6BDC--

From libssh2-devel-bounces@cool.haxx.se  Tue Mar 15 23:18:56 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2FM8sxu025170;
	Tue, 15 Mar 2016 23:09:12 +0100
Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com
 [IPv6:2a00:1450:400c:c09:0:0:0:229])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2FM8r9M025129
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 15 Mar 2016 23:08:53 +0100
Received: by mail-wm0-x229.google.com with SMTP id p65so164347522wmp.1
 for <libssh2-devel@cool.haxx.se>; Tue, 15 Mar 2016 15:08:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date:message-id:subject
 :from:to:content-transfer-encoding;
 bh=pW5p2J5oPK+TNYiEecPLCNm80sBk+/xdsapIk19FMLw=;
 b=AnLARvQ6UmukTzjKN4qxPbIhlSwVsXXifkR6MACOlKZ96CPO6DvTz+0RKogOTtbqlG
 Dgp2GI9YNWDh9xt2A0t3hpFJaIQGuWifQX1gI7NrMmov70UVJkgHQvHQC1izFNWcwH0T
 TTcKNwuDhN/KPfZQrtHjpkzCJLzYPo+TOtUK1SrRjwo02dRp7izJZuvOEDdNFAoTjigI
 bZ/k1CUy9K3J7Y3PsnPjjPHpWNwEvN43hCoPcrRyRKFkOnEJrx2vPBBgG6xS7tBQPcqx
 111dOcZ6SFflharWe7RjgzhjqX+xwPpmnUyGgsIZQbvdfHYIETAJczDpEfqNck2GP9E1
 mtPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:date
 :message-id:subject:from:to:content-transfer-encoding;
 bh=pW5p2J5oPK+TNYiEecPLCNm80sBk+/xdsapIk19FMLw=;
 b=LXQuRDTcU2LgggRUsf3DaVSredgN54eze3U7wHO3hPXOGfMaNGHxxmfORMOWnecGmx
 KwdWv9akTarWDEok9zRenLKzKFcEbF15BvFi5SmOcSPMLT+4pTllZ2HxZ5shOnckwSGk
 W+K34cQelyNmar2CkvcbnENTvnIANkLwYW4XHGteg+iUOrB2SKGkjnzn3FPCsR0/i4B1
 nj6RQoQoVpJOgSR2jBdK/oS+W4kdbsOjuT1LPeAzmjWkgbN88mpYIPlNPaDSXk2/mWok
 5yY+IdGKg18YMwc7H03gROWdQ234VLGW5VZas003Of6PkxE1p1yCQQTSd5RCQuN/ukLH
 dOzA==
X-Gm-Message-State: AD7BkJJ+D/+2xsYj50lUYcVqxsX69It/Jg+LP0NFWX49VLLn7+Z0WxwNaWr/f4lz/tz88/2Vx73L2+Gl7x+tZQ==
MIME-Version: 1.0
X-Received: by 10.28.137.148 with SMTP id l142mr25691054wmd.40.1458079729787; 
 Tue, 15 Mar 2016 15:08:49 -0700 (PDT)
Received: by 10.28.93.207 with HTTP; Tue, 15 Mar 2016 15:08:49 -0700 (PDT)
In-Reply-To: <F535B35F-73D9-42E5-96A0-C59976A90B19@mac.com>
References: <F535B35F-73D9-42E5-96A0-C59976A90B19@mac.com>
Date: Tue, 15 Mar 2016 22:08:49 +0000
X-Google-Sender-Auth: sN9Qs8ZqfgLor8SJUE1F-IXkXfQ
Message-ID: <CADyPeTNLDyfnTDR-7z24Z5j6icn8fJYsT+Ee5yD01yLv7VT7dw@mail.gmail.com>
Subject: Re: [PATCH] VMS updates
From: Alexander Lamaison <swish@lammy.co.uk>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
 u2FM8r9M025129
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id u2FM8sxu025170

On 15 March 2016 at 02:41, Craig A. Berry <craigberry@mac.com> wrote:
> A few years ago Jose Baars ported libssh2 to OpenVMS.  I took it for a spin recently and there were a handful of changes necessary to catch up with changes since.  I’ve attached five patches generated with git format-patch and also include the commit messages inline below.

Thanks Craig.  I've pushed them to master.  Tests look good so far:
https://travis-ci.org/libssh2/libssh2/builds/116243999

Alex

-- 
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

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

From libssh2-devel-bounces@cool.haxx.se  Wed Mar 16 00:41:01 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2FNeiHP023387;
	Wed, 16 Mar 2016 00:40:59 +0100
Received: from pv33p03im-asmtp002.me.com (pv33p03im-asmtp002.me.com
 [17.143.180.11])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2FNefJH023338
 (version=TLSv1.2 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Wed, 16 Mar 2016 00:40:43 +0100
Received: from [172.16.52.2]
 (c-24-14-137-179.hsd1.il.comcast.net [24.14.137.179])
 by pv33p03im-asmtp002.me.com
 (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015))
 with ESMTPSA id <0O4300I3HTRKHV10@pv33p03im-asmtp002.me.com> for
 libssh2-devel@cool.haxx.se; Tue, 15 Mar 2016 23:40:37 +0000 (GMT)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,,
 definitions=2016-03-16_01:,, signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0
 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.0.1-1510270003 definitions=main-1603150324
MIME-version: 1.0 (Mac OS X Mail 9.2 \(3112\))
Subject: Re: [PATCH] VMS updates
From: "Craig A. Berry" <craigberry@mac.com>
In-reply-to: <CADyPeTNLDyfnTDR-7z24Z5j6icn8fJYsT+Ee5yD01yLv7VT7dw@mail.gmail.com>
Date: Tue, 15 Mar 2016 18:40:31 -0500
Message-id: <900C5AFD-57EA-4EF6-9F5A-49E6030A4032@mac.com>
References: <F535B35F-73D9-42E5-96A0-C59976A90B19@mac.com>
 <CADyPeTNLDyfnTDR-7z24Z5j6icn8fJYsT+Ee5yD01yLv7VT7dw@mail.gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Mailer: Apple Mail (2.3112)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id u2FNeiHP023387


> On Mar 15, 2016, at 5:08 PM, Alexander Lamaison <swish@lammy.co.uk> wrote:
> 
> Thanks Craig.  I've pushed them to master.  Tests look good so far:
> https://travis-ci.org/libssh2/libssh2/builds/116243999

Thanks!

________________________________________
Craig A. Berry
mailto:craigberry@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

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

From libssh2-devel-bounces@cool.haxx.se  Tue Mar 22 22:11:55 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2MLBPVb031001;
	Tue, 22 Mar 2016 22:11:50 +0100
Received: from nm44-vm3.bullet.mail.bf1.yahoo.com
 (nm44-vm3.bullet.mail.bf1.yahoo.com [216.109.114.254])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2MLBMko030954
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 22 Mar 2016 22:11:23 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1458670236; bh=CXXI0QTuG41soZgEYYYjMbGfdXt5eGOfkT6TcCGB8Xw=;
 h=Date:From:Reply-To:To:Subject:References:From:Subject;
 b=TSWYDy67r+1mVCG9nQy10Cy+YXko8FOhZBRF9NypOviYFE6zQPXRrEzTLa9syABaiq838oTcZpgXUBKCoFXauVJxlgg6nuawIRYiLXyq12Z4xq3FcT9KalWj+asN808Kozx402RaHYth0sPzNQiQAz/kMSTQlsrU2VyURbVd3/occpZCR7YrueTVZUj10kqBW7xZK9DotwEc9bb39dfw8mzvD8yL5WoponsWDEvTXx6/pmTeB1oPIiJ/ThanXc0p5tbHQ+n3XZL/Sx06TQirI6D1oRfxg9dfab1D9UkDBo23Is8LVj8JN7BcgOoVkyHZVlgL4Ix5fSDLDyPY/gdviw==
Received: from [98.139.170.178] by nm44.bullet.mail.bf1.yahoo.com with NNFMP;
 22 Mar 2016 18:10:36 -0000
Received: from [98.139.212.249] by tm21.bullet.mail.bf1.yahoo.com with NNFMP;
 22 Mar 2016 18:10:36 -0000
Received: from [127.0.0.1] by omp1058.mail.bf1.yahoo.com with NNFMP;
 22 Mar 2016 18:10:36 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 171320.36290.bm@omp1058.mail.bf1.yahoo.com
X-YMail-OSG: dajWR0QVM1k5oURRXeKFVkS7rFHp55UFxH8zW07IUW7qqMvGULyPF3n3dIBJLH_
 4MVJFqgDAOZSjIbjFv7SSXTRoo8D0ahnlMnERamZKEz_hvzvhZypkejgwtXKGznmZdPEAvKkFPYa
 r9WnkCAOoYf4SVsIjjSn.s4I7Np0JD39Qm4V4pRxzkNBlt.FG5nNHHfnbG_NUsPD9KL5nKf6luH2
 tj.Ar9bMlDx3U.B63IfBwKXaGIMk50MN5NqFo7czHq5oxLOAKKhgHMbjOp96D9qRJBYk46QQaDPg
 nQ017vjmVCM9oG7kJgCuK2G6LtWGQYQxM_iPrJ2TKw4ZI9qJTEqYIYMa_HbBOrEi.NvJKS_r30jT
 clUsx7tu7q_FFBYCHJc1ydKSyJ1Y6h.ksNLbJxD0WUunl0meVxuKp2Ur0OyqB8fWFmPhVxODeOyK
 SfaJ52o_2O.aYsBPwUL7YMJi11ppVMWW9ol00xMshA4eqR7YCWM5fOS2er722j93.kDlfETgn9Bo
 SUxbWaZ.imdgKPVs-
Received: by 66.196.80.148; Tue, 22 Mar 2016 18:10:35 +0000 
Date: Tue, 22 Mar 2016 18:10:29 +0000 (UTC)
From: Ismail Aseen <ismaildeh@yahoo.com>
To: "libssh2-devel@cool.haxx.se" <libssh2-devel@cool.haxx.se>
Message-ID: <2105594000.3326645.1458670229325.JavaMail.yahoo@mail.yahoo.com>
Subject: libssh2_sftp_init() hangs and does not return while consuming 100% CPU
MIME-Version: 1.0
References: <2105594000.3326645.1458670229325.JavaMail.yahoo.ref@mail.yahoo.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: Ismail Aseen <ismaildeh@yahoo.com>,
        libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============2068241586=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============2068241586==
Content-Type: multipart/alternative; 
	boundary="----=_Part_3326644_130550261.1458670229322"

------=_Part_3326644_130550261.1458670229322
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,
I have an application which uses libssh2 to transfer files using SFTP. It w=
as working well till I had this problem where libssh2_sftp_init() hangs and=
 does not return while consuming 100% CPU.=C2=A0 I did a stack trace using =
gstack and got the following stack. Please note that this incident occurred=
 only once for me and it is not re created again. This incident happened wh=
ile communicating with Windows based SFTP server(Tectia). I am using libssh=
2-1.6.0. version. Is this a known issue? could anybody assist on this?

#0=C2=A0 0x00007fd3c719e6ac in recv () from /lib64/libc.so.6
#1=C2=A0 0x00007fd3c947511b in _libssh2_recv () from /x01/nptsapp/current/l=
ibs/libssh2.so.1
#2=C2=A0 0x00007fd3c948bc01 in _libssh2_transport_read () from /x01/nptsapp=
/current/libs/libssh2.so.1
#3=C2=A0 0x00007fd3c946cfb1 in _libssh2_channel_read () from /x01/nptsapp/c=
urrent/libs/libssh2.so.1
#4=C2=A0 0x00007fd3c94800fb in sftp_packet_read () from /x01/nptsapp/curren=
t/libs/libssh2.so.1
#5=C2=A0 0x00007fd3c94806bd in sftp_packet_require () from /x01/nptsapp/cur=
rent/libs/libssh2.so.1
#6=C2=A0 0x00007fd3c9480fd1 in sftp_init () from /x01/nptsapp/current/libs/=
libssh2.so.1
#7=C2=A0 0x00007fd3c9481285 in libssh2_sftp_init () from /x01/nptsapp/curre=
nt/libs/libssh2.so.1
Thanks,Ismail Aseen

------=_Part_3326644_130550261.1458670229322
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div style=3D"color:#000; background-color:#fff; f=
ont-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, =
Sans-Serif;font-size:14px"><div id=3D"yui_3_16_0_ym18_1_1458668801596_8622"=
>Hi,</div><div id=3D"yui_3_16_0_ym18_1_1458668801596_8677"><br></div><div d=
ir=3D"ltr" id=3D"yui_3_16_0_ym18_1_1458668801596_8678">I have an applicatio=
n which uses libssh2 to transfer files using SFTP. It was working well till=
 I had this problem where libssh2_sftp_init() hangs and does not return whi=
le consuming 100% CPU.&nbsp; I did a stack trace using gstack and got the f=
ollowing stack. Please note that this incident occurred only once for me an=
d it is not re created again. This incident happened while communicating wi=
th Windows based SFTP server(Tectia). I am using libssh2-1.6.0. version. Is=
 this a known issue? could anybody assist on this?<br></div><div id=3D"yui_=
3_16_0_ym18_1_1458668801596_8772" dir=3D"ltr"><br></div><div id=3D"yui_3_16=
_0_ym18_1_1458668801596_8800" dir=3D"ltr">#0&nbsp; 0x00007fd3c719e6ac in re=
cv () from /lib64/libc.so.6<br>#1&nbsp; 0x00007fd3c947511b in _libssh2_recv=
 () from /x01/nptsapp/current/libs/libssh2.so.1<br>#2&nbsp; 0x00007fd3c948b=
c01 in _libssh2_transport_read () from /x01/nptsapp/current/libs/libssh2.so=
.1<br>#3&nbsp; 0x00007fd3c946cfb1 in _libssh2_channel_read () from /x01/npt=
sapp/current/libs/libssh2.so.1<br>#4&nbsp; 0x00007fd3c94800fb in sftp_packe=
t_read () from /x01/nptsapp/current/libs/libssh2.so.1<br>#5&nbsp; 0x00007fd=
3c94806bd in sftp_packet_require () from /x01/nptsapp/current/libs/libssh2.=
so.1<br>#6&nbsp; 0x00007fd3c9480fd1 in sftp_init () from /x01/nptsapp/curre=
nt/libs/libssh2.so.1<br>#7&nbsp; 0x00007fd3c9481285 in libssh2_sftp_init ()=
 from /x01/nptsapp/current/libs/libssh2.so.1</div><div id=3D"yui_3_16_0_ym1=
8_1_1458668801596_8898" dir=3D"ltr"><br></div><div id=3D"yui_3_16_0_ym18_1_=
1458668801596_8916" dir=3D"ltr">Thanks,</div><div id=3D"yui_3_16_0_ym18_1_1=
458668801596_8918" dir=3D"ltr">Ismail Aseen<br></div></div></body></html>
------=_Part_3326644_130550261.1458670229322--

--===============2068241586==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============2068241586==--

From libssh2-devel-bounces@cool.haxx.se  Wed Mar 23 05:48:09 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2N4lkQv001598;
	Wed, 23 Mar 2016 05:48:06 +0100
Received: from nm30-vm0.bullet.mail.bf1.yahoo.com
 (nm30-vm0.bullet.mail.bf1.yahoo.com [98.139.213.126])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2N4lhke001510
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Wed, 23 Mar 2016 05:47:44 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1458708458; bh=aaVqftfihMxxx00N2FCCW3Fe6ILZzbRUD5UxN28j2T0=;
 h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject;
 b=F7ZWlXeUpKS/1PCeHNaMWvaTch93DJvUxVwwJdpCKGE9QxOVKxtHkK5ep9TorKIyFAz8Ui0+D7Clc58rbCurbY5lxK6yF5ObmIMMb5vi0TCkVpJyxGJlRLC9kLhyP2dEJso6KOEaIDPSlZu2aUIyOYr98fuiYPuyD+W6yoZtTnliTY47dfVT1HYf9lWI3rBy9iFceufTKCdcAQwYZfdnUpGBrcqnvriwchzOEYdUgXVbb0kUv/1QdB/V16CbS5BQ03uYgb222koeo8AQIKN7IViS0PMHXe3WofDbQBWdkKV7uPkKHmLFjPrGqcniMA2ttujWbfXeFhXSNU8CUGLzvQ==
Received: from [98.139.170.179] by nm30.bullet.mail.bf1.yahoo.com with NNFMP;
 23 Mar 2016 04:47:38 -0000
Received: from [98.139.212.222] by tm22.bullet.mail.bf1.yahoo.com with NNFMP;
 23 Mar 2016 04:47:38 -0000
Received: from [127.0.0.1] by omp1031.mail.bf1.yahoo.com with NNFMP;
 23 Mar 2016 04:47:38 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 739516.26382.bm@omp1031.mail.bf1.yahoo.com
X-YMail-OSG: ng0MWQoVM1n3KR_WRDaU3Ld85P6so0nhrFWo6N5iTnlw92DK2fqYp5XT_3cbFsK
 RndoIoKhJMJ34Cs9R1mblz02n_TnBVJrCPGv1cxRcCc1_aw7_hZADb0wI0ntux9DwcL6zjooZwA1
 oN7ewAnKKpcclvWfkaLpJo2khhTeJPGrhpZoo9JYYUYONSpSUj.TqIbpgYS0Bo28JGmy9uawRr3U
 iszaGypzAapcBxRGNgbrlHSGv4iU6pVJD1g4dxxsV2f7NpcbiTu8Ht1GLHy2zJX9sI_6vnRR.F6f
 k8mvNRZMdm3F4C0Nl6bRmQGjkLBsMLX1gApr20rOse8DAinMpJr99qbHWymIJAAWtGqdtd8qVaxO
 LvGVh7ESw9vJ.WERV78ZYWwCGnwz6GrrYmyZEruCQe6rGkdU78DaDTzDi7zm2SGGfz3eZ9t1ThvV
 CpugIvZw2avscCWHG9VHNYmZ4jT.8E5VXu9RMfTdTm_9W50zG7FoO4PJ_BQtomEUWr_x99hvV6eC
 kFHIGm.SwzM_wmDi2B0H8JxtbRTuSfmWSPujt
Received: by 66.196.80.119; Wed, 23 Mar 2016 04:47:38 +0000 
Date: Wed, 23 Mar 2016 04:47:35 +0000 (UTC)
From: Ismail Aseen <ismaildeh@yahoo.com>
To: "libssh2-devel@cool.haxx.se" <libssh2-devel@cool.haxx.se>
Message-ID: <1337637350.3855393.1458708455762.JavaMail.yahoo@mail.yahoo.com>
In-Reply-To: <2105594000.3326645.1458670229325.JavaMail.yahoo@mail.yahoo.com>
References: <2105594000.3326645.1458670229325.JavaMail.yahoo.ref@mail.yahoo.com>
 <2105594000.3326645.1458670229325.JavaMail.yahoo@mail.yahoo.com>
Subject: Re: libssh2_sftp_init() hangs and does not return while consuming
 100% CPU
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: Ismail Aseen <ismaildeh@yahoo.com>,
        libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============1628809529=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============1628809529==
Content-Type: multipart/alternative; 
	boundary="----=_Part_3855392_1435461919.1458708455753"

------=_Part_3855392_1435461919.1458708455753
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,
Adding one more point to the above mail, in the function sftp_packet_read i=
n sftp.c file, is it a defect to not to address the zero return from _libss=
h2_channel_read function=C2=A0 in the while loop found in sftp.c:377 ?
Thanks & Regards,Ismail Aseen


    On Tuesday, 22 March 2016, 23:40, Ismail Aseen <ismaildeh@yahoo.com> wr=
ote:
=20

 Hi,
I have an application which uses libssh2 to transfer files using SFTP. It w=
as working well till I had this problem where libssh2_sftp_init() hangs and=
 does not return while consuming 100% CPU.=C2=A0 I did a stack trace using =
gstack and got the following stack. Please note that this incident occurred=
 only once for me and it is not re created again. This incident happened wh=
ile communicating with Windows based SFTP server(Tectia). I am using libssh=
2-1.6.0. version. Is this a known issue? could anybody assist on this?

#0=C2=A0 0x00007fd3c719e6ac in recv () from /lib64/libc.so.6
#1=C2=A0 0x00007fd3c947511b in _libssh2_recv () from /x01/nptsapp/current/l=
ibs/libssh2.so.1
#2=C2=A0 0x00007fd3c948bc01 in _libssh2_transport_read () from /x01/nptsapp=
/current/libs/libssh2.so.1
#3=C2=A0 0x00007fd3c946cfb1 in _libssh2_channel_read () from /x01/nptsapp/c=
urrent/libs/libssh2.so.1
#4=C2=A0 0x00007fd3c94800fb in sftp_packet_read () from /x01/nptsapp/curren=
t/libs/libssh2.so.1
#5=C2=A0 0x00007fd3c94806bd in sftp_packet_require () from /x01/nptsapp/cur=
rent/libs/libssh2.so.1
#6=C2=A0 0x00007fd3c9480fd1 in sftp_init () from /x01/nptsapp/current/libs/=
libssh2.so.1
#7=C2=A0 0x00007fd3c9481285 in libssh2_sftp_init () from /x01/nptsapp/curre=
nt/libs/libssh2.so.1
Thanks,Ismail Aseen


  
------=_Part_3855392_1435461919.1458708455753
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div style=3D"color:#000; background-color:#fff; f=
ont-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, =
Sans-Serif;font-size:14px"><div id=3D"yui_3_16_0_ym18_1_1458707694744_2908"=
>Hi,</div><div id=3D"yui_3_16_0_ym18_1_1458707694744_2934"><br></div><div d=
ir=3D"ltr" id=3D"yui_3_16_0_ym18_1_1458707694744_2932">Adding one more poin=
t to the above mail, in the function sftp_packet_read in sftp.c file, is it=
 a defect to not to address the zero return from _libssh2_channel_read func=
tion&nbsp; in the while loop found in sftp.c:377 ?</div><div id=3D"yui_3_16=
_0_ym18_1_1458707694744_3408" dir=3D"ltr"><br></div><div id=3D"yui_3_16_0_y=
m18_1_1458707694744_3452" dir=3D"ltr">Thanks &amp; Regards,</div><div id=3D=
"yui_3_16_0_ym18_1_1458707694744_3476" dir=3D"ltr">Ismail Aseen<br></div><d=
iv class=3D"qtdSeparateBR"><br><br></div><div style=3D"display: block;" cla=
ss=3D"yahoo_quoted"> <div style=3D"font-family: HelveticaNeue, Helvetica Ne=
ue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 14px;"> <div st=
yle=3D"font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida=
 Grande, Sans-Serif; font-size: 16px;"> <div dir=3D"ltr"><font face=3D"Aria=
l" size=3D"2"> On Tuesday, 22 March 2016, 23:40, Ismail Aseen &lt;ismaildeh=
@yahoo.com&gt; wrote:<br></font></div>  <br><br> <div class=3D"y_msg_contai=
ner"><div id=3D"yiv1329100850"><div><div style=3D"color:#000;background-col=
or:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida=
 Grande, Sans-Serif;font-size:14px;"><div id=3D"yiv1329100850yui_3_16_0_ym1=
8_1_1458668801596_8622">Hi,</div><div id=3D"yiv1329100850yui_3_16_0_ym18_1_=
1458668801596_8677"><br></div><div dir=3D"ltr" id=3D"yiv1329100850yui_3_16_=
0_ym18_1_1458668801596_8678">I have an application which uses libssh2 to tr=
ansfer files using SFTP. It was working well till I had this problem where =
libssh2_sftp_init() hangs and does not return while consuming 100% CPU.&nbs=
p; I did a stack trace using gstack and got the following stack. Please not=
e that this incident occurred only once for me and it is not re created aga=
in. This incident happened while communicating with Windows based SFTP serv=
er(Tectia). I am using libssh2-1.6.0. version. Is this a known issue? could=
 anybody assist on this?<br></div><div id=3D"yiv1329100850yui_3_16_0_ym18_1=
_1458668801596_8772" dir=3D"ltr"><br></div><div id=3D"yiv1329100850yui_3_16=
_0_ym18_1_1458668801596_8800" dir=3D"ltr">#0&nbsp; 0x00007fd3c719e6ac in re=
cv () from /lib64/libc.so.6<br>#1&nbsp; 0x00007fd3c947511b in _libssh2_recv=
 () from /x01/nptsapp/current/libs/libssh2.so.1<br>#2&nbsp; 0x00007fd3c948b=
c01 in _libssh2_transport_read () from /x01/nptsapp/current/libs/libssh2.so=
.1<br>#3&nbsp; 0x00007fd3c946cfb1 in _libssh2_channel_read () from /x01/npt=
sapp/current/libs/libssh2.so.1<br>#4&nbsp; 0x00007fd3c94800fb in sftp_packe=
t_read () from /x01/nptsapp/current/libs/libssh2.so.1<br>#5&nbsp; 0x00007fd=
3c94806bd in sftp_packet_require () from /x01/nptsapp/current/libs/libssh2.=
so.1<br>#6&nbsp; 0x00007fd3c9480fd1 in sftp_init () from /x01/nptsapp/curre=
nt/libs/libssh2.so.1<br>#7&nbsp; 0x00007fd3c9481285 in libssh2_sftp_init ()=
 from /x01/nptsapp/current/libs/libssh2.so.1</div><div id=3D"yiv1329100850y=
ui_3_16_0_ym18_1_1458668801596_8898" dir=3D"ltr"><br></div><div id=3D"yiv13=
29100850yui_3_16_0_ym18_1_1458668801596_8916" dir=3D"ltr">Thanks,</div><div=
 id=3D"yiv1329100850yui_3_16_0_ym18_1_1458668801596_8918" dir=3D"ltr">Ismai=
l Aseen<br></div></div></div></div><br><br></div>  </div> </div>  </div></d=
iv></body></html>
------=_Part_3855392_1435461919.1458708455753--

--===============1628809529==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============1628809529==--

From libssh2-devel-bounces@cool.haxx.se  Sat Mar 26 00:11:01 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2PNAe43019578;
	Sat, 26 Mar 2016 00:10:58 +0100
Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com
 [IPv6:2607:f8b0:4001:c05:0:0:0:232])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2PNAcbF019515
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Sat, 26 Mar 2016 00:10:39 +0100
Received: by mail-ig0-x232.google.com with SMTP id ig19so21812211igb.1
 for <libssh2-devel@cool.haxx.se>; Fri, 25 Mar 2016 16:10:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to;
 bh=J09LEHmEWCpQNbDX4VVP5AX29lS/ZVOIMJrylK/TgrU=;
 b=n1IrnCkUydpQ0tS6ELahqq4Zoi/++ecVTu9bTNk5MT8KUlAJCF3TEXJwlh/3hyRMOu
 6WNJPHpbiocvEN8b1/LbOBqCnIG4siyTjFMQ9sO/ybqBm1DYO9KyhKijqKkg2oFTsUWW
 2BXmzj1xNPxNs1IjkMdcji3AuSyKJGrvb9OrpSuUQTd/DyCueKJ6TkdfviP2hNEwCHzR
 4nwoewe2uEfh1AaE7BaL2TZotKdlYyBtYC16hTkl5e0AymDUAUBS4l/jgfCP15NZdP11
 jI/WL+05GZD8H+WeO1VPzgKiz/Wd3eXld1tRGE3IBQJCOA5O4us9nUuQnNUCip6SqRuA
 SqIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:date:message-id:subject:from:to;
 bh=J09LEHmEWCpQNbDX4VVP5AX29lS/ZVOIMJrylK/TgrU=;
 b=jBsK04QUsEsDrcTSdVJR6Y0bhsCDnqkgIWudDoIQNKl2nu7/mnRTOHulM8xkbmw2zr
 4h+BwDArqyzr3Rc6wdPu2TxGatN4vU7LCOGPzdbABHF7rEkb9cq+mKky+hnxV1TkfvGE
 Uo7rClqWHlA1dw8Be09saI3OuemL4uqJst2PnUE7A6xOrFhsTFEKbwF+atN34ULqM8Ei
 aXm8HLMOuyW5Ne+brj+HQNMkajelR9Nfhuut2ruEBHUr+1K6pnZk0OykoeH7oW8I/thG
 Q8RiyOxCDqVffSlP0rguJECtfLylxrP4P1O/hwk+dAc4n+EsLLCQCLth2JVNLOzI9i0E
 joNA==
X-Gm-Message-State: AD7BkJINXF3HNUr8tTegt7IrunHSPA6xHDN99gk9ZHOrK2iYsmzWFDAmoEBvxhRlEo9JDVXrpavfO38NiFyQ/w==
MIME-Version: 1.0
X-Received: by 10.50.87.7 with SMTP id t7mr834324igz.65.1458947434639; Fri, 25
 Mar 2016 16:10:34 -0700 (PDT)
Received: by 10.36.149.135 with HTTP; Fri, 25 Mar 2016 16:10:34 -0700 (PDT)
Date: Fri, 25 Mar 2016 16:10:34 -0700
Message-ID: <CABfrOT_5_q_eOsWruhv_hwf-2dFZY8BwXah0aN1dM-yiVo=RWA@mail.gmail.com>
Subject: speeling error (and fix) in channel error message
From: bch <brad.harder@gmail.com>
To: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id u2PNAe43019578

--- libssh2/src/channel.c
+++ libssh2/src/channel.c
@@ -268,11 +268,11 @@
         if (session->open_data[0] == SSH_MSG_CHANNEL_OPEN_FAILURE) {
             unsigned int reason_code =
_libssh2_ntohu32(session->open_data + 5);
             switch (reason_code) {
             case SSH_OPEN_ADMINISTRATIVELY_PROHIBITED:
                 _libssh2_error(session, LIBSSH2_ERROR_CHANNEL_FAILURE,
-                               "Channel open failure
(admininstratively prohibited)");
+                               "Channel open failure
(administratively prohibited)");
                 break;
             case SSH_OPEN_CONNECT_FAILED:
                 _libssh2_error(session, LIBSSH2_ERROR_CHANNEL_FAILURE,
                                "Channel open failure (connect failed)");
                 break;
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Mar 26 23:58:20 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2QMw3vc006296;
	Sat, 26 Mar 2016 23:58:17 +0100
Received: from giant.haxx.se (dast@localhost.localdomain [127.0.0.1])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2QMw23Q006286
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Sat, 26 Mar 2016 23:58:02 +0100
Received: from localhost (dast@localhost)
 by giant.haxx.se (8.15.2/8.15.2/Submit) with ESMTP id u2QMw27k006277
 for <libssh2-devel@cool.haxx.se>; Sat, 26 Mar 2016 23:58:02 +0100
X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs
Date: Sat, 26 Mar 2016 23:58:02 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: speeling error (and fix) in channel error message
In-Reply-To: <CABfrOT_5_q_eOsWruhv_hwf-2dFZY8BwXah0aN1dM-yiVo=RWA@mail.gmail.com>
Message-ID: <alpine.DEB.2.20.1603262357530.6566@tvnag.unkk.fr>
References: <CABfrOT_5_q_eOsWruhv_hwf-2dFZY8BwXah0aN1dM-yiVo=RWA@mail.gmail.com>
User-Agent: Alpine 2.20 (DEB 67 2015-01-07)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id u2QMw3vc006296

On Fri, 25 Mar 2016, bch wrote:

Thanks, merged!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Sun Mar 27 21:29:02 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2RJSaR7016424;
	Sun, 27 Mar 2016 21:28:58 +0200
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2RJSYVf016407
 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Sun, 27 Mar 2016 21:28:34 +0200
Received: from list by plane.gmane.org with local (Exim 4.69)
 (envelope-from <gnslg-libssh2-devel-2@m.gmane.org>)
 id 1akGMS-0002jK-N5
 for libssh2-devel@cool.haxx.se; Sun, 27 Mar 2016 21:28:33 +0200
Received: from ppp37-190-56-84.pppoe.spdop.ru ([37.190.56.84])
 by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Sun, 27 Mar 2016 21:28:32 +0200
Received: from yumkam by ppp37-190-56-84.pppoe.spdop.ru with local (Gmexim 0.1
 (Debian)) id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Sun, 27 Mar 2016 21:28:32 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: libssh2-devel@cool.haxx.se
From: yumkam@gmail.com (Yuriy M. Kaminskiy)
Subject: Re: [PATCH][WIP][v2] Fix out-of-buffer-boundary reads (Was: [SECURITY
 ADVISORY] Truncated Difffie-Hellman secret length)
Date: Sun, 27 Mar 2016 22:28:20 +0300
Lines: 990
Message-ID: <m3a8lju3e3.fsf@gmail.com>
References: <CAD9rwMoHmS0_WoAP-=M6WXG_DherCgDWeyBrEGO8-99yq5d70g@mail.gmail.com>
 <m3vb5bmq6j.fsf@gmail.com>
Mime-Version: 1.0
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: ppp37-190-56-84.pppoe.spdop.ru
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:1FoH8WuA13WOUcR93hxczZUHYh8=
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id u2RJSaR7016424


Ping? I'd like to stress out this issue has security imlications. At
very least, DoS (and this is not a standalone application, so it is not
a minor issue), and maybe host memory exposure too. (However, it is only
heap over-reads, without heap/stack over-writes, so no risk of
escalating to remote code execution).

On 02/25/16 03:10 , Yuriy M. Kaminskiy wrote:
> "George Garner (online)" <ggarner_online@gmgsystemsinc.com> writes:
> [...]
>> 3. Where is the p_len/group_order parameter validated? In
>> kex_method_diffie_hellman_group_exchange_sha256_key_exchange it is
>> converted from network byte order and accepted at face value. What
>> happens if a malicious packet is received with a bogus value for
>> p_len?
>
> Maybe I miss something, but it looks like this defect (blindly trust
> various 32-bit length that was sent remote side and don't verify if it
> fits buffer) is *everywhere* in libssh2. I've sent some patches for
> kex.c via gh pull request, but quickly discovered it is much worse. Very
> WIP (and incomplete) patch for *other* files is attached; unfortunately,
> in most cases, I have no idea how such errors should be handled within libssh2,
> don't know libssh2 code base well enough, so I give up at this.
>
> Note that in early connection setup "malicious server" is not required,
> "malicious MITM" can insert broken packets as well.
>
> In general, please re-review all `grep ntoh -r src/`, in many cases
> surrounding code looks problematic in one way or other.
>
>
> ---
> Changelog:
> v2: fixed obvious errors
> Note: This is still NOT COMPLETE work, all XXX comment must be reviewed and acted upon.
>
>  src/agent.c     |  32 ++++++++--------
>  src/channel.c   |  10 ++++-
>  src/hostkey.c   |  19 +++++++--
>  src/kex.c       |  43 +++++++++++----------
>  src/packet.c    |  45 +++++++++++++++++-----
>  src/publickey.c | 117 +++++++++++++++++++++++++++++++++++++++++++-------------
>  src/session.c   |   2 +
>  src/sftp.c      |  42 ++++++++++++++++----
>  src/sftp.h      |   1 +
>  src/userauth.c  |  32 ++++++++++++++++
>  10 files changed, 260 insertions(+), 83 deletions(-)
>
> diff --git a/src/agent.c b/src/agent.c
> index c2ba422..255b63d 100644
> --- a/src/agent.c
> +++ b/src/agent.c
> @@ -449,12 +449,12 @@ agent_sign(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len,
>          goto error;
>      }
>      method_len = _libssh2_ntohu32(s);
> -    s += 4;
> -    len -= method_len;
> -    if (len < 0) {
> +    if (method_len < 0 || len < method_len) {
>          rc = LIBSSH2_ERROR_AGENT_PROTOCOL;
>          goto error;
>      }
> +    s += 4;
> +    len -= method_len;
>      s += method_len;
>  
>      /* Read the signature */
> @@ -464,12 +464,12 @@ agent_sign(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len,
>          goto error;
>      }
>      *sig_len = _libssh2_ntohu32(s);
> -    s += 4;
> -    len -= *sig_len;
> -    if (len < 0) {
> +    if ((size_t)len < *sig_len) {
>          rc = LIBSSH2_ERROR_AGENT_PROTOCOL;
>          goto error;
>      }
> +    len -= *sig_len;
> +    s += 4;
>  
>      *sig = LIBSSH2_ALLOC(session, *sig_len);
>      if (!*sig) {
> @@ -558,15 +558,15 @@ agent_list_identities(LIBSSH2_AGENT *agent)
>              goto error;
>          }
>          identity->external.blob_len = _libssh2_ntohu32(s);
> -        s += 4;
> -
> -        /* Read the blob */
> -        len -= identity->external.blob_len;
> -        if (len < 0) {
> +        if ((size_t)len < identity->external.blob_len) {
>              rc = LIBSSH2_ERROR_AGENT_PROTOCOL;
>              LIBSSH2_FREE(agent->session, identity);
>              goto error;
>          }
> +        s += 4;
> +
> +        /* Read the blob */
> +        len -= identity->external.blob_len;
>  
>          identity->external.blob = LIBSSH2_ALLOC(agent->session,
>                                                  identity->external.blob_len);
> @@ -587,16 +587,16 @@ agent_list_identities(LIBSSH2_AGENT *agent)
>              goto error;
>          }
>          comment_len = _libssh2_ntohu32(s);
> -        s += 4;
> -
> -        /* Read the comment */
> -        len -= comment_len;
> -        if (len < 0) {
> +        if (comment_len < 0 || len < comment_len) {
>              rc = LIBSSH2_ERROR_AGENT_PROTOCOL;
>              LIBSSH2_FREE(agent->session, identity->external.blob);
>              LIBSSH2_FREE(agent->session, identity);
>              goto error;
>          }
> +        s += 4;
> +
> +        /* Read the comment */
> +        len -= comment_len;
>  
>          identity->external.comment = LIBSSH2_ALLOC(agent->session,
>                                                     comment_len + 1);
> diff --git a/src/channel.c b/src/channel.c
> index 32d914d..38572be 100644
> --- a/src/channel.c
> +++ b/src/channel.c
> @@ -225,6 +225,7 @@ _libssh2_channel_open(LIBSSH2_SESSION * session, const char *channel_type,
>      }
>  
>      if (session->open_state == libssh2_NB_state_sent) {
> +        unsigned char *end;
>          rc = _libssh2_packet_requirev(session, reply_codes,
>                                        &session->open_data,
>                                        &session->open_data_len, 1,
> @@ -238,7 +239,11 @@ _libssh2_channel_open(LIBSSH2_SESSION * session, const char *channel_type,
>              goto channel_error;
>          }
>  
> +        end = session->open_data + session->open_data_len;
> +
>          if (session->open_data[0] == SSH_MSG_CHANNEL_OPEN_CONFIRMATION) {
> +            if (13+4 > (end - session->open_data))
> +                goto channel_error;
>              session->open_channel->remote.id =
>                  _libssh2_ntohu32(session->open_data + 5);
>              session->open_channel->local.window_size =
> @@ -265,7 +270,8 @@ _libssh2_channel_open(LIBSSH2_SESSION * session, const char *channel_type,
>              return session->open_channel;
>          }
>  
> -        if (session->open_data[0] == SSH_MSG_CHANNEL_OPEN_FAILURE) {
> +        if (session->open_data[0] == SSH_MSG_CHANNEL_OPEN_FAILURE &&
> +            4 <= (end - (session->open_data + 5))) {
>              unsigned int reason_code = _libssh2_ntohu32(session->open_data + 5);
>              switch (reason_code) {
>              case SSH_OPEN_ADMINISTRATIVELY_PROHIBITED:
> @@ -1399,6 +1405,7 @@ _libssh2_channel_flush(LIBSSH2_CHANNEL *channel, int streamid)
>  
>              if (((packet_type == SSH_MSG_CHANNEL_DATA)
>                   || (packet_type == SSH_MSG_CHANNEL_EXTENDED_DATA))
> +                && packet->data_len >= 5 + (packet_type == SSH_MSG_CHANNEL_EXTENDED_DATA ? 4 : 0)
>                  && (_libssh2_ntohu32(packet->data + 1) == channel->local.id)) {
>                  /* It's our channel at least */
>                  long packet_stream_id =
> @@ -1418,6 +1425,7 @@ _libssh2_channel_flush(LIBSSH2_CHANNEL *channel, int streamid)
>                                     bytes_to_flush, packet_stream_id,
>                                     channel->local.id, channel->remote.id);
>  
> +                    /* XXX assert(packet->data_len >= 13); XXX */
>                      /* It's one of the streams we wanted to flush */
>                      channel->flush_refund_bytes += packet->data_len - 13;
>                      channel->flush_flush_bytes += bytes_to_flush;
> diff --git a/src/hostkey.c b/src/hostkey.c
> index 2a0a8f9..7b780e2 100644
> --- a/src/hostkey.c
> +++ b/src/hostkey.c
> @@ -66,31 +66,42 @@ hostkey_method_ssh_rsa_init(LIBSSH2_SESSION * session,
>      libssh2_rsa_ctx *rsactx;
>      const unsigned char *s, *e, *n;
>      unsigned long len, e_len, n_len;
> +    const unsigned char *end = hostkey_data + hostkey_data_len;
>      int ret;
>  
> -    (void) hostkey_data_len;
> -
>      if (*abstract) {
>          hostkey_method_ssh_rsa_dtor(session, abstract);
>          *abstract = NULL;
>      }
>  
>      s = hostkey_data;
> +    if (4 > end - s)
> +        return -1;
>      len = _libssh2_ntohu32(s);
>      s += 4;
> +    if (len > (size_t)(end - s))
> +        return -1;
>  
>      if (len != 7 || strncmp((char *) s, "ssh-rsa", 7) != 0) {
>          return -1;
>      }
> -    s += 7;
> +    s += len;
>  
> +    if (4 > end - s)
> +        return -1;
>      e_len = _libssh2_ntohu32(s);
>      s += 4;
> +    if (e_len > (size_t)(end - s))
> +        return -1;
>  
>      e = s;
>      s += e_len;
> +    if (4 > end - s)
> +        return -1;
>      n_len = _libssh2_ntohu32(s);
>      s += 4;
> +    if (n_len > (size_t)(end - s))
> +        return -1;
>      n = s;
>  
>      ret = _libssh2_rsa_new(&rsactx, e, e_len, n, n_len, NULL, 0,
> @@ -181,6 +192,8 @@ hostkey_method_ssh_rsa_sig_verify(LIBSSH2_SESSION * session,
>      (void) session;
>  
>      /* Skip past keyname_len(4) + keyname(7){"ssh-rsa"} + signature_len(4) */
> +    if (15 > sig_len)
> +        return -1;
>      sig += 15;
>      sig_len -= 15;
>      return _libssh2_rsa_sha1_verify(rsactx, sig, sig_len, m, m_len);
> diff --git a/src/kex.c b/src/kex.c
> index 40dbeab..2381d52 100644
> --- a/src/kex.c
> +++ b/src/kex.c
> @@ -2463,21 +2463,20 @@ static int kex_agree_comp(LIBSSH2_SESSION *session,
>   * within the given packet.
>   */
>  static int kex_string_pair(unsigned char **sp,   /* parsing position */
> -                           unsigned char *data,  /* start pointer to packet */
> -                           size_t data_len,      /* size of total packet */
> +                           unsigned char *end,   /* end of packet */
>                             size_t *lenp,         /* length of the string */
>                             unsigned char **strp) /* pointer to string start */
>  {
>      unsigned char *s = *sp;
> -    *lenp = _libssh2_ntohu32(s);
>  
> -    /* the length of the string must fit within the current pointer and the
> -       end of the packet */
> -    if (*lenp > (data_len - (s - data) -4))
> +    if (4 > end - s)
>          return 1;
> -    *strp = s + 4;
> -    s += 4 + *lenp;
> -
> +    *lenp = _libssh2_ntohu32(s);
> +    s += 4;
> +    if (*lenp > (size_t)(end - s))
> +        return 1;
> +    *strp = s;
> +    s += *lenp;
>      *sp = s;
>      return 0;
>  }
> @@ -2493,6 +2492,10 @@ static int kex_agree_methods(LIBSSH2_SESSION * session, unsigned char *data,
>      size_t kex_len, hostkey_len, crypt_cs_len, crypt_sc_len, comp_cs_len;
>      size_t comp_sc_len, mac_cs_len, mac_sc_len;
>      unsigned char *s = data;
> +    unsigned char *end = data + data_len;
> +
> +    if (1 + 16 > end - s)
> +       return -1; 
>  
>      /* Skip packet_type, we know it already */
>      s++;
> @@ -2501,21 +2504,24 @@ static int kex_agree_methods(LIBSSH2_SESSION * session, unsigned char *data,
>      s += 16;
>  
>      /* Locate each string */
> -    if(kex_string_pair(&s, data, data_len, &kex_len, &kex))
> +    if(kex_string_pair(&s, end, &kex_len, &kex))
> +        return -1;
> +    if(kex_string_pair(&s, end, &hostkey_len, &hostkey))
>          return -1;
> -    if(kex_string_pair(&s, data, data_len, &hostkey_len, &hostkey))
> +    if(kex_string_pair(&s, end, &crypt_cs_len, &crypt_cs))
>          return -1;
> -    if(kex_string_pair(&s, data, data_len, &crypt_cs_len, &crypt_cs))
> +    if(kex_string_pair(&s, end, &crypt_sc_len, &crypt_sc))
>          return -1;
> -    if(kex_string_pair(&s, data, data_len, &crypt_sc_len, &crypt_sc))
> +    if(kex_string_pair(&s, end, &mac_cs_len, &mac_cs))
>          return -1;
> -    if(kex_string_pair(&s, data, data_len, &mac_cs_len, &mac_cs))
> +    if(kex_string_pair(&s, end, &mac_sc_len, &mac_sc))
>          return -1;
> -    if(kex_string_pair(&s, data, data_len, &mac_sc_len, &mac_sc))
> +    if(kex_string_pair(&s, end, &comp_cs_len, &comp_cs))
>          return -1;
> -    if(kex_string_pair(&s, data, data_len, &comp_cs_len, &comp_cs))
> +    if(kex_string_pair(&s, end, &comp_sc_len, &comp_sc))
>          return -1;
> -    if(kex_string_pair(&s, data, data_len, &comp_sc_len, &comp_sc))
> +
> +    if (1 > end - s)
>          return -1;
>  
>      /* If the server sent an optimistic packet, assume that it guessed wrong.
> @@ -2524,9 +2530,6 @@ static int kex_agree_methods(LIBSSH2_SESSION * session, unsigned char *data,
>      session->burn_optimistic_kexinit = *(s++);
>      /* Next uint32 in packet is all zeros (reserved) */
>  
> -    if (data_len < (unsigned) (s - data))
> -        return -1;              /* short packet */
> -
>      if (kex_agree_kex_hostkey(session, kex, kex_len, hostkey, hostkey_len)) {
>          return -1;
>      }
> diff --git a/src/packet.c b/src/packet.c
> index 5f1feb8..3659daa 100644
> --- a/src/packet.c
> +++ b/src/packet.c
> @@ -85,10 +85,12 @@ packet_queue_listener(LIBSSH2_SESSION * session, unsigned char *data,
>      char failure_code = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
>      int rc;
>  
> -    (void) datalen;
> -
>      if (listen_state->state == libssh2_NB_state_idle) {
>          unsigned char *s = data + (sizeof("forwarded-tcpip") - 1) + 5;
> +        unsigned char *end = data + datalen;
> +        if (4*4 > (end - s)) {
> +            return 0; /* XXX ??? XXX */
> +        }
>          listen_state->sender_channel = _libssh2_ntohu32(s);
>          s += 4;
>  
> @@ -99,15 +101,27 @@ packet_queue_listener(LIBSSH2_SESSION * session, unsigned char *data,
>  
>          listen_state->host_len = _libssh2_ntohu32(s);
>          s += 4;
> +        if (listen_state->host_len > (size_t)(end - s)) {
> +            return 0; /* XXX ??? XXX */
> +        }
>          listen_state->host = s;
>          s += listen_state->host_len;
> +        if (4*2 > (end - s)) {
> +            return 0; /* XXX ??? XXX */
> +        }
>          listen_state->port = _libssh2_ntohu32(s);
>          s += 4;
>  
>          listen_state->shost_len = _libssh2_ntohu32(s);
>          s += 4;
> +        if (listen_state->shost_len > (size_t)(end - s)) {
> +            return 0; /* XXX ??? XXX */
> +        }
>          listen_state->shost = s;
>          s += listen_state->shost_len;
> +        if (4 > (end - s)) {
> +            return 0; /* XXX ??? XXX */
> +        }
>          listen_state->sport = _libssh2_ntohu32(s);
>  
>          _libssh2_debug(session, LIBSSH2_TRACE_CONN,
> @@ -271,10 +285,12 @@ packet_x11_open(LIBSSH2_SESSION * session, unsigned char *data,
>      LIBSSH2_CHANNEL *channel = x11open_state->channel;
>      int rc;
>  
> -    (void) datalen;
> -
>      if (x11open_state->state == libssh2_NB_state_idle) {
>          unsigned char *s = data + (sizeof("x11") - 1) + 5;
> +        unsigned char *end = data + datalen;
> +        if (4*4 > (end - s)) {
> +            return 0; /* XXX ??? XXX */
> +        }
>          x11open_state->sender_channel = _libssh2_ntohu32(s);
>          s += 4;
>          x11open_state->initial_window_size = _libssh2_ntohu32(s);
> @@ -283,8 +299,14 @@ packet_x11_open(LIBSSH2_SESSION * session, unsigned char *data,
>          s += 4;
>          x11open_state->shost_len = _libssh2_ntohu32(s);
>          s += 4;
> +        if (x11open_state->shost_len > (size_t)(end - s)) {
> +            return 0; /* XXX ??? XXX */
> +        }
>          x11open_state->shost = s;
>          s += x11open_state->shost_len;
> +        if (4 > (end - s)) {
> +            return 0; /* XXX ??? XXX */
> +        }
>          x11open_state->sport = _libssh2_ntohu32(s);
>  
>          _libssh2_debug(session, LIBSSH2_TRACE_CONN,
> @@ -807,22 +829,26 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
>                  else if (len == sizeof("exit-signal") - 1
>                           && !memcmp("exit-signal", data + 9,
>                                      sizeof("exit-signal") - 1)) {
> +                    unsigned char *end = data + datalen;
> +                    unsigned char *s = data + 9 + sizeof("exit-signal");
>                      /* command terminated due to signal */
>                      if(datalen >= 20)
>                          channelp = _libssh2_channel_locate(session, channel);
>  
> -                    if (channelp) {
> +                    if (channelp && end - s >= 4) {
>                          /* set signal name (without SIG prefix) */
> -                        uint32_t namelen =
> -                            _libssh2_ntohu32(data + 9 + sizeof("exit-signal"));
> +                        uint32_t namelen = _libssh2_ntohu32(s);
> +                        s += 4;
> +                        if (namelen > (size_t)(end - s))
> +                            /* XXX ??? XXX */;
> +                        else {
>                          channelp->exit_signal =
>                              LIBSSH2_ALLOC(session, namelen + 1);
>                          if (!channelp->exit_signal)
>                              rc = _libssh2_error(session, LIBSSH2_ERROR_ALLOC,
>                                                  "memory for signal name");
>                          else {
> -                            memcpy(channelp->exit_signal,
> -                                   data + 13 + sizeof("exit_signal"), namelen);
> +                            memcpy(channelp->exit_signal, s, namelen);
>                              channelp->exit_signal[namelen] = '\0';
>                              /* TODO: save error message and language tag */
>                              _libssh2_debug(session, LIBSSH2_TRACE_CONN,
> @@ -832,6 +858,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
>                                             channelp->local.id,
>                                             channelp->remote.id);
>                          }
> +                        }
>                      }
>                  }
>  
> diff --git a/src/publickey.c b/src/publickey.c
> index bfee0a8..d19efb7 100644
> --- a/src/publickey.c
> +++ b/src/publickey.c
> @@ -247,6 +247,7 @@ publickey_response_success(LIBSSH2_PUBLICKEY * pkey)
>          switch (response) {
>          case LIBSSH2_PUBLICKEY_RESPONSE_STATUS:
>              /* Error, or processing complete */
> +        if (data_len >= 4)
>          {
>              unsigned long status = _libssh2_ntohu32(s);
>  
> @@ -258,6 +259,7 @@ publickey_response_success(LIBSSH2_PUBLICKEY * pkey)
>              publickey_status_error(pkey, session, status);
>              return -1;
>          }
> +        /* fallthru */
>          default:
>              LIBSSH2_FREE(session, data);
>              if (response < 0) {
> @@ -403,6 +405,7 @@ static LIBSSH2_PUBLICKEY *publickey_init(LIBSSH2_SESSION *session)
>      if (session->pkeyInit_state == libssh2_NB_state_sent3) {
>          while (1) {
>              unsigned char *s;
> +            unsigned char *end;
>              rc = publickey_packet_receive(session->pkeyInit_pkey,
>                                            &session->pkeyInit_data,
>                                            &session->pkeyInit_data_len);
> @@ -419,6 +422,7 @@ static LIBSSH2_PUBLICKEY *publickey_init(LIBSSH2_SESSION *session)
>              }
>  
>              s = session->pkeyInit_data;
> +            end = session->pkeyInit_data + session->pkeyInit_data_len;
>              if ((response =
>                   publickey_response_id(&s, session->pkeyInit_data_len)) < 0) {
>                  _libssh2_error(session, LIBSSH2_ERROR_PUBLICKEY_PROTOCOL,
> @@ -432,19 +436,33 @@ static LIBSSH2_PUBLICKEY *publickey_init(LIBSSH2_SESSION *session)
>              {
>                  unsigned long status, descr_len, lang_len;
>  
> -                status = _libssh2_ntohu32(s);
> -                s += 4;
> -                descr_len = _libssh2_ntohu32(s);
> -                s += 4;
> -                /* description starts here */
> -                s += descr_len;
> -                lang_len = _libssh2_ntohu32(s);
> -                s += 4;
> -                /* lang starts here */
> -                s += lang_len;
> -
> -                if (s >
> -                    session->pkeyInit_data + session->pkeyInit_data_len) {
> +                if (4*2 > end - s)
> +                    s = NULL;
> +                else {
> +                    status = _libssh2_ntohu32(s);
> +                    s += 4;
> +                    descr_len = _libssh2_ntohu32(s);
> +                    s += 4;
> +                    /* description starts here */
> +                    if (descr_len > (size_t)(end - s))
> +                        s = NULL;
> +                    else {
> +                        s += descr_len;
> +                        if (4 > end - s)
> +                            s = NULL;
> +                        else {
> +                            lang_len = _libssh2_ntohu32(s);
> +                            s += 4;
> +                            /* lang starts here */
> +                            if (lang_len > (size_t)(end - s))
> +                                s = NULL;
> +			    else
> +                                s += lang_len;
> +                        }
> +                    }
> +                }
> +
> +                if (s == NULL) {
>                      _libssh2_error(session,
>                                     LIBSSH2_ERROR_PUBLICKEY_PROTOCOL,
>                                     "Malformed publickey subsystem packet");
> @@ -810,6 +828,7 @@ libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY * pkey, unsigned long *num_keys,
>      }
>  
>      while (1) {
> +        unsigned char *end;
>          rc = publickey_packet_receive(pkey, &pkey->listFetch_data,
>                                        &pkey->listFetch_data_len);
>          if (rc == LIBSSH2_ERROR_EAGAIN) {
> @@ -822,6 +841,7 @@ libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY * pkey, unsigned long *num_keys,
>          }
>  
>          pkey->listFetch_s = pkey->listFetch_data;
> +        end = pkey->listFetch_data + pkey->listFetch_data_len;
>          if ((response =
>               publickey_response_id(&pkey->listFetch_s,
>                                     pkey->listFetch_data_len)) < 0) {
> @@ -836,19 +856,34 @@ libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY * pkey, unsigned long *num_keys,
>          {
>              unsigned long status, descr_len, lang_len;
>  
> -            status = _libssh2_ntohu32(pkey->listFetch_s);
> -            pkey->listFetch_s += 4;
> -            descr_len = _libssh2_ntohu32(pkey->listFetch_s);
> -            pkey->listFetch_s += 4;
> -            /* description starts at pkey->listFetch_s */
> -            pkey->listFetch_s += descr_len;
> -            lang_len = _libssh2_ntohu32(pkey->listFetch_s);
> -            pkey->listFetch_s += 4;
> -            /* lang starts at pkey->listFetch_s */
> -            pkey->listFetch_s += lang_len;
> -
> -            if (pkey->listFetch_s >
> -                pkey->listFetch_data + pkey->listFetch_data_len) {
> +            if (4*2 > end - pkey->listFetch_s)
> +                pkey->listFetch_s = NULL;
> +            else {
> +                status = _libssh2_ntohu32(pkey->listFetch_s);
> +                pkey->listFetch_s += 4;
> +                descr_len = _libssh2_ntohu32(pkey->listFetch_s);
> +                pkey->listFetch_s += 4;
> +                if (descr_len > (size_t)(end - pkey->listFetch_s))
> +                    pkey->listFetch_s = NULL;
> +                else {
> +                    /* description starts at pkey->listFetch_s */
> +                    pkey->listFetch_s += descr_len;
> +                    if (4 > end - pkey->listFetch_s)
> +                        pkey->listFetch_s = NULL;
> +                    else {
> +                        lang_len = _libssh2_ntohu32(pkey->listFetch_s);
> +                        pkey->listFetch_s += 4;
> +                        if (lang_len > (size_t)(end - pkey->listFetch_s))
> +                            pkey->listFetch_s = NULL;
> +                        else {
> +                            /* lang starts at pkey->listFetch_s */
> +                            pkey->listFetch_s += lang_len;
> +                        }
> +                    }
> +                }
> +            }
> +
> +            if (pkey->listFetch_s == NULL) {
>                  _libssh2_error(session, LIBSSH2_ERROR_PUBLICKEY_PROTOCOL,
>                                 "Malformed publickey subsystem packet");
>                  goto err_exit;
> @@ -887,8 +922,12 @@ libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY * pkey, unsigned long *num_keys,
>              if (pkey->version == 1) {
>                  unsigned long comment_len;
>  
> +                if (4 > end - pkey->listFetch_s)
> +                    goto err_exit;
>                  comment_len = _libssh2_ntohu32(pkey->listFetch_s);
>                  pkey->listFetch_s += 4;
> +                if (comment_len > (size_t)(end - pkey->listFetch_s))
> +                    goto err_exit;
>                  if (comment_len) {
>                      list[keys].num_attrs = 1;
>                      list[keys].attrs =
> @@ -911,24 +950,42 @@ libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY * pkey, unsigned long *num_keys,
>                      list[keys].num_attrs = 0;
>                      list[keys].attrs = NULL;
>                  }
> +                if (4 > end - pkey->listFetch_s)
> +                    goto err_exit;
>                  list[keys].name_len = _libssh2_ntohu32(pkey->listFetch_s);
>                  pkey->listFetch_s += 4;
> +                if (list[keys].name_len > (size_t)(end - pkey->listFetch_s))
> +                    goto err_exit;
>                  list[keys].name = pkey->listFetch_s;
>                  pkey->listFetch_s += list[keys].name_len;
> +                if (4 > end - pkey->listFetch_s)
> +                    goto err_exit;
>                  list[keys].blob_len = _libssh2_ntohu32(pkey->listFetch_s);
>                  pkey->listFetch_s += 4;
> +                if (list[keys].blob_len > (size_t)(end - pkey->listFetch_s))
> +                    goto err_exit;
>                  list[keys].blob = pkey->listFetch_s;
>                  pkey->listFetch_s += list[keys].blob_len;
>              } else {
>                  /* Version == 2 */
> +                if (4 > end - pkey->listFetch_s)
> +                    goto err_exit;
>                  list[keys].name_len = _libssh2_ntohu32(pkey->listFetch_s);
>                  pkey->listFetch_s += 4;
> +                if (list[keys].name_len > (size_t)(end - pkey->listFetch_s))
> +                    goto err_exit;
>                  list[keys].name = pkey->listFetch_s;
>                  pkey->listFetch_s += list[keys].name_len;
> +                if (4 > end - pkey->listFetch_s)
> +                    goto err_exit;
>                  list[keys].blob_len = _libssh2_ntohu32(pkey->listFetch_s);
>                  pkey->listFetch_s += 4;
> +                if (list[keys].blob_len > (size_t)(end - pkey->listFetch_s))
> +                    goto err_exit;
>                  list[keys].blob = pkey->listFetch_s;
>                  pkey->listFetch_s += list[keys].blob_len;
> +                if (4 > end - pkey->listFetch_s)
> +                    goto err_exit;
>                  list[keys].num_attrs = _libssh2_ntohu32(pkey->listFetch_s);
>                  pkey->listFetch_s += 4;
>                  if (list[keys].num_attrs) {
> @@ -943,14 +1000,22 @@ libssh2_publickey_list_fetch(LIBSSH2_PUBLICKEY * pkey, unsigned long *num_keys,
>                          goto err_exit;
>                      }
>                      for(i = 0; i < list[keys].num_attrs; i++) {
> +                        if (4 > end - pkey->listFetch_s)
> +                            goto err_exit;
>                          list[keys].attrs[i].name_len =
>                              _libssh2_ntohu32(pkey->listFetch_s);
>                          pkey->listFetch_s += 4;
> +                        if (list[keys].attrs[i].name_len > (size_t)(end - pkey->listFetch_s))
> +                            goto err_exit;
>                          list[keys].attrs[i].name = (char *) pkey->listFetch_s;
>                          pkey->listFetch_s += list[keys].attrs[i].name_len;
> +                        if (4 > end - pkey->listFetch_s)
> +                            goto err_exit;
>                          list[keys].attrs[i].value_len =
>                              _libssh2_ntohu32(pkey->listFetch_s);
>                          pkey->listFetch_s += 4;
> +                        if (list[keys].attrs[i].value_len > (size_t)(end - pkey->listFetch_s))
> +                            goto err_exit;
>                          list[keys].attrs[i].value = (char *) pkey->listFetch_s;
>                          pkey->listFetch_s += list[keys].attrs[i].value_len;
>  
> diff --git a/src/session.c b/src/session.c
> index 06e61dd..ba1bad5 100644
> --- a/src/session.c
> +++ b/src/session.c
> @@ -763,6 +763,7 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock)
>              return rc;
>  
>          session->startup_service_length =
> +            (5 > session->startup_data_len) ? 0 :
>              _libssh2_ntohu32(session->startup_data + 1);
>  
>          if ((session->startup_service_length != (sizeof("ssh-userauth") - 1))
> @@ -1410,6 +1411,7 @@ libssh2_poll_channel_read(LIBSSH2_CHANNEL *channel, int extended)
>      packet = _libssh2_list_first(&session->packets);
>  
>      while (packet) {
> +	/* XXX assert(packet->data_len >= 5) XXX */
>          if ( channel->local.id == _libssh2_ntohu32(packet->data + 1)) {
>              if ( extended == 1 &&
>                   (packet->data[0] == SSH_MSG_CHANNEL_EXTENDED_DATA
> diff --git a/src/sftp.c b/src/sftp.c
> index c142713..ad38638 100644
> --- a/src/sftp.c
> +++ b/src/sftp.c
> @@ -249,6 +249,7 @@ sftp_packet_add(LIBSSH2_SFTP *sftp, unsigned char *data,
>                                "Out of sync with the world");
>      }
>  
> +    /* XXX ??? assert(data_len >= 5); XXX */
>      request_id = _libssh2_ntohu32(&data[1]);
>  
>      _libssh2_debug(session, LIBSSH2_TRACE_SFTP, "Received packet id %d",
> @@ -635,21 +636,25 @@ sftp_attr2bin(unsigned char *p, const LIBSSH2_SFTP_ATTRIBUTES * attrs)
>  
>  /* sftp_bin2attr
>   */
> -static int
> -sftp_bin2attr(LIBSSH2_SFTP_ATTRIBUTES * attrs, const unsigned char *p)
> +static const unsigned char *
> +sftp_bin2attr(LIBSSH2_SFTP_ATTRIBUTES * attrs, const unsigned char *s, const unsigned char *end)
>  {
> -    const unsigned char *s = p;
> -
>      memset(attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES));
> +    if (4 < end - p)
> +        return NULL;
>      attrs->flags = _libssh2_ntohu32(s);
>      s += 4;
>  
>      if (attrs->flags & LIBSSH2_SFTP_ATTR_SIZE) {
> +        if (8 < end - p)
> +            return NULL;
>          attrs->filesize = _libssh2_ntohu64(s);
>          s += 8;
>      }
>  
>      if (attrs->flags & LIBSSH2_SFTP_ATTR_UIDGID) {
> +        if (4*2 < end - p)
> +            return NULL;
>          attrs->uid = _libssh2_ntohu32(s);
>          s += 4;
>          attrs->gid = _libssh2_ntohu32(s);
> @@ -657,18 +662,22 @@ sftp_bin2attr(LIBSSH2_SFTP_ATTRIBUTES * attrs, const unsigned char *p)
>      }
>  
>      if (attrs->flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) {
> +        if (4 < end - p)
> +            return NULL;
>          attrs->permissions = _libssh2_ntohu32(s);
>          s += 4;
>      }
>  
>      if (attrs->flags & LIBSSH2_SFTP_ATTR_ACMODTIME) {
> +        if (4*2 < end - p)
> +            return NULL;
>          attrs->atime = _libssh2_ntohu32(s);
>          s += 4;
>          attrs->mtime = _libssh2_ntohu32(s);
>          s += 4;
>      }
>  
> -    return (s - p);
> +    return s;
>  }
>  
>  /* ************
> @@ -1698,7 +1707,7 @@ static ssize_t sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer,
>              if (attrs)
>                  memset(attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES));
>  
> -            s += sftp_bin2attr(attrs ? attrs : &attrs_dummy, s);
> +            s = sftp_bin2attr(attrs ? attrs : &attrs_dummy, s, handle->u.dir.names_end);
>  
>              handle->u.dir.next_name = (char *) s;
>            end:
> @@ -1789,6 +1798,7 @@ static ssize_t sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer,
>  
>      handle->u.dir.names_left = num_names;
>      handle->u.dir.names_packet = data;
> +    handle->u.dir.names_end = data + data_len;
>      handle->u.dir.next_name = (char *) data + 9;
>  
>      /* use the name popping mechanism from the start of the function */
> @@ -2252,7 +2262,7 @@ static int sftp_fstat(LIBSSH2_SFTP_HANDLE *handle,
>          }
>      }
>  
> -    sftp_bin2attr(attrs, data + 5);
> +    sftp_bin2attr(attrs, data + 5, data + data_len);
>      LIBSSH2_FREE(session, data);
>  
>      return 0;
> @@ -2559,6 +2569,7 @@ static int sftp_unlink(LIBSSH2_SFTP *sftp, const char *filename,
>  
>      sftp->unlink_state = libssh2_NB_state_idle;
>  
> +    /* XXX ??? assert(data_len >= 5+4); XXX */
>      retcode = _libssh2_ntohu32(data + 5);
>      LIBSSH2_FREE(session, data);
>  
> @@ -2669,6 +2680,7 @@ static int sftp_rename(LIBSSH2_SFTP *sftp, const char *source_filename,
>  
>      sftp->rename_state = libssh2_NB_state_idle;
>  
> +    /* XXX ??? assert(data_len >= 5+4); XXX */
>      retcode = _libssh2_ntohu32(data + 5);
>      LIBSSH2_FREE(session, data);
>  
> @@ -2793,6 +2805,7 @@ static int sftp_fstatvfs(LIBSSH2_SFTP_HANDLE *handle, LIBSSH2_SFTP_STATVFS *st)
>                                "Error waiting for FXP EXTENDED REPLY");
>      }
>  
> +    /* XXX ??? assert(data_len >= 5+4); XXX */
>      if (data[0] == SSH_FXP_STATUS) {
>          int retcode = _libssh2_ntohu32(data + 5);
>          sftp->fstatvfs_state = libssh2_NB_state_idle;
> @@ -2919,6 +2932,7 @@ static int sftp_statvfs(LIBSSH2_SFTP *sftp, const char *path,
>                                "Error waiting for FXP EXTENDED REPLY");
>      }
>  
> +    /* XXX ??? assert(data_len >= 5+4); XXX */
>      if (data[0] == SSH_FXP_STATUS) {
>          int retcode = _libssh2_ntohu32(data + 5);
>          sftp->statvfs_state = libssh2_NB_state_idle;
> @@ -3051,6 +3065,7 @@ static int sftp_mkdir(LIBSSH2_SFTP *sftp, const char *path,
>  
>      sftp->mkdir_state = libssh2_NB_state_idle;
>  
> +    /* XXX ??? assert(data_len >= 5+4); XXX */
>      retcode = _libssh2_ntohu32(data + 5);
>      LIBSSH2_FREE(session, data);
>  
> @@ -3145,6 +3160,7 @@ static int sftp_rmdir(LIBSSH2_SFTP *sftp, const char *path,
>  
>      sftp->rmdir_state = libssh2_NB_state_idle;
>  
> +    /* XXX ??? assert(data_len >= 5+4); XXX */
>      retcode = _libssh2_ntohu32(data + 5);
>      LIBSSH2_FREE(session, data);
>  
> @@ -3188,6 +3204,7 @@ static int sftp_stat(LIBSSH2_SFTP *sftp, const char *path,
>          ((stat_type ==
>            LIBSSH2_SFTP_SETSTAT) ? sftp_attrsize(attrs->flags) : 0);
>      unsigned char *s, *data;
> +    unsigned char *data_end;
>      static const unsigned char stat_responses[2] =
>          { SSH_FXP_ATTRS, SSH_FXP_STATUS };
>      int rc;
> @@ -3258,6 +3275,8 @@ static int sftp_stat(LIBSSH2_SFTP *sftp, const char *path,
>  
>      sftp->stat_state = libssh2_NB_state_idle;
>  
> +    /* XXX ??? assert(data_len >= 5+4); XXX */
> +
>      if (data[0] == SSH_FXP_STATUS) {
>          int retcode;
>  
> @@ -3273,7 +3292,7 @@ static int sftp_stat(LIBSSH2_SFTP *sftp, const char *path,
>      }
>  
>      memset(attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES));
> -    sftp_bin2attr(attrs, data + 5);
> +    sftp_bin2attr(attrs, data + 5, data + data_len);
>      LIBSSH2_FREE(session, data);
>  
>      return 0;
> @@ -3389,6 +3408,8 @@ static int sftp_symlink(LIBSSH2_SFTP *sftp, const char *path,
>  
>      sftp->symlink_state = libssh2_NB_state_idle;
>  
> +    /* XXX ??? assert(data_len >= 5+4); XXX */
> +
>      if (data[0] == SSH_FXP_STATUS) {
>          int retcode;
>  
> @@ -3410,8 +3431,13 @@ static int sftp_symlink(LIBSSH2_SFTP *sftp, const char *path,
>                                "no name entries");
>      }
>  
> +    /* XXX ??? assert(data_len >= 5+4*2); XXX */
> +
>      /* this reads a u32 and stores it into a signed 32bit value */
>      link_len = _libssh2_ntohu32(data + 9);
> +
> +    /* XXX ??? assert(data_len-(5+4*2) >= link_len); XXX */
> +
>      if (link_len < target_len) {
>          memcpy(target, data + 13, link_len);
>          target[link_len] = 0;
> diff --git a/src/sftp.h b/src/sftp.h
> index 2ed32ce..91fc0a7 100644
> --- a/src/sftp.h
> +++ b/src/sftp.h
> @@ -122,6 +122,7 @@ struct _LIBSSH2_SFTP_HANDLE
>              uint32_t names_left;
>              void *names_packet;
>              char *next_name;
> +            char *names_end;
>          } dir;
>      } u;
>  
> diff --git a/src/userauth.c b/src/userauth.c
> index cdfa25e..c799a40 100644
> --- a/src/userauth.c
> +++ b/src/userauth.c
> @@ -69,6 +69,7 @@ static char *userauth_list(LIBSSH2_SESSION *session, const char *username,
>         service(14)"ssh-connection" + method_len(4) = 27 */
>      unsigned long methods_len;
>      unsigned char *s;
> +    unsigned char *end;
>      int rc;
>  
>      if (session->userauth_list_state == libssh2_NB_state_idle) {
> @@ -143,7 +144,18 @@ static char *userauth_list(LIBSSH2_SESSION *session, const char *username,
>              return NULL;
>          }
>  
> +        if (5 > session->userauth_list_data_len) {
> +            /* XXX ??? XXX */
> +userauth_packet_overrun:
> +            LIBSSH2_FREE(session, session->userauth_list_data);
> +            session->userauth_list_data = NULL;
> +            session->userauth_list_state = libssh2_NB_state_idle;
> +            return NULL;
> +        }
>          methods_len = _libssh2_ntohu32(session->userauth_list_data + 1);
> +        if (methods_len > session->userauth_list_data_len - 5) {
> +            goto userauth_packet_overrun;
> +        }
>  
>          /* Do note that the memory areas overlap! */
>          memmove(session->userauth_list_data, session->userauth_list_data + 5,
> @@ -1561,6 +1573,7 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session,
>                                LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC((*response_callback)))
>  {
>      unsigned char *s;
> +    unsigned char *end;
>      int rc;
>  
>      static const unsigned char reply_codes[4] = {
> @@ -1685,10 +1698,15 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session,
>  
>              /* server requested PAM-like conversation */
>              s = session->userauth_kybd_data + 1;
> +            end = session->userauth_kybd_data + session->userauth_kybd_data_len;
>  
>              /* string    name (ISO-10646 UTF-8) */
> +            if (4 > end - s)
> +                goto cleanup; /* XXX ??? XXX */
>              session->userauth_kybd_auth_name_len = _libssh2_ntohu32(s);
>              s += 4;
> +            if (session->userauth_kybd_auth_name_len > (size_t)(end - s))
> +                goto cleanup; /* XXX ??? XXX */
>              if(session->userauth_kybd_auth_name_len) {
>                  session->userauth_kybd_auth_name =
>                      LIBSSH2_ALLOC(session,
> @@ -1706,8 +1724,12 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session,
>              }
>  
>              /* string    instruction (ISO-10646 UTF-8) */
> +            if (4 > end - s)
> +                goto cleanup; /* XXX ??? XXX */
>              session->userauth_kybd_auth_instruction_len = _libssh2_ntohu32(s);
>              s += 4;
> +            if (session->userauth_kybd_auth_instruction_len > (size_t)(end - s))
> +                goto cleanup; /* XXX ??? XXX */
>              if(session->userauth_kybd_auth_instruction_len) {
>                  session->userauth_kybd_auth_instruction =
>                      LIBSSH2_ALLOC(session,
> @@ -1725,13 +1747,19 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session,
>              }
>  
>              /* string    language tag (as defined in [RFC-3066]) */
> +            if (4 > end - s)
> +                goto cleanup; /* XXX ??? XXX */
>              language_tag_len = _libssh2_ntohu32(s);
>              s += 4;
> +            if (language_tag_len > (size_t)(end - s))
> +                goto cleanup; /* XXX ??? XXX */
>  
>              /* ignoring this field as deprecated */
>              s += language_tag_len;
>  
>              /* int       num-prompts */
> +            if (4 > end - s)
> +                goto cleanup; /* XXX ??? XXX */
>              session->userauth_kybd_num_prompts = _libssh2_ntohu32(s);
>              s += 4;
>  
> @@ -1760,9 +1788,13 @@ userauth_keyboard_interactive(LIBSSH2_SESSION * session,
>  
>                  for(i = 0; i < session->userauth_kybd_num_prompts; i++) {
>                      /* string    prompt[1] (ISO-10646 UTF-8) */
> +                    if (4 > end - s)
> +                        goto cleanup; /* XXX ??? XXX */
>                      session->userauth_kybd_prompts[i].length =
>                          _libssh2_ntohu32(s);
>                      s += 4;
> +                    if (session->userauth_kybd_prompts[i].length > (size_t)(end - s))
> +                        goto cleanup; /* XXX ??? XXX */
>                      session->userauth_kybd_prompts[i].text =
>                          LIBSSH2_CALLOC(session,
>                                         session->userauth_kybd_prompts[i].length);

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

From libssh2-devel-bounces@cool.haxx.se  Sun Mar 27 23:21:03 2016
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTP id u2RLKluc016906;
	Sun, 27 Mar 2016 23:21:00 +0200
Received: from giant.haxx.se (dast@localhost.localdomain [127.0.0.1])
 by giant.haxx.se (8.15.2/8.15.2/Debian-3) with ESMTPS id u2RLKjNw016852
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Sun, 27 Mar 2016 23:20:45 +0200
Received: from localhost (dast@localhost)
 by giant.haxx.se (8.15.2/8.15.2/Submit) with ESMTP id u2RLKj6c016849
 for <libssh2-devel@cool.haxx.se>; Sun, 27 Mar 2016 23:20:45 +0200
X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs
Date: Sun, 27 Mar 2016 23:20:45 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH][WIP][v2] Fix out-of-buffer-boundary reads (Was: [SECURITY
 ADVISORY] Truncated Difffie-Hellman secret length)
In-Reply-To: <m3a8lju3e3.fsf@gmail.com>
Message-ID: <alpine.DEB.2.20.1603272316060.31041@tvnag.unkk.fr>
References: <CAD9rwMoHmS0_WoAP-=M6WXG_DherCgDWeyBrEGO8-99yq5d70g@mail.gmail.com>
 <m3vb5bmq6j.fsf@gmail.com> <m3a8lju3e3.fsf@gmail.com>
User-Agent: Alpine 2.20 (DEB 67 2015-01-07)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id u2RLKluc016906

On Sun, 27 Mar 2016, Yuriy M. Kaminskiy wrote:

> Ping? I'd like to stress out this issue has security imlications. At very 
> least, DoS (and this is not a standalone application, so it is not a minor 
> issue), and maybe host memory exposure too. (However, it is only heap 
> over-reads, without heap/stack over-writes, so no risk of escalating to 
> remote code execution).

I can only agree that we need cleanups and fixes to make the code less 
trusting of remote packets.

It'd be easier if you'd break up your patch in smaller chunks so that they are 
easier to review and merge step by step and I would also appreciate if you'd 
add comments or use defines when you use magic constants in the code to aid 
reviewers and future readers of the code to realize that the numbers come 
from.

-- 

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

