Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a6Hyl-0004Pw-2Q for pgadmin-hackers@arkaria.postgresql.org; Tue, 08 Dec 2015 13:06:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a6Hyk-0002Qx-LE for pgadmin-hackers@arkaria.postgresql.org; Tue, 08 Dec 2015 13:06:50 +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 1a6Hyj-0002Qm-Tf for pgadmin-hackers@postgresql.org; Tue, 08 Dec 2015 13:06:50 +0000 Received: from mail-io0-x229.google.com ([2607:f8b0:4001:c06::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1a6Hyg-0004Wu-CQ for pgadmin-hackers@postgresql.org; Tue, 08 Dec 2015 13:06:48 +0000 Received: by ioir85 with SMTP id r85so23419354ioi.1 for ; Tue, 08 Dec 2015 05:06:45 -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=6MMjjJI8Am0Rn/+6j4F+P3M8ZhgjTBWGUBmPb2+bGFs=; b=cRshER0z1ZZj6oKEc0ix414p0nFmJXxlOEnYV7t1EBihqH/OXphFmHmU8k0Z9pNFuu 2DfnloTl5D3wXexNKr8dgYMnh7Pc7Qgqcwi/5jhKMleaUy2CPJNmUprEyeLTZwrQbPvM kpWkzmLmRv5HwsE3Gjth/zq9GbY/H0RiKPHUZosBHZA+mL1Kg0gWIwo9ZfASRXAQtoPz qOWzeAQu+UjHGkHKjhw561S4aYaKUsGFuC4StnN3/T6h6ux0cODjAH4ets8DfmujxBzK VtTE01MXNa7Ca+rHKV9ybI4nsdCGtu0vw5ywgDkL3G8FFbJ8Wr++EeT9fngUsC7WIER3 YeDA== 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=6MMjjJI8Am0Rn/+6j4F+P3M8ZhgjTBWGUBmPb2+bGFs=; b=RFAg6Rm4xRdomh3O1gGs1jFbeB4pXuIq72hWav5POvc3rTyEkC16ycxRI0QHuLW6RL AfZudBYy2QgrMBMdepTGr7X+IwHSPLdmuUZvLGZmk0pmoKuDGqeifzyafOPuViZ8r9D7 lqelCKvj/4RBLBZ0aoRVWEWSjmDwzBnx+6zpLAwPMaShVG2r7tSV+ZJMDp6j/LznGU3J pqOY8jV/TfyR+ZePh87rLQ2gmXvFXETY7dVhhpsEnHK4k58rKL4XGgGPBB/kDjLjdXVX EOVjay9tw517rKy5uR43xRTI+cQiepkno3PfabAmcgWu5ffT06+5E9cM+44sUk+V7ozh +qFg== X-Gm-Message-State: ALoCoQkA+gTSf9wg7FUzHzcqqF/B+AcMRrMIN+hzrl84HPs0WK5VCJPpwbg4Dl0cLZQMaua2Iriymsel06Eq40KrH6DkwEQdsA== MIME-Version: 1.0 X-Received: by 10.107.37.139 with SMTP id l133mr3641830iol.156.1449580005328; Tue, 08 Dec 2015 05:06:45 -0800 (PST) Received: by 10.64.5.234 with HTTP; Tue, 8 Dec 2015 05:06:45 -0800 (PST) In-Reply-To: References: <48AA5EAC-64A6-466E-9900-E32EDD4187C0@pgadmin.org> Date: Tue, 8 Dec 2015 13:06:45 +0000 Message-ID: Subject: Re: [pgadmin-support] SSH tunnel key exchange methods From: Dave Page To: Ashesh Vashi Cc: Akshay Joshi , Sven , pgAdmin Support , pgadmin-hackers Content-Type: multipart/alternative; boundary=001a11405dfe4aa440052662a56d X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a11405dfe4aa440052662a56d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yes, I think so. On Tue, Dec 8, 2015 at 1:05 PM, Ashesh Vashi wrote: > Dave, > > Patch looks good to me. > But - Should we consider this as a bug fix, and commit it for 1.22.0 > release? > > -- > > Thanks & Regards, > > Ashesh Vashi > EnterpriseDB INDIA: Enterprise PostgreSQL Company > > > > *http://www.linkedin.com/in/asheshvashi* > > > On Wed, Dec 2, 2015 at 6:34 PM, Dave Page wrote: > >> >> >> On Wed, Dec 2, 2015 at 9:59 AM, Ashesh Vashi < >> ashesh.vashi@enterprisedb.com> 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-exc= hange-sha256" algorithm for >>>>>> key exchange and they also fixed some memory leak. I have verified i= t by >>>>>> putting the breakpoint in the libssh2 code, so when we called " >>>>>> libssh2_session_init()" it will automatically call "static int diffi= e >>>>>> _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 >>>>>> CentOS 6.5 (64 bit) and it works fine. I have also modified the code >>>>>> to add human readable error message returned by the library. Attache= d >>>>>> is the patch file. Can you please review it and if it looks good can= you >>>>>> please 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/a= gent.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 func= tion) >>>>> ../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 functio= n) >>>>> ../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. >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > > --=20 Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --001a11405dfe4aa440052662a56d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes, I think so.

On Tue, Dec 8, 2015 at 1:05 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
Dave,

Patch looks = good to me.
But - Should we consider this as a bug fix, and commit= it for 1.22.0 release?

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company

<= br>

<= a href=3D"http://www.linkedin.com/in/asheshvashi" target=3D"_blank">http= ://www.linkedin.com/in/asheshvashi


On Wed, Dec 2,= 2015 at 6:34 PM, Dave Page <dpage@pgadmin.org> wrote:


On Wed, Dec 2, 2015 at 9:59 AM, = Ashesh Vashi <ashesh.vashi@enterprisedb.com> wro= te:

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 <dpag= e@pgadmin.org> wrote:
Hi

On Wed, Dec 2, 2015 at 9:19 AM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Dave=C2=A0<= div>
I have updated the libssh2 library with the= latest available code on their git repository. The new code used=C2=A0"= diffie-hellman-group-exchange-sha256&qu= ot;=C2=A0algorithm=C2=A0for key=C2=A0exchange and they also fixed some memo= ry leak. I have verified it by putting the breakpoint in the l= ibssh2 code, so when we called "libssh2_session_init()" it will automatica= lly call "static int diffie_hellman_sha256(...)"= function, but I don&#= 39;t know exactly how to identify the key exchange method (sha1 or sha256) = used by the latest libssh2 library.

I have te= sted 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 error=C2=A0message returned by the library.=C2=A0Attached is the patch file. Can you please rev= iew it and if it looks good can you please commit the code.

I'm seeing the following bui= ld error on OS X 10.7:

depbase=3D`echo libssh= 2/agent.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
ccache gcc -Qunused-arguments -DHAV= E_CONFIG_H -I. -I.. -I../pgadmin/include/libssh2 =C2=A0-I../pgadmin/include= -I../pgadmin/include/libssh2 =C2=A0 -I/usr/local/pgsql-9.5/include -I/usr/= local/pgsql-9.5/include/server -I/usr/local/pgsql-9.5/include -DPG_SSL -DHA= VE_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__W= XMAC__ -DEMBED_XRC -arch i386 -I/usr/include/libxml2 -I/opt/local/include/l= ibxml2 -DHAVE_OPENSSL_CRYPTO =C2=A0-O2 -MT libssh2/agent.o -MD -MP -MF $dep= base.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,
=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: erro= r: 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/cryp= to.h:73: error: expected =E2=80=98)=E2=80=99 before =E2=80=98*=E2=80=99 tok= en
../pgadmin/include/libssh2/crypto.h:78: error: expected declar= ation 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/includ= e/libssh2/libssh2_priv.h:240: error: =E2=80=98SHA256_DIGEST_LENGTH=E2=80=99= undeclared here (not in a function)
../pgadmin/include/libssh2/l= ibssh2_priv.h:245: error: expected specifier-qualifier-list before =E2=80= =98_libssh2_bn_ctx=E2=80=99
../pgadmin/include/libssh2/libssh2_pr= iv.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 spe= cifier-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 wi= thout a cast
make[3]: *** [libssh2/agent.o] Error 1
mak= e[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

=C2=A0 =C2=A0 I have modified the configure.ac.in and added &quo= t;-DLIBSSH2_OPENSSL" 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 O= SX. 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 Compan= y
--001a11405dfe4aa440052662a56d--