Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a4756-0007Xo-E2 for pgadmin-support@arkaria.postgresql.org; Wed, 02 Dec 2015 13:04:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a4754-0003U2-PI for pgadmin-support@arkaria.postgresql.org; Wed, 02 Dec 2015 13:04:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a4753-0003SX-P9 for pgadmin-support@postgresql.org; Wed, 02 Dec 2015 13:04:22 +0000 Received: from mail-io0-x230.google.com ([2607:f8b0:4001:c06::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1a474s-0000Of-5a for pgadmin-support@postgresql.org; Wed, 02 Dec 2015 13:04:20 +0000 Received: by ioir85 with SMTP id r85so44410566ioi.1 for ; Wed, 02 Dec 2015 05:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vR5HQHQvuUDj2lLZo0VWbra8zR8ne3TPxOYHpO4QCs0=; b=BrNuXcDFnCezU6K+YtsXbB1mqqycyPU0A/M4a0Xu6MeYT7Z9E3ctOVTeVLBupXTz3T A2KR5/UQYW+OgpVaI4TxYH7jyzwQZF0SXT272IHf7SEAKuPleNDecXOWJpJ1IIlqJ8xq oa/buFPDvCsmUg1O+aTrG6HhlKPBpWa6uHyELOHHs79mYVk69g9bzlncIHXf/rH7hMY/ Gf3lHJCXfylg6+SB6d2zIVAJMfncmcfhbhHaODkzKngJq94qLdAmL3bVMvgeaR7N9XgD 6kUz/YGNvXL3HwZ6Bm3Oz7Xwx0dtBAaaauHypxXINoEBOj8u5vB6zhjgcF56FVTAm+T5 Vi8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=vR5HQHQvuUDj2lLZo0VWbra8zR8ne3TPxOYHpO4QCs0=; b=C1Gtj8TqU4nbGzESlHGst/cDHSI70z2wm2Qd5lnvziYMZA4mFmbwYOPCFdGumfsMwW mKPkA6K7vGmGNpgnz3I+zzwxVv2InbIW/Q+U2/8Yr8/maZsjhncwXG77gBrr5KXnpyM2 Um/a+Ec2fQQaMHGBoMcayzmRvK0/DHmzHDi2P3mx+ziv2prmLmY5TEY1uIgz8iZAipoU cPgA99+gSebCiC49WJO3eGCWmBw4DXkxg4byeYFZjwEgQdOZKDiTW+//98hJv8dZqHyZ A7jzvUOBMLOZrYfW7Sa1uulIERGIcReG8LrvAaqqA56KyHz/4wULG34E8s0vrvlPW+c1 b/wA== X-Gm-Message-State: ALoCoQmzb6GqlmsCPh8ElA/kal7oFMZWVyx04HvicQ3wYC15mFfD0W48tPl+XsX/bgE9z39HKhTX MIME-Version: 1.0 X-Received: by 10.107.37.139 with SMTP id l133mr3417841iol.156.1449061449201; Wed, 02 Dec 2015 05:04:09 -0800 (PST) Received: by 10.64.5.234 with HTTP; Wed, 2 Dec 2015 05:04:09 -0800 (PST) In-Reply-To: References: <48AA5EAC-64A6-466E-9900-E32EDD4187C0@pgadmin.org> Date: Wed, 2 Dec 2015 13:04:09 +0000 Message-ID: Subject: Re: SSH tunnel key exchange methods From: Dave Page To: Ashesh Vashi Cc: Akshay Joshi , Sven , pgAdmin Support , pgadmin-hackers Content-Type: multipart/alternative; boundary=001a11405dfef00a9d0525e9e8f7 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-support Precedence: bulk Sender: pgadmin-support-owner@postgresql.org --001a11405dfef00a9d0525e9e8f7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Dec 2, 2015 at 9:59 AM, Ashesh Vashi wrote: > > On Wed, Dec 2, 2015 at 3:27 PM, Akshay Joshi < > akshay.joshi@enterprisedb.com> wrote: > >> >> >> On Wed, Dec 2, 2015 at 3:20 PM, Dave Page wrote: >> >>> Hi >>> >>> On Wed, Dec 2, 2015 at 9:19 AM, Akshay Joshi < >>> akshay.joshi@enterprisedb.com> wrote: >>> >>>> Hi Dave >>>> >>>> I have updated the *libssh2* library with the latest available code on >>>> their git repository. The new code used "diffie-hellman-group-exchange= -sha256" algorithm for >>>> key exchange and they also fixed some memory leak. I have verified it = by >>>> putting the breakpoint in the libssh2 code, so when we called " >>>> libssh2_session_init()" it will automatically call "static int diffie_ >>>> hellman_sha256(...)" function, but I don't know exactly how to >>>> identify the key exchange method (sha1 or sha256) used by the latest >>>> libssh2 library. >>>> >>>> I have tested the pgadmin3 after updating the libssh2 library on CentO= S >>>> 6.5 (64 bit) and it works fine. I have also modified the code to add >>>> human readable error message returned by the library. Attached is the >>>> patch file. Can you please review it and if it looks good can you plea= se >>>> commit the code. >>>> >>> >>> I'm seeing the following build error on OS X 10.7: >>> >>> depbase=3D`echo libssh2/agent.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ >>> ccache gcc -Qunused-arguments -DHAVE_CONFIG_H -I. -I.. >>> -I../pgadmin/include/libssh2 -I../pgadmin/include >>> -I../pgadmin/include/libssh2 -I/usr/local/pgsql-9.5/include >>> -I/usr/local/pgsql-9.5/include/server -I/usr/local/pgsql-9.5/include >>> -DPG_SSL -DHAVE_CONNINFO_PARSE >>> -I/usr/local/lib/wx/include/mac-unicode-release-static-2.8 >>> -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=3D64 -D_LARGE_FILES >>> -D__WXMAC__ -DEMBED_XRC -arch i386 -I/usr/include/libxml2 >>> -I/opt/local/include/libxml2 -DHAVE_OPENSSL_CRYPTO -O2 -MT libssh2/age= nt.o >>> -MD -MP -MF $depbase.Tpo -c -o libssh2/agent.o libssh2/agent.c &&\ >>> mv -f $depbase.Tpo $depbase.Po >>> In file included from ../pgadmin/include/libssh2/libssh2_priv.h:136, >>> from libssh2/agent.c:41: >>> ../pgadmin/include/libssh2/crypto.h:53: error: expected =E2=80=98)=E2= =80=99 before =E2=80=98*=E2=80=99 >>> token >>> ../pgadmin/include/libssh2/crypto.h:69: error: expected =E2=80=98)=E2= =80=99 before =E2=80=98*=E2=80=99 >>> token >>> ../pgadmin/include/libssh2/crypto.h:73: error: expected =E2=80=98)=E2= =80=99 before =E2=80=98*=E2=80=99 >>> token >>> ../pgadmin/include/libssh2/crypto.h:78: error: expected declaration >>> specifiers or =E2=80=98...=E2=80=99 before =E2=80=98libssh2_rsa_ctx=E2= =80=99 >>> ../pgadmin/include/libssh2/crypto.h:83: error: expected =E2=80=98)=E2= =80=99 before =E2=80=98*=E2=80=99 >>> token >>> ../pgadmin/include/libssh2/crypto.h:115: error: expected =E2=80=98)=E2= =80=99 before =E2=80=98*=E2=80=99 >>> token >>> ../pgadmin/include/libssh2/crypto.h:120: error: expected =E2=80=98)=E2= =80=99 before =E2=80=98*=E2=80=99 >>> token >>> In file included from libssh2/agent.c:41: >>> ../pgadmin/include/libssh2/libssh2_priv.h:240: error: >>> =E2=80=98SHA256_DIGEST_LENGTH=E2=80=99 undeclared here (not in a functi= on) >>> ../pgadmin/include/libssh2/libssh2_priv.h:245: error: expected >>> specifier-qualifier-list before =E2=80=98_libssh2_bn_ctx=E2=80=99 >>> ../pgadmin/include/libssh2/libssh2_priv.h:267: error: expected >>> specifier-qualifier-list before =E2=80=98_libssh2_bn=E2=80=99 >>> ../pgadmin/include/libssh2/libssh2_priv.h:604: error: >>> =E2=80=98SHA_DIGEST_LENGTH=E2=80=99 undeclared here (not in a function) >>> ../pgadmin/include/libssh2/libssh2_priv.h:899: error: expected >>> specifier-qualifier-list before =E2=80=98_libssh2_cipher_type=E2=80=99 >>> libssh2/agent.c: In function =E2=80=98agent_connect_unix=E2=80=99: >>> libssh2/agent.c:150: warning: assignment makes pointer from integer >>> without a cast >>> make[3]: *** [libssh2/agent.o] Error 1 >>> make[2]: *** [all] Error 2 >>> make[1]: *** [all-recursive] Error 1 >>> make: *** [all] Error 2 >>> >> >> I have modified the configure.ac.in and added "-DLIBSSH2_OPENSSL" to >> solve the above. You need to run the configure command again. >> > You also needs to rerun the bootstrap script. > OK, it works for me on Windows and OSX. Ashesh, can you give it a review/commit please? Thanks. --=20 Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --001a11405dfef00a9d0525e9e8f7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Wed, Dec 2, 2015 at 9:59 AM, Ashesh Vashi <ashesh.vashi= @enterprisedb.com> wrote:
<= div dir=3D"ltr">
On We= d, Dec 2, 2015 at 3:27 PM, Akshay Joshi <akshay.joshi@enterpri= sedb.com> wrote:


=
On Wed, Dec 2, 2015 at 3:20 PM, Dave Page <<= a href=3D"mailto:dpage@pgadmin.org" target=3D"_blank">dpage@pgadmin.org= > wrote:
Hi

<= span>On Wed, Dec 2, 2015 at 9:19 AM, Akshay Joshi <akshay.josh= i@enterprisedb.com> wrote:
Hi Dave=C2=A0

I have updated the libssh2 library with the latest available = code on their git repository. The new code used=C2=A0"diffie-hellman-group-<= /span>exchange-sha256"=C2=A0algorithm= =C2=A0for key=C2=A0exchange and they also fixed some memory leak. I have ve= rified it by putting the breakpoint in the libssh2 code, so wh= en we called "libssh2_session_init()<= span style=3D"font-size:12.8px">" it will automatically call "static int diffie_hellman<= /span>_sha256(...)" function, but I don't know exactly = how to identify the key exchange method (sha1 or sha256) used by the latest= libssh2 library.

I have tested the pgadmin3 = after updating the libssh2 library on CentOS 6.5 (64 bit) and = it works fine. I have also modified the code to add human=C2=A0readable err= or=C2=A0message returned by the library.=C2=A0Attached is the patch file. Can you please review it and if it l= ooks good can you please commit the code.

I'm seeing the following build error on OS X 1= 0.7:

depbase=3D`echo libssh2/agent.o | sed &#= 39;s|[^/]*$|.deps/&|;s|\.o$||'`;\
ccache gcc -Qunused-arguments -DHAVE_CONFIG_H -I. -I.= . -I../pgadmin/include/libssh2 =C2=A0-I../pgadmin/include -I../pgadmin/incl= ude/libssh2 =C2=A0 -I/usr/local/pgsql-9.5/include -I/usr/local/pgsql-9.5/in= clude/server -I/usr/local/pgsql-9.5/include -DPG_SSL -DHAVE_CONNINFO_PARSE = -I/usr/local/lib/wx/include/mac-unicode-release-static-2.8 -I/usr/local/inc= lude/wx-2.8 -D_FILE_OFFSET_BITS=3D64 -D_LARGE_FILES -D__WXMAC__ -DEMBED_XRC= -arch i386 -I/usr/include/libxml2 -I/opt/local/include/libxml2 -DHAVE_OPEN= SSL_CRYPTO =C2=A0-O2 -MT libssh2/agent.o -MD -MP -MF $depbase.Tpo -c -o lib= ssh2/agent.o libssh2/agent.c &&\
mv -f $depbase.Tpo $depbase.Po
In file inclu= ded from ../pgadmin/include/libssh2/libssh2_priv.h:136,
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0from libssh2/agent.c= :41:
../pgadmin/include/libssh2/crypto.h:53: error: expected =E2= =80=98)=E2=80=99 before =E2=80=98*=E2=80=99 token
../pgadmin/incl= ude/libssh2/crypto.h:69: error: expected =E2=80=98)=E2=80=99 before =E2=80= =98*=E2=80=99 token
../pgadmin/include/libssh2/crypto.h:73: error= : expected =E2=80=98)=E2=80=99 before =E2=80=98*=E2=80=99 token
.= ./pgadmin/include/libssh2/crypto.h:78: error: expected declaration specifie= rs or =E2=80=98...=E2=80=99 before =E2=80=98libssh2_rsa_ctx=E2=80=99
<= div>../pgadmin/include/libssh2/crypto.h:83: error: expected =E2=80=98)=E2= =80=99 before =E2=80=98*=E2=80=99 token
../pgadmin/include/libssh= 2/crypto.h:115: error: expected =E2=80=98)=E2=80=99 before =E2=80=98*=E2=80= =99 token
../pgadmin/include/libssh2/crypto.h:120: error: expecte= d =E2=80=98)=E2=80=99 before =E2=80=98*=E2=80=99 token
In file in= cluded from libssh2/agent.c:41:
../pgadmin/include/libssh2/libssh= 2_priv.h:240: error: =E2=80=98SHA256_DIGEST_LENGTH=E2=80=99 undeclared here= (not in a function)
../pgadmin/include/libssh2/libssh2_priv.h:24= 5: error: expected specifier-qualifier-list before =E2=80=98_libssh2_bn_ctx= =E2=80=99
../pgadmin/include/libssh2/libssh2_priv.h:267: error: e= xpected specifier-qualifier-list before =E2=80=98_libssh2_bn=E2=80=99
=
../pgadmin/include/libssh2/libssh2_priv.h:604: error: =E2=80=98SHA_DIG= EST_LENGTH=E2=80=99 undeclared here (not in a function)
../pgadmi= n/include/libssh2/libssh2_priv.h:899: error: expected specifier-qualifier-l= ist before =E2=80=98_libssh2_cipher_type=E2=80=99
libssh2/agent.c= : In function =E2=80=98agent_connect_unix=E2=80=99:
libssh2/agent= .c:150: warning: assignment makes pointer from integer without a cast
=
make[3]: *** [libssh2/agent.o] Error 1
make[2]: *** [all] Er= ror 2
make[1]: *** [all-recursive] Error 1
make: *** [a= ll] Error 2

=
=C2=A0 =C2=A0 I have modified the configure.ac.in and added "-DLIBSSH2_OPENSS= L" to solve the above. You need to run the configure command again.=C2= =A0
You also needs to = rerun the bootstrap script.

OK, it works for me on Windows and OSX. Ashesh, can you give it a = review/commit please?

Thanks.=C2=A0

--
Dave Page
Blog: http://pgsnake.blogspot= .com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The= Enterprise PostgreSQL Company
--001a11405dfef00a9d0525e9e8f7--