Skip to content

Commit 7080f34

Browse files
authored
Ssh2 build (#9)
Added libssh2 build script. Refactor - moved agent init and auth functions to outside Session class. Fixed double de-allocation of more than one channel from the same session. Added session property to channel for parent session of channel. Refactoring - made agent related functions available as Cython functions under ssh2.agent that can be cimported. Fixed agent authentication error/exception handling. Added authentication error handling session tests. Added SFTPIOError exception. Added last_errno and set_last_error session functions. Added raising SFTPIOError on sftp mkdir errors. Added socket object and file descriptor attributes to session object for better de-allocation of sockets and socket use via C-API. Updated changelog. Added bytes conversion on SFTP mkdir and mkdir test. Re-generated C files for updated cython. Implemented hostkey_hash session method for computing host key hash and test. Minor code updates for performance. Updated doc strings. Fixed sftp readdir_ex long entry, added test. SFTP performance improvements.
1 parent bf46014 commit 7080f34

28 files changed

+10081
-5280
lines changed

Changelog.rst

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
Change Log
22
=============
33

4+
0.6.0
5+
++++++
6+
7+
Changes
8+
---------
9+
10+
* Implemented `last_errno` and `set_last_error` session functions
11+
* Agent authentication errors raise exceptions
12+
* C-API refactor
13+
* SFTP IO errors raise exceptions
14+
15+
Fixes
16+
-------
17+
18+
* Crash on de-allocation of channel in certain cases
19+
* SFTP ``readdir_ex`` directory listing (long entry) was not returned correctly
20+
421
0.5.5
522
++++++
623

724
Changes
8-
--------
25+
---------
926

1027
* Accept both bytes and unicode parameters in authentication with public key from memory.
1128

ci/build-ssh2.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash -xe
2+
3+
mkdir -p src && cd src
4+
cmake ../libssh2 -DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
5+
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCRYPTO_BACKEND=OpenSSL
6+
cmake --build . --config Release

setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
ext = 'pyx' if USING_CYTHON else 'c'
2525
sources = glob('ssh2/*.%s' % (ext,))
2626
_libs = ['ssh2'] if platform.system() != 'Windows' else [
27+
# For libssh2 OpenSSL backend on Windows.
28+
# Windows native WinCNG is used by default.
2729
# 'libeay32', 'ssleay32',
2830
'Ws2_32', 'libssh2', 'user32']
2931

0 commit comments

Comments
 (0)