libssh2 Trac | 21 May 17:33 2015
Picon

#304: Improperly linking to system libssl & libcrypto when staged one is desired

#304: Improperly linking to system libssl & libcrypto when staged one is desired
---------------------------+--------------------
 Reporter:  kotoroshinoto  |       Owner:
     Type:  defect         |      Status:  new
 Priority:  normal         |   Milestone:  1.5.0
Component:  crypto         |     Version:  1.5.0
 Keywords:                 |  Blocked By:
   Blocks:                 |
---------------------------+--------------------
 no matter what I do, it ends up linking to the system files:
 libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f83a6248000)
 libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f83a5e68000)

 it should be linking to the ones in
 ls /UCHC/HPC/Gooch/biotoolmodules/openssl/1.0.2a/lib/
 engines libcrypto.a libcrypto.so libcrypto.so.1.0.0 libssl.a libssl.so
 libssl.so.1.0.0 pkgconfig

 what do I need to tell the configure script to accomplish this?

--

-- 
Ticket URL: <https://trac.libssh2.org/ticket/304>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
libssh2 Trac | 21 May 17:31 2015
Picon

#303: CMake build system can't be used as a subproject

#303: CMake build system can't be used as a subproject
-------------------------+--------------------
 Reporter:  JasonHaslam  |       Owner:
     Type:  defect       |      Status:  new
 Priority:  normal       |   Milestone:
Component:  misc         |     Version:  1.5.0
 Keywords:               |  Blocked By:
   Blocks:               |
-------------------------+--------------------
 I'm trying to incorporate the new libssh2 cmake build into my own cmake
 build system with the add_subdirectory command. It mostly works except for
 a few places in src/CMakeLists.txt that use CMAKE_SOURCE_DIR. That
 variable points to the top-level project source dir. I'd recommend
 changing them to PROJECT_SOURCE_DIR or libssh2_SOURCE_DIR. When I make
 that change everything works fine for my use case.

--

-- 
Ticket URL: <https://trac.libssh2.org/ticket/303>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Jason Vas Dias | 13 May 16:52 2015
Picon

ssh agent forwarding ?

Good day -

I was wondering whether libssh2 can or will support forwarding of the
SSH agent connection
to a remote host, so that if I do 'ssh-add -l' on the remote host over
a libssh2 connection
it will display the list of my local identities which are then
available to use for further
ssh connections from that remote host .

Googling turned up this thread from  <at>  2012-03  :
 '[PATCH] Request SSH agent forwarding'
from Mitchell Hashimoto <mitchell.hashimoto_at_gmail.com>
but this patch does not seem to have been integrated into the latest
libssh2-1.5.0 release
I am using .

Are there any plans to implement or any current implementation of
agent forwarding
for libssh2 in any GIT branch ?

If not I'll have to use libssh, which appears to support agent
forwarding, but I'd rather not have to.

Thanks & Regards,
Jason
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Jeremy Zapata | 1 May 17:51 2015

Setting MAC option

I am using libssh2 compiled with OpenSSL and libcurl (OpenSSL v1.0.2 and libssh2 v1.4.3, libcurl 7.22.0) and I use it to test uploading/downloading files over sftp.

I have limited experience with ssh and sftp but on Linux there are additional options that can be specified with the sftp command such as the MAC (Message Authentication Code) like this:

sftp -oCiphers=3des-cbc -oMACs=hmac-md5 myuser <at> myhost

 

Is anyone familiar with the MAC option and how it can be set for libssh2 (hopefully there is a way through libcurl)?

 

It was hard to find a whole lot of information on the MAC option, but this is something I found: http://www.computerhope.com/unix/sftp.htm.

 

Thanks!

 

Jeremy Zapata | Software Engineer in Test
globalscape | +1 (210) 308-8267 ext 5176 | NYSE MKT:GSB

*This communication, including attachments, is for the exclusive use of the addressee and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return email and delete this communication and destroy all copies.

 

 

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
赵志毅 | 29 Apr 04:59 2015

how to get libssh2-devel source code

hi,

I am trying to cross compile zabbix on mips platform. It needs libssh2 and libssh2-devel. I can download libssh2, but there is no way to download libssh2-devel.

Where is available for libssh2-devel?

cheers

armstrong zhao

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
libssh2 Trac | 14 Apr 11:29 2015
Picon

#302: libssh2_session_handshake bug?

#302: libssh2_session_handshake bug?
--------------------+--------------------
 Reporter:  5m0k3   |       Owner:
     Type:  defect  |      Status:  new
 Priority:  normal  |   Milestone:  1.5.0
Component:  crypto  |     Version:  1.5.0
 Keywords:          |  Blocked By:
   Blocks:          |
--------------------+--------------------
 Hello, I was working on a password auditing tool using libssh2 and
 encountered the following issue when using with pthread.

 GDB output:

 [Thread debugging using libthread_db enabled]
 Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 Core was generated by `./dm domains.txt user pass 500'.
 Program terminated with signal SIGSEGV, Segmentation fault.
 #0  0x00007ff0eaa3bbdc in ?? () from /lib/x86_64-linux-
 gnu/libcrypto.so.1.0.0
 (gdb) bt
 #0  0x00007ff0eaa3bbdc in ?? () from /lib/x86_64-linux-
 gnu/libcrypto.so.1.0.0
 #1  0xca62c1d6ca62c1d6 in ?? ()
 #2  0xca62c1d6ca62c1d6 in ?? ()
 #3  0xca62c1d6ca62c1d6 in ?? ()
 #4  0xca62c1d6ca62c1d6 in ?? ()
 #5  0xca62c1d6ca62c1d6 in ?? ()
 #6  0xca62c1d6ca62c1d6 in ?? ()
 #7  0xca62c1d6ca62c1d6 in ?? ()
 #8  0xca62c1d6ca62c1d6 in ?? ()
 #9  0x00007ff0eada8810 in ?? () from /lib/x86_64-linux-
 gnu/libcrypto.so.1.0.0
 #10 0x00007feeb000e400 in ?? ()
 #11 0x000000000000000f in ?? ()
 #12 0x00007ff0eaa3811f in SHA1_Update () from /lib/x86_64-linux-
 gnu/libcrypto.so.1.0.0
 #13 0x00007ff0eaab76ef in ?? () from /lib/x86_64-linux-
 gnu/libcrypto.so.1.0.0
 #14 0x00007ff0eaa6d72c in ?? () from /lib/x86_64-linux-
 gnu/libcrypto.so.1.0.0
 #15 0x00007ff0eb399f8a in diffie_hellman_sha1 () from
 /usr/lib/libssh2.so.1
 #16 0x00007ff0eb39c197 in
 kex_method_diffie_hellman_group14_sha1_key_exchange () from
 /usr/lib/libssh2.so.1
 #17 0x00007ff0eb39e1ad in _libssh2_kex_exchange () from
 /usr/lib/libssh2.so.1
 #18 0x00007ff0eb3a6c6e in session_startup () from /usr/lib/libssh2.so.1
 #19 0x00007ff0eb3a6efd in libssh2_session_handshake () from
 /usr/lib/libssh2.so.1
 #20 0x0000000000402023 in verhost (hostname=0x25f1700 "be-still.info",
 username=0x2560400 "be-still", password=0x25c1590 "be-still") at dm.c:248
 #21 0x00000000004021e2 in worker_thread (worker=0x1f2) at dm.c:287
 #22 0x00007ff0eb179182 in start_thread (arg=0x7fefb2fc1700) at
 pthread_create.c:312
 #23 0x00007ff0eaea647d in clone () at
 ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
 (gdb) frame 20
 #20 0x0000000000402023 in verhost (hostname=0x25f1700 "be-still.info",
 username=0x2560400 "be-still", password=0x25c1590 "be-still") at dm.c:248
 248             rc = libssh2_session_handshake(session, sockfd);
 (gdb)

 Here is the code for function causing problems:

 static int verhost(char *hostname, char *username, char *password) {
         if(hostname == NULL) return -1;
         if(username == NULL) return -1;

         int sockfd, rc;
         long arg;

         struct addrinfo hints, *res;
         int errcode;

         memset (&hints, 0, sizeof (hints));
         hints.ai_family = PF_UNSPEC;
         hints.ai_socktype = SOCK_STREAM;
         hints.ai_flags |= AI_CANONNAME;

         errcode = getaddrinfo (hostname, "22", &hints, &res);
         if (errcode != 0) return -1;

         sockfd = socket(AF_INET, SOCK_STREAM, 0);

         arg = fcntl(sockfd, F_GETFL, NULL);
         arg |= O_NONBLOCK;
         fcntl(sockfd, F_SETFL, arg);

         if (sockfd < 0) goto shutend;

         if (connect(sockfd, res->ai_addr, res->ai_addrlen) < 0) {
                 if (errno == EINPROGRESS) {
                         fd_set write_fds;
                         memset(&write_fds, 0, sizeof(write_fds));
                         FD_ZERO(&write_fds);
                         FD_SET(sockfd, &write_fds);
                         struct timeval tv;
                         int valopt;
                         tv.tv_sec = 5;
                         tv.tv_usec = 0;
                         if (select(sockfd+1, NULL, &write_fds, NULL, &tv)
 > 0) {
                                 socklen_t lon;
                                 lon = sizeof(int);
                                 getsockopt(sockfd, SOL_SOCKET, SO_ERROR,
 (void*)(&valopt), &lon);
                                 if (valopt) goto shutend;
                         }
                         else goto shutend;
                 }
                 else goto shutend;
         }

         LIBSSH2_SESSION *session = libssh2_session_init();
         if(!session) goto shutend;

         libssh2_session_set_timeout(session, 10000);
         if(libssh2_session_get_timeout(session) > 10000) goto shutnow;

         rc = libssh2_session_handshake(session, sockfd);
         if (rc) goto shutnow;

         rc = libssh2_userauth_password(session, username, password);
         if (rc) printf("[!] Weak Login: %s - %s/%s\n", hostname, username,
 password);
         else libssh2_session_disconnect(session, "Normal Shutdown");

 shutnow:
         libssh2_session_free(session);

 shutend:
         close(sockfd);
         freeaddrinfo(res);
         return -1;
 }

 Let me know if you need anything else or if I am using libssh2 in a wrong
 manner. Thanks.

--

-- 
Ticket URL: <https://trac.libssh2.org/ticket/302>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
libssh2 Trac | 10 Apr 12:03 2015
Picon

#301: random crashes during multi thread

#301: random crashes during multi thread
---------------------+--------------------
 Reporter:  alexmol  |       Owner:
     Type:  defect   |      Status:  new
 Priority:  normal   |   Milestone:  1.5.0
Component:  crypto   |     Version:  1.5.0
 Keywords:           |  Blocked By:
   Blocks:           |
---------------------+--------------------
 It seems like random crashes may occur in RAND_bytes function. In my app I
 use libssh with 20 parallel threads, so RAND_bytes called quite agressive
 from diff threads. After I guard it with critical section - everything
 seems ok. I cannot really understand the RAND_bytes code, because it looks
 scary. Seems like it is not thread safe. Openssl version for me is 0.9.8zf

--

-- 
Ticket URL: <https://trac.libssh2.org/ticket/301>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
libssh2 Trac | 3 Apr 18:54 2015
Picon

Re: #168: Memory leak in libssh2_session_startup

#168: Memory leak in libssh2_session_startup
-----------------------+--------------------
  Reporter:  jcollins  |      Owner:
      Type:  defect    |     Status:  closed
  Priority:  normal    |  Milestone:
 Component:  API       |    Version:  1.2.4
Resolution:  fixed     |   Keywords:
Blocked By:            |     Blocks:
-----------------------+--------------------
Changes (by alamaison):

 * status:  new => closed
 * resolution:   => fixed

Comment:

 Thanks.  Pushed
 https://github.com/libssh2/libssh2/commit/09c5e59933daf67b833f34b8c388766abc038483.

--

-- 
Ticket URL: <https://trac.libssh2.org/ticket/168#comment:6>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
libssh2 Trac | 3 Apr 14:14 2015
Picon

Re: #168: Memory leak in libssh2_session_startup

#168: Memory leak in libssh2_session_startup
-----------------------+-------------------
  Reporter:  jcollins  |      Owner:
      Type:  defect    |     Status:  new
  Priority:  normal    |  Milestone:
 Component:  API       |    Version:  1.2.4
Resolution:            |   Keywords:
Blocked By:            |     Blocks:
-----------------------+-------------------

Comment (by alamaison):

 Replying to [comment:4 ssbssa]:
 > Like this, or did you mean more?

 Could you resubmit your patch with a different filename?  There's a bug in
 Trac that prevents the moderator accepting your submission, because the
 patch name already exists in this ticket.

--

-- 
Ticket URL: <https://trac.libssh2.org/ticket/168#comment:5>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
libssh2 Trac | 3 Apr 14:12 2015
Picon

Re: #168: Memory leak in libssh2_session_startup

#168: Memory leak in libssh2_session_startup
-----------------------+-------------------
  Reporter:  jcollins  |      Owner:
      Type:  defect    |     Status:  new
  Priority:  normal    |  Milestone:
 Component:  API       |    Version:  1.2.4
Resolution:            |   Keywords:
Blocked By:            |     Blocks:
-----------------------+-------------------

Comment (by ssbssa):

 Like this, or did you mean more?

--

-- 
Ticket URL: <https://trac.libssh2.org/ticket/168#comment:4>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
libssh2 Trac | 3 Apr 14:08 2015
Picon

#300: Memory leak in kex.c

#300: Memory leak in kex.c
------------------------------+--------------------
 Reporter:  ElectronShepherd  |       Owner:
     Type:  defect            |      Status:  new
 Priority:  normal            |   Milestone:  1.5.0
Component:  crypto            |     Version:  1.5.0
 Keywords:  memory leak       |  Blocked By:
   Blocks:                    |
------------------------------+--------------------
 I'm picking up a memory leak in kex.c, line 205. The code is:

 {{{
         session->server_hostkey =
             LIBSSH2_ALLOC(session, session->server_hostkey_len);

 }}}

 For some execution paths, session->server_hostkey is already allocated, so
 when the contents of the pointer are replaced, there's a leak.

 Oddly, I found it while SSHing into a Synology device, and it's fully
 repeatable. What's strange is that I don't get the leak when connecting to
 a "proper" Linux install such as Debian 7.

 For now, my workaround is to add

 {{{
             if (session->server_hostkey) {
                     LIBSSH2_FREE(session, session->server_hostkey);
                 }

 }}}

 just above the leaking call, but that doesn't seem like the most reliable
 solution to me, since it seems like the code is reusing a session which
 hasn't been cleared properly, and there's probably more cleanup that
 should be done against the session.

--

-- 
Ticket URL: <https://trac.libssh2.org/ticket/300>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients

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

Gmane