[Libssh] Windows patch

Keisial keisial at gmail.com
Sun Mar 2 22:42:18 CET 2008


I attach a patch which should makes libssh work on any 32-bit windows 
with getaddrinfo.

Windows specific:
There's a Makefile.Windows and a predefined config.h.win32-openssl
If you want to use libgcrypt or have the libraries on different folders, 
you'll need to manually edit them.

sample.c wasn't ported due to termios.h not being available in Windows
A dummy gai_strerror.c was copied from glibc because windows misses that 
function.

General code:
*Fixed the SIGSEGV when an unavailable cipher was requested (the return 
of ssh_find_matching wasn't checked).
*All calls to read & write have been changed into recv & send. As the 
existence of data is previously checked, the 0 parameter shouldn't 
change anything, but may be worth playing with it.
*The sockets are now closed with closesocket, #defined to close on 
non-windows.
*I removed aes256-cbc,aes192-cbc,3des-cbc from the negotiated ciphers 
(not its code). Since they didn't work anyway, the other end will 
hopefully support a cipher we speak.
*A session->fd>0 fixed to >=

Regards
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win32.patch
Url: http://www.cerkinfo.be/pipermail/libssh/attachments/20080302/0b2436b8/attachment-0001.txt 


More information about the Libssh mailing list