From libssh2-devel-bounces@cool.haxx.se  Sun Apr 15 13:24:41 2018
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id w3FBNuqj008755;
	Sun, 15 Apr 2018 13:24:26 +0200
Received: from m50-111.126.com (m50-111.126.com [123.125.50.111])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id w3FBNqbH008675
 for <libssh2-devel@cool.haxx.se>; Sun, 15 Apr 2018 13:23:54 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com;
 s=s110527; h=Date:From:Subject:Mime-Version:Message-ID; bh=+hdzL
 xXZbWPGFYnJlV3M7antFvQ9ESQD/T6glnhBCpU=; b=O8A3qqoWVBY7rApmvVcdu
 xQzKS88iJYkXpRvf9uBJb1KbaVcgRL3nd7igkllnxx1SM7HLYmizu6ZQT5Olhcph
 Jp6AtLPDFmzLqR4Nosekcigi1iSGegU+ZtHjMZUs99BJG0MV3dR6C1xxDtDnruft
 D2J6aVa0NdpfBtroN0uF08=
Received: from HUGELANDTECH (unknown [182.91.44.207])
 by smtp5 (Coremail) with SMTP id jtKowACXp7c0NtNaR5itAA--.3167S2;
 Sun, 15 Apr 2018 19:23:49 +0800 (CST)
Date: Sun, 15 Apr 2018 19:23:49 +0800
From: "Samuel Zhao" <samuelzhao@126.com>
To: libssh2-devel <libssh2-devel@cool.haxx.se>
Subject: configure error: No crypto library found! when try to compile libssh2
 with openssl support
X-Priority: 3
X-Has-Attach: no
X-Mailer: Foxmail 7, 2, 7, 21[cn]
Mime-Version: 1.0
Message-ID: <201804151923332230389@126.com>
X-CM-TRANSID: jtKowACXp7c0NtNaR5itAA--.3167S2
X-Coremail-Antispam: 1Uf129KBjvdXoW7GFyDKrWrGFyUtFyfJFWkZwb_yoW3JFg_ua
 s3tF47uw4fW3yjyFnrWr4F93yFg3ZrA34Uu340vwn7A34ayan8Xwnrt34S9wn8GrykXw4D
 W3yUW3Z8CF45CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT
 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUb4CJJUUUUU==
X-Originating-IP: [182.91.44.207]
X-CM-SenderInfo: 5vdp3v5o2kt0a6rslhhfrp/1tbibQYpO1pD4Y5VvgAAsk
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://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: <https://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: multipart/mixed; boundary="===============1066516390=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

This is a multi-part message in MIME format.

--===============1066516390==
Content-Type: multipart/alternative;
	boundary="----=_001_NextPart374686201178_=----"

This is a multi-part message in MIME format.

------=_001_NextPart374686201178_=----
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: base64

SGVsbG8gLA0KDQpJJ20gdHJ5aW5nIGNvbXBpbGUmaW5zdGFsbCBsaWJzc2gyIGluIFJIRUw3LjIu
IE9uZSBlcnJvciBtc2cgYXMgYmVsb3cgd2hlbiBydW4gLi9jb25mdXJlIGNvbW1hbmQuDQoNCm9w
ZW5zc2xfMS4xLjBnIGhhcyBiZWVuIGluc3RhbGxlZCBpbiAvdXNyL2xvY2FsL29wZW5zc2wuIEFu
ZCB0aGUgZnVsbCBjb21tYW5kIGlzIDoNCltyb290XT4uL2NvbmZpZ3VyZSAtLXdpdGgtb3BlbnNz
bCAtLXdpdGgtbGlic3NsLXByZWZpeD0vdXNyL2xvY2FsL29wZW5zc2wgDQpHZXQgdGhlIGZvbGxv
d2luZyBtZXNzYWdlOg0KLi4uLi4NCmNoZWNraW5nIGZvciBsaWJzc2wgLi4uIG5vDQpjb25maWd1
cmU6ZXJyb3I6IG5vIGNyeXB0byBsaWJyYXJ5IGZvdW5kIQ0KVHJ5IC0td2l0aC1saWJzc2wtcHJl
Zml4PVBBVEgNCm9yIC0td2l0aC1saWJnY3J5cHQtcHJlZml4PVBBVEgNCm9yIC0td2l0aC1saWJt
YmVkdGxzLXByZWZpeD1QQVRIDQpvciAtLXdpdGgtd2luY25nIG9uIHdpbmRvd3MNCg0KV2hhdCdz
IHdyb25nPyBXaGF0IHNob3VsIEkgZG8gdG8gY29tcGxldGUgdGhlIGluc3RhbGxhdGlvbiBvZiBs
aWJzc2gyPyBJIGFtIHN1cmUgdGhlIE9QRU5TU0wgbGliIGhhcyBiZWVuIGluc3RhbGxlZCBpbiB0
aGlzIG1hY2hpbmUgYW5kIGl0cyBsaWImaW5jbHVkZSBmaWxlcyBhcmUgcmVhZHkgdGhlcmUuDQoN
ClRoYW5rcyBmb3IgeW91ciBhbnkgaGVscCENCiANCg0KDQpTYW11ZWwgWmhhbw0K

------=_001_NextPart374686201178_=----
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charse=
t=3Dus-ascii"><style>body { line-height: 1.5; }body { font-size: 10.5pt; f=
ont-family: ????; color: rgb(0, 0, 0); line-height: 1.5; }body { font-size=
: 10.5pt; color: rgb(0, 0, 0); line-height: 1.5; font-family: ??; }</style=
></head><body>=0A<div><span></span>Hello ,</div><div><br></div><div>I'm tr=
ying compile&amp;install libssh2 in RHEL7.2. One error msg as below when r=
un ./confure command.</div><div><span style=3D"background-color: window; f=
ont-size: 10.5pt; line-height: 1.5;"><br></span></div><div><span style=3D"=
background-color: window; font-size: 10.5pt; line-height: 1.5;">openssl_1.=
1.0g has been installed in /usr/local/openssl. And the full command is :</=
span></div><div><span style=3D"background-color: window; font-size: 10.5pt=
; line-height: 1.5;">[root]&gt;./configure --with-openssl --with-libssl-pr=
efix=3D/usr/local/openssl&nbsp;</span></div><div>Get the following message=
:</div><div>.....</div><div>checking for libssl ... no</div><div>configure=
:error: no crypto library found!</div><div>Try --with-libssl-prefix=3DPATH=
</div><div>or --with-libgcrypt-prefix=3DPATH</div><div>or --with-libmbedtl=
s-prefix=3DPATH</div><div>or --with-wincng on windows</div><div><br></div>=
<div>What's wrong? What shoul I do to complete the installation of libssh2=
? I am sure the OPENSSL lib has been installed in this machine and its lib=
&amp;include files are ready there.</div><div><br></div><div>Thanks for yo=
ur any help!</div>=0A<div>&nbsp;</div>=0A<hr style=3D"WIDTH: 210px; HEIGHT=
: 1px" align=3D"left" color=3D"#b5c4df" size=3D"1">=0A<div><span>Samuel Zh=
ao</span></div>=0A</body></html>
------=_001_NextPart374686201178_=------


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

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwczovL2Nvb2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vbGlic3No
Mi1kZXZlbAo=

--===============1066516390==--

From libssh2-devel-bounces@cool.haxx.se  Sun Apr 15 14:16:27 2018
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id w3FCGEnT012662;
	Sun, 15 Apr 2018 14:16:24 +0200
Received: from foo.stuge.se (foo.stuge.se [212.116.89.98])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id w3FCGC6c012583
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Sun, 15 Apr 2018 14:16:12 +0200
Received: (qmail 6620 invoked by uid 1000); 15 Apr 2018 12:16:07 -0000
Message-ID: <20180415121607.6619.qmail@stuge.se>
Date: Sun, 15 Apr 2018 12:16:07 +0000
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Small AES patches for src/crypt.c
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="LSp5EJdfMPwZcMS1"
Content-Disposition: inline
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://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: <https://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>


--LSp5EJdfMPwZcMS1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi all,

I'm doing some work on the library and for now I have the attached
three small patches for the AES part of crypt.c.

In a later patch I'll add a common CTR mode, so that backends only
need to provide CBC. I see some work in this direction already.

I'm working on my axTLS branch, it isn't done yet, but it does work.


I am thinking to add some basic algorithm code into libssh2 itself, to
enable a build without any dependencies at all. (At the cost of a reduced
algorithm set; only MD5, SHA1, SHA2, AES, RSA, DH, maybe ChaCha later.)

It would not be high performance, but high convenience. What do you think?


//Peter

--LSp5EJdfMPwZcMS1
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0001-src-crypt.c-Make-AES-192-optional-for-crypto-backend.patch"
Content-Transfer-Encoding: quoted-printable

=46rom ea7b900e2b803624de93e669de12a5a56fd993f6 Mon Sep 17 00:00:00 2001
=46rom: Peter Stuge <peter@stuge.se>
Date: Sun, 15 Apr 2018 01:49:42 +0200
Subject: [PATCH 1/3] src/crypt.c: Make AES-192 optional for crypto backends

---
 src/crypt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/crypt.c b/src/crypt.c
index 4beb0aa..c505b9f 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -131,6 +131,7 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes128_ctr =3D {
     _libssh2_cipher_aes128ctr
 };
=20
+#ifdef _libssh2_cipher_aes192ctr
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes192_ctr =3D {
     "aes192-ctr",
     "",
@@ -143,6 +144,7 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes192_ctr =3D {
     &crypt_dtor,
     _libssh2_cipher_aes192ctr
 };
+#endif
=20
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes256_ctr =3D {
     "aes256-ctr",
@@ -172,6 +174,7 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes128_cbc =3D {
     _libssh2_cipher_aes128
 };
=20
+#ifdef _libssh2_cipher_aes192
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes192_cbc =3D {
     "aes192-cbc",
     "DEK-Info: AES-192-CBC",
@@ -184,6 +187,7 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes192_cbc =3D {
     &crypt_dtor,
     _libssh2_cipher_aes192
 };
+#endif
=20
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes256_cbc =3D {
     "aes256-cbc",
@@ -313,13 +317,17 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_metho=
d_3des_cbc =3D {
 static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_methods[] =3D {
 #if LIBSSH2_AES_CTR
   &libssh2_crypt_method_aes128_ctr,
+#ifdef libssh2_crypt_method_aes192_ctr
   &libssh2_crypt_method_aes192_ctr,
+#endif
   &libssh2_crypt_method_aes256_ctr,
 #endif /* LIBSSH2_AES */
 #if LIBSSH2_AES
     &libssh2_crypt_method_aes256_cbc,
     &libssh2_crypt_method_rijndael_cbc_lysator_liu_se,  /* =3D=3D aes256-c=
bc */
+#ifdef libssh2_crypt_method_aes192_cbc
     &libssh2_crypt_method_aes192_cbc,
+#endif
     &libssh2_crypt_method_aes128_cbc,
 #endif /* LIBSSH2_AES */
 #if LIBSSH2_BLOWFISH
--=20

--LSp5EJdfMPwZcMS1
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-src-crypt.c-List-AES-algorithms-individually-in-_lib.patch"
Content-Transfer-Encoding: quoted-printable

=46rom a6d99abf87ddc7f166d16dc089e825ad1451f197 Mon Sep 17 00:00:00 2001
=46rom: Peter Stuge <peter@stuge.se>
Date: Sun, 15 Apr 2018 01:54:43 +0200
Subject: [PATCH 2/3] src/crypt.c: List AES algorithms individually in
 _libssh2_crypt_methods

This makes it easy to reorder the list later.
---
 src/crypt.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/crypt.c b/src/crypt.c
index c505b9f..4da76be 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -315,21 +315,25 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_metho=
d_3des_cbc =3D {
 #endif
=20
 static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_methods[] =3D {
-#if LIBSSH2_AES_CTR
+#ifdef libssh2_crypt_method_aes128_ctr
   &libssh2_crypt_method_aes128_ctr,
+#endif
 #ifdef libssh2_crypt_method_aes192_ctr
   &libssh2_crypt_method_aes192_ctr,
 #endif
+#ifdef libssh2_crypt_method_aes256_ctr
   &libssh2_crypt_method_aes256_ctr,
-#endif /* LIBSSH2_AES */
-#if LIBSSH2_AES
+#endif
+#ifdef libssh2_crypt_method_aes256_cbc
     &libssh2_crypt_method_aes256_cbc,
     &libssh2_crypt_method_rijndael_cbc_lysator_liu_se,  /* =3D=3D aes256-c=
bc */
+#endif
 #ifdef libssh2_crypt_method_aes192_cbc
     &libssh2_crypt_method_aes192_cbc,
 #endif
+#ifdef libssh2_crypt_method_aes128_cbc
     &libssh2_crypt_method_aes128_cbc,
-#endif /* LIBSSH2_AES */
+#endif
 #if LIBSSH2_BLOWFISH
     &libssh2_crypt_method_blowfish_cbc,
 #endif /* LIBSSH2_BLOWFISH */
--=20

--LSp5EJdfMPwZcMS1
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0003-src-crypt.c-Make-AES-algorithm-list-aes-256-192-128-.patch"
Content-Transfer-Encoding: quoted-printable

=46rom dd4bab122b41cab4e9a9a7980227014ea50216e7 Mon Sep 17 00:00:00 2001
=46rom: Peter Stuge <peter@stuge.se>
Date: Sun, 15 Apr 2018 01:57:21 +0200
Subject: [PATCH 3/3] src/crypt.c: Make AES algorithm list
 aes{256,192,128}-{ctr,cbc}

The new order prefers larger keys and CTR over CBC for each key size:

aes256-ctr,aes256-cbc,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc

The order of the algorithm list determines the default KEX message.

The default KEX message can, as before, be overridden using:

libssh2_session_method_pref(..., LIBSSH2_METHOD_CRYPT_{CS,SC}, ...)
---
 src/crypt.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/crypt.c b/src/crypt.c
index 4da76be..9a4ccf4 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -315,12 +315,6 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method=
_3des_cbc =3D {
 #endif
=20
 static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_methods[] =3D {
-#ifdef libssh2_crypt_method_aes128_ctr
-  &libssh2_crypt_method_aes128_ctr,
-#endif
-#ifdef libssh2_crypt_method_aes192_ctr
-  &libssh2_crypt_method_aes192_ctr,
-#endif
 #ifdef libssh2_crypt_method_aes256_ctr
   &libssh2_crypt_method_aes256_ctr,
 #endif
@@ -328,9 +322,15 @@ static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_meth=
ods[] =3D {
     &libssh2_crypt_method_aes256_cbc,
     &libssh2_crypt_method_rijndael_cbc_lysator_liu_se,  /* =3D=3D aes256-c=
bc */
 #endif
+#ifdef libssh2_crypt_method_aes192_ctr
+  &libssh2_crypt_method_aes192_ctr,
+#endif
 #ifdef libssh2_crypt_method_aes192_cbc
     &libssh2_crypt_method_aes192_cbc,
 #endif
+#ifdef libssh2_crypt_method_aes128_ctr
+  &libssh2_crypt_method_aes128_ctr,
+#endif
 #ifdef libssh2_crypt_method_aes128_cbc
     &libssh2_crypt_method_aes128_cbc,
 #endif
--=20

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

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwczovL2Nvb2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vbGlic3No
Mi1kZXZlbAo=

--LSp5EJdfMPwZcMS1--

From libssh2-devel-bounces@cool.haxx.se  Sun Apr 15 14:22:37 2018
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id w3FCMWtp015883;
	Sun, 15 Apr 2018 14:22:37 +0200
Received: from foo.stuge.se (foo.stuge.se [212.116.89.98])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id w3FCMTcs015852
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Sun, 15 Apr 2018 14:22:30 +0200
Received: (qmail 6738 invoked by uid 1000); 15 Apr 2018 12:22:25 -0000
Message-ID: <20180415122225.6737.qmail@stuge.se>
Date: Sun, 15 Apr 2018 12:22:25 +0000
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: configure error: No crypto library found! when try to compile
 libssh2 with openssl support
References: <201804151923332230389@126.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201804151923332230389@126.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://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: <https://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 w3FCMWtp015883

Hi Samuel,

Samuel Zhao wrote:
> I'm trying compile&install libssh2 in RHEL7.2. One error msg as below when run ./confure command.
> 
> openssl_1.1.0g has been installed in /usr/local/openssl. And the full command is :
> [root]>./configure --with-openssl --with-libssl-prefix=/usr/local/openssl 
> Get the following message:
> .....
> checking for libssl ... no
> configure:error: no crypto library found!
> Try --with-libssl-prefix=PATH
> or --with-libgcrypt-prefix=PATH
> or --with-libmbedtls-prefix=PATH
> or --with-wincng on windows
> 
> What's wrong?  What shoul I do to complete the installation of
> libssh2?  I am sure the OPENSSL lib has been installed in this
> machine and its lib&include files are ready there.

It's not possible to say what's wrong without more information.

Please send the config.log file from the directory where you ran configure.
It may not go through to the list so you can add me in Cc: of that mail
and/or publish the file and send a link, for others to take a closer look.


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

From libssh2-devel-bounces@cool.haxx.se  Sun Apr 15 16:10:01 2018
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id w3FE9YOI010929;
	Sun, 15 Apr 2018 16:09:54 +0200
Received: from foo.stuge.se (foo.stuge.se [212.116.89.98])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id w3FE9WIU010897
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Sun, 15 Apr 2018 16:09:33 +0200
Received: (qmail 8771 invoked by uid 1000); 15 Apr 2018 14:09:27 -0000
Message-ID: <20180415140927.8770.qmail@stuge.se>
Date: Sun, 15 Apr 2018 14:09:27 +0000
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: V2! Small AES patches for src/crypt.c
References: <20180415121607.6619.qmail@stuge.se>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="PyMzGVE0NRonI6bs"
Content-Disposition: inline
In-Reply-To: <20180415121607.6619.qmail@stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://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: <https://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>


--PyMzGVE0NRonI6bs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Please disregard the first patchset. Here's an updated set, with the
first two patches combined into one because that makes sense, and with
a fix that prevented the second patch from actually working correctly.
Oops.

Tested with OpenSSL and axTLS.


//Peter

--PyMzGVE0NRonI6bs
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0001-src-crypt.c-Make-all-AES-variants-optional-for-crypt.patch"
Content-Transfer-Encoding: quoted-printable

=46rom e1cfccd60cda0abef3c80327bc56f4e398b15186 Mon Sep 17 00:00:00 2001
=46rom: Peter Stuge <peter@stuge.se>
Date: Sun, 15 Apr 2018 01:54:43 +0200
Subject: [PATCH v2 1/2] src/crypt.c: Make all AES variants optional for cry=
pto
 backends

This allows limited backends to only implement some AES variants.
---
 src/crypt.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/src/crypt.c b/src/crypt.c
index 4beb0aa..9df9e36 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -117,7 +117,7 @@ crypt_dtor(LIBSSH2_SESSION * session, void **abstract)
     return 0;
 }
=20
-#if LIBSSH2_AES_CTR
+#ifdef _libssh2_cipher_aes128ctr
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes128_ctr =3D {
     "aes128-ctr",
     "",
@@ -130,7 +130,9 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes128_ctr =3D {
     &crypt_dtor,
     _libssh2_cipher_aes128ctr
 };
+#endif
=20
+#ifdef _libssh2_cipher_aes192ctr
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes192_ctr =3D {
     "aes192-ctr",
     "",
@@ -143,7 +145,9 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes192_ctr =3D {
     &crypt_dtor,
     _libssh2_cipher_aes192ctr
 };
+#endif
=20
+#ifdef _libssh2_cipher_aes256ctr
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes256_ctr =3D {
     "aes256-ctr",
     "",
@@ -158,7 +162,7 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes256_ctr =3D {
 };
 #endif
=20
-#if LIBSSH2_AES
+#ifdef _libssh2_cipher_aes128
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes128_cbc =3D {
     "aes128-cbc",
     "DEK-Info: AES-128-CBC",
@@ -171,7 +175,9 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes128_cbc =3D {
     &crypt_dtor,
     _libssh2_cipher_aes128
 };
+#endif
=20
+#ifdef _libssh2_cipher_aes192
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes192_cbc =3D {
     "aes192-cbc",
     "DEK-Info: AES-192-CBC",
@@ -184,7 +190,9 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_=
aes192_cbc =3D {
     &crypt_dtor,
     _libssh2_cipher_aes192
 };
+#endif
=20
+#ifdef _libssh2_cipher_aes256
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes256_cbc =3D {
     "aes256-cbc",
     "DEK-Info: AES-256-CBC",
@@ -212,7 +220,7 @@ static const LIBSSH2_CRYPT_METHOD
     &crypt_dtor,
     _libssh2_cipher_aes256
 };
-#endif /* LIBSSH2_AES */
+#endif
=20
 #if LIBSSH2_BLOWFISH
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_blowfish_cbc =3D {
@@ -311,17 +319,25 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_metho=
d_3des_cbc =3D {
 #endif
=20
 static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_methods[] =3D {
-#if LIBSSH2_AES_CTR
+#ifdef _libssh2_cipher_aes128ctr
   &libssh2_crypt_method_aes128_ctr,
+#endif
+#ifdef _libssh2_cipher_aes192ctr
   &libssh2_crypt_method_aes192_ctr,
+#endif
+#ifdef _libssh2_cipher_aes256ctr
   &libssh2_crypt_method_aes256_ctr,
-#endif /* LIBSSH2_AES */
-#if LIBSSH2_AES
+#endif
+#ifdef _libssh2_cipher_aes256
     &libssh2_crypt_method_aes256_cbc,
     &libssh2_crypt_method_rijndael_cbc_lysator_liu_se,  /* =3D=3D aes256-c=
bc */
+#endif
+#ifdef _libssh2_cipher_aes192
     &libssh2_crypt_method_aes192_cbc,
+#endif
+#ifdef _libssh2_cipher_aes128
     &libssh2_crypt_method_aes128_cbc,
-#endif /* LIBSSH2_AES */
+#endif
 #if LIBSSH2_BLOWFISH
     &libssh2_crypt_method_blowfish_cbc,
 #endif /* LIBSSH2_BLOWFISH */
--=20

--PyMzGVE0NRonI6bs
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-src-crypt.c-Make-AES-algorithm-list-aes-256-192-128-.patch"
Content-Transfer-Encoding: quoted-printable

=46rom d3389c4c31a98a8c9b6ca7c3fa47074f4bf2a855 Mon Sep 17 00:00:00 2001
=46rom: Peter Stuge <peter@stuge.se>
Date: Sun, 15 Apr 2018 01:57:21 +0200
Subject: [PATCH v2 2/2] src/crypt.c: Make AES algorithm list
 aes{256,192,128}-{ctr,cbc}

The new order prefers larger keys and CTR over CBC for each key size:

aes256-ctr,aes256-cbc,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc

The order of the algorithm list determines the default KEX message.

The default KEX message can, as before, be overridden using:

libssh2_session_method_pref(..., LIBSSH2_METHOD_CRYPT_{CS,SC}, ...)
---
 src/crypt.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/crypt.c b/src/crypt.c
index 9df9e36..eef5e59 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -319,12 +319,6 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method=
_3des_cbc =3D {
 #endif
=20
 static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_methods[] =3D {
-#ifdef _libssh2_cipher_aes128ctr
-  &libssh2_crypt_method_aes128_ctr,
-#endif
-#ifdef _libssh2_cipher_aes192ctr
-  &libssh2_crypt_method_aes192_ctr,
-#endif
 #ifdef _libssh2_cipher_aes256ctr
   &libssh2_crypt_method_aes256_ctr,
 #endif
@@ -332,9 +326,15 @@ static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_meth=
ods[] =3D {
     &libssh2_crypt_method_aes256_cbc,
     &libssh2_crypt_method_rijndael_cbc_lysator_liu_se,  /* =3D=3D aes256-c=
bc */
 #endif
+#ifdef _libssh2_cipher_aes192ctr
+  &libssh2_crypt_method_aes192_ctr,
+#endif
 #ifdef _libssh2_cipher_aes192
     &libssh2_crypt_method_aes192_cbc,
 #endif
+#ifdef _libssh2_cipher_aes128ctr
+  &libssh2_crypt_method_aes128_ctr,
+#endif
 #ifdef _libssh2_cipher_aes128
     &libssh2_crypt_method_aes128_cbc,
 #endif
--=20

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

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwczovL2Nvb2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vbGlic3No
Mi1kZXZlbAo=

--PyMzGVE0NRonI6bs--

From libssh2-devel-bounces@cool.haxx.se  Sun Apr 15 19:38:14 2018
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id w3FHbddm022694;
	Sun, 15 Apr 2018 19:38:06 +0200
Received: from foo.stuge.se (foo.stuge.se [212.116.89.98])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id w3FHbaaq022382
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Sun, 15 Apr 2018 19:37:37 +0200
Received: (qmail 11135 invoked from network); 15 Apr 2018 17:37:30 -0000
Received: from localhost (HELO stuge.se) (127.0.0.1)
 by localhost with SMTP; 15 Apr 2018 17:37:30 -0000
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: [PATCH] src/crypt.c: Fallback to implement AES CTR mode using CBC mode
Date: Sun, 15 Apr 2018 19:37:29 +0200
Message-Id: <1523813849-4238-1-git-send-email-peter@stuge.se>
In-Reply-To: <20180415140927.8770.qmail@stuge.se>
References: <20180415140927.8770.qmail@stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://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: <https://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>
MIME-Version: 1.0
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 w3FHbddm022694

If the crypto backend supports AES CTR mode directly then nothing changes.

Otherwise, libssh2 supports AES CTR ciphers anyway, as long as the crypto
backend implements AES CBC mode, at the cost of some overhead; the CBC
algorithm must be re-initialized every $blocksize bytes.

This CTR implementation is algorithm independent, but is currently used
only for AES ciphers.
---
 src/crypt.c | 182 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 167 insertions(+), 15 deletions(-)

diff --git a/src/crypt.c b/src/crypt.c
index 9d73c23..8675bcc 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -1,5 +1,6 @@
 /* Copyright (c) 2009, 2010 Simon Josefsson <simon@josefsson.org>
  * Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
+ * Copyright (c) 2018 Peter Stuge
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms,
@@ -117,6 +118,148 @@ crypt_dtor(LIBSSH2_SESSION * session, void **abstract)
     return 0;
 }
 
+#if ( \
+ (defined(_libssh2_cipher_aes256) && !defined(_libssh2_cipher_aes256ctr)) || \
+ (defined(_libssh2_cipher_aes192) && !defined(_libssh2_cipher_aes192ctr)) || \
+ (defined(_libssh2_cipher_aes128) && !defined(_libssh2_cipher_aes128ctr)) || \
+ 0) /* implement CTR mode using CBC */
+
+struct crypt_ctr_ctx {
+    const LIBSSH2_CRYPT_METHOD *method;
+    unsigned char *ctr;
+    unsigned char *tmp;
+    unsigned char *zero_iv;
+    unsigned char *secret;
+    _libssh2_cipher_ctx h;
+};
+
+static int crypt_ctr_init(LIBSSH2_SESSION *session,
+                          const LIBSSH2_CRYPT_METHOD *method,
+                          unsigned char *iv, int *free_iv,
+                          unsigned char *secret, int *free_secret,
+                          int encrypt, void **abstract)
+{
+    struct crypt_ctr_ctx *ctx;
+
+    (void)encrypt;
+
+    if (method->blocksize < 1 || method->iv_len < 1 || method->secret_len < 1)
+        return LIBSSH2_ERROR_METHOD_NOT_SUPPORTED;
+
+    if (method->blocksize != method->iv_len)
+        return LIBSSH2_ERROR_METHOD_NOT_SUPPORTED;
+
+    ctx = LIBSSH2_ALLOC(session, sizeof *ctx);
+    if (NULL == ctx)
+        goto err;
+
+    ctx->ctr = LIBSSH2_ALLOC(session, method->blocksize);
+    if (NULL == ctx->ctr)
+        goto err;
+
+    ctx->tmp = LIBSSH2_ALLOC(session, method->blocksize);
+    if (NULL == ctx->tmp)
+        goto err;
+
+    ctx->zero_iv = LIBSSH2_ALLOC(session, method->iv_len);
+    if (NULL == ctx->zero_iv)
+        goto err;
+
+    ctx->secret = LIBSSH2_ALLOC(session, method->secret_len);
+    if (NULL == ctx->secret)
+        goto err;
+
+    ctx->method = method;
+    memcpy(ctx->ctr, iv, method->blocksize);
+    memset(ctx->zero_iv, 0, method->iv_len);
+    memcpy(ctx->secret, secret, method->secret_len);
+
+    *abstract = ctx;
+    *free_iv = 1;
+    *free_secret = 1;
+    return 0;
+
+err:
+    if (ctx) {
+        if (ctx->secret)
+            LIBSSH2_FREE(session, ctx->secret);
+        if (ctx->zero_iv)
+            LIBSSH2_FREE(session, ctx->zero_iv);
+        if (ctx->tmp)
+            LIBSSH2_FREE(session, ctx->tmp);
+        if (ctx->ctr)
+            LIBSSH2_FREE(session, ctx->ctr);
+
+        LIBSSH2_FREE(session, ctx);
+    }
+
+    return LIBSSH2_ERROR_ALLOC;
+}
+
+static int crypt_ctr_encrypt(LIBSSH2_SESSION *session,
+                             unsigned char *block, size_t blocksize,
+                             void **abstract)
+{
+    struct crypt_ctr_ctx *ctx = *abstract;
+    size_t n, p;
+    int ret;
+
+    (void)session;
+
+    for (n = 0; n < blocksize; n++) {
+        p = n % ctx->method->blocksize;
+
+        if (0 == p) {
+            /* use CBC with zero IV on a single block to emulate ECB */
+
+            ret = _libssh2_cipher_init(&ctx->h, ctx->method->algo,
+                                       ctx->zero_iv, ctx->secret, 1);
+            if (ret)
+                return ret;
+
+            memcpy(ctx->tmp, ctx->ctr, ctx->method->blocksize);
+
+            ret = _libssh2_cipher_crypt(&ctx->h, ctx->method->algo, 1,
+                                        ctx->tmp, ctx->method->blocksize);
+            _libssh2_cipher_dtor(&ctx->h);
+            if (ret)
+                return ret;
+
+            _libssh2_aes_ctr_increment(ctx->ctr, ctx->method->blocksize);
+        }
+
+        block[n] ^= ctx->tmp[p];
+    }
+
+    return 0;
+}
+
+static int crypt_ctr_dtor(LIBSSH2_SESSION *session, void **abstract)
+{
+    struct crypt_ctr_ctx *ctx;
+
+    if (!abstract || !*abstract)
+        return 0;
+
+    ctx = *abstract;
+
+    memset(ctx->ctr, 0, ctx->method->blocksize);
+    memset(ctx->tmp, 0, ctx->method->blocksize);
+    memset(ctx->secret, 0, ctx->method->secret_len);
+
+    LIBSSH2_FREE(session, ctx->secret);
+    LIBSSH2_FREE(session, ctx->zero_iv);
+    LIBSSH2_FREE(session, ctx->tmp);
+    LIBSSH2_FREE(session, ctx->ctr);
+
+    memset(ctx, 0, sizeof *ctx);
+    LIBSSH2_FREE(session, ctx);
+
+    *abstract = NULL;
+    return 0;
+}
+#endif /* implement CTR mode using CBC */
+
 #ifdef _libssh2_cipher_aes128
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes128_cbc = {
     "aes128-cbc",
@@ -130,9 +273,7 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes128_cbc = {
     &crypt_dtor,
     _libssh2_cipher_aes128
 };
-#endif
 
-#ifdef _libssh2_cipher_aes128ctr
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes128_ctr = {
     "aes128-ctr",
     "",
@@ -140,10 +281,17 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes128_ctr = {
     16,                         /* initial value length */
     16,                         /* secret length -- 16*8 == 128bit */
     0,                          /* flags */
+#ifdef _libssh2_cipher_aes128ctr
     &crypt_init,
     &crypt_encrypt,
     &crypt_dtor,
     _libssh2_cipher_aes128ctr
+#else
+    &crypt_ctr_init,
+    &crypt_ctr_encrypt,
+    &crypt_ctr_dtor,
+    _libssh2_cipher_aes128
+#endif
 };
 #endif
 
@@ -160,9 +308,7 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes192_cbc = {
     &crypt_dtor,
     _libssh2_cipher_aes192
 };
-#endif
 
-#ifdef _libssh2_cipher_aes192ctr
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes192_ctr = {
     "aes192-ctr",
     "",
@@ -170,10 +316,17 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes192_ctr = {
     16,                         /* initial value length */
     24,                         /* secret length -- 24*8 == 192bit */
     0,                          /* flags */
+#ifdef _libssh2_cipher_aes192ctr
     &crypt_init,
     &crypt_encrypt,
     &crypt_dtor,
     _libssh2_cipher_aes192ctr
+#else
+    &crypt_ctr_init,
+    &crypt_ctr_encrypt,
+    &crypt_ctr_dtor,
+    _libssh2_cipher_aes192
+#endif
 };
 #endif
 
@@ -205,9 +358,7 @@ static const LIBSSH2_CRYPT_METHOD
     &crypt_dtor,
     _libssh2_cipher_aes256
 };
-#endif
 
-#ifdef _libssh2_cipher_aes256ctr
 static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes256_ctr = {
     "aes256-ctr",
     "",
@@ -215,10 +366,17 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_aes256_ctr = {
     16,                         /* initial value length */
     32,                         /* secret length -- 32*8 == 256bit */
     0,                          /* flags */
+#ifdef _libssh2_cipher_aes256ctr
     &crypt_init,
     &crypt_encrypt,
     &crypt_dtor,
     _libssh2_cipher_aes256ctr
+#else
+    &crypt_ctr_init,
+    &crypt_ctr_encrypt,
+    &crypt_ctr_dtor,
+    _libssh2_cipher_aes256
+#endif
 };
 #endif
 
@@ -319,23 +477,17 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_3des_cbc = {
 #endif
 
 static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_methods[] = {
-#ifdef _libssh2_cipher_aes256ctr
-  &libssh2_crypt_method_aes256_ctr,
-#endif
 #ifdef _libssh2_cipher_aes256
+    &libssh2_crypt_method_aes256_ctr,
     &libssh2_crypt_method_aes256_cbc,
     &libssh2_crypt_method_rijndael_cbc_lysator_liu_se,  /* == aes256-cbc */
 #endif
-#ifdef _libssh2_cipher_aes192ctr
-  &libssh2_crypt_method_aes192_ctr,
-#endif
 #ifdef _libssh2_cipher_aes192
+    &libssh2_crypt_method_aes192_ctr,
     &libssh2_crypt_method_aes192_cbc,
 #endif
-#ifdef _libssh2_cipher_aes128ctr
-  &libssh2_crypt_method_aes128_ctr,
-#endif
 #ifdef _libssh2_cipher_aes128
+    &libssh2_crypt_method_aes128_ctr,
     &libssh2_crypt_method_aes128_cbc,
 #endif
 #if LIBSSH2_BLOWFISH
-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Apr 19 12:42:39 2018
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (mail [127.0.0.1])
	by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTP id w3JAg5lK021910;
	Thu, 19 Apr 2018 12:42:32 +0200
Received: from forward25p.cmail.yandex.net (forward25p.cmail.yandex.net
 [IPv6:2a02:6b8:0:1465:0:0:0:33])
 by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id w3JAg3G2021835
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Thu, 19 Apr 2018 12:42:04 +0200
Received: from mxback11j.mail.yandex.net (mxback11j.mail.yandex.net
 [IPv6:2a02:6b8:0:1619::84])
 by forward25p.cmail.yandex.net (Yandex) with ESMTP id C6E8720F13
 for <libssh2-devel@cool.haxx.se>; Thu, 19 Apr 2018 13:41:58 +0300 (MSK)
Received: from localhost (localhost [::1])
 by mxback11j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id shOuWhdTGZ-fw8a92In;
 Thu, 19 Apr 2018 13:41:58 +0300
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail;
 t=1524134518; bh=kvPNgGQymuESAEXYGsy70/CK3xe6qlRThM6bIdOWPYM=;
 h=From:To:Subject:Message-Id:Date;
 b=lkCUL25kW8xixGBYGpXc53UvlBDJvABE8VrUoj6QEljO5QqUsjCzg8CqDrnK5r6L1
 amwDLFpsj38czE3dzgIojjWw1d34556G38QZUhZ5R3mIGXlJqsHUqiFlpjYIWiSt0V
 mXBeiyhtJ8A2mMcR+3/56EGpKd0wp6uClCB7fsYA=
Authentication-Results: mxback11j.mail.yandex.net;
 dkim=pass header.i=@yandex.com
Received: by web3j.yandex.ru with HTTP;
	Thu, 19 Apr 2018 13:41:58 +0300
From: Pan K <zuboci@yandex.com>
To: Libssh2 List <libssh2-devel@cool.haxx.se>
Subject: RFC: SSH Agent forwarding pull request
MIME-Version: 1.0
Message-Id: <6367441524134518@web3j.yandex.ru>
X-Mailer: Yamail [ http://yandex.ru ] 5.0
Date: Thu, 19 Apr 2018 11:41:58 +0100
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <https://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: <https://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: multipart/mixed; boundary="===============0040316292=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============0040316292==
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=utf-8

<div>Hello all,</div><div> </div><div>I am keen to get SSH agent forwarding implemented in libssh2 - it is the last remaining major feature of SSH that is not yet supported by libssh2.</div><div> </div><div>There <a href="https://github.com/libssh2/libssh2/pull/219">is a PR pending</a> to add this functionality, based on Mr Mashimoto's patches to this list from a while back with fixes and tests.</div><div> </div><div>Is anyone available to review that PR? One thing I have not tested is forwarding with a non-OpenSSH server. The integration tests do not cover this as they use OpenSSH.</div><div> </div><div>The code is supposed to fall back to the standard SSH request for forwarding if the OpenSSH specific method does not work - this matches what the OpenSSH client does.</div><div> </div><div>Thank you,</div><div>Pan</div><div> </div>

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

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwczovL2Nvb2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vbGlic3No
Mi1kZXZlbAo=

--===============0040316292==--

