Skip to content

Commit e0b0494

Browse files
authored
libssh 0.9.5 (#24)
* libssh 0.9.5 * setup.py: add generated includes to search path * manylinux: update to libssh 0.9.5 * setup: install libssh (to build dir) instead of only building it
1 parent e2d4bca commit e0b0494

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+900
-348
lines changed

Changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Change Log
22
=============
33

4+
0.7.0
5+
+++++
6+
7+
Changes
8+
-------
9+
10+
* Updated embedded libssh to ``0.9.5``.
411

512
0.6.0
613
+++++

_setup_libssh.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,19 @@ def build_ssh():
1616

1717
if not os.path.exists('src'):
1818
os.mkdir('src')
19+
if not os.path.exists('local'):
20+
os.mkdir('local')
21+
if not os.path.exists('local/lib'):
22+
os.mkdir('local/lib')
23+
# Depending on architecture cmake installs libraries into lib64,
24+
# but we don't care about that.
25+
os.symlink('lib', 'local/lib64')
1926

2027
os.chdir('src')
21-
check_call('cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GSS_API=ON ../libssh',
28+
check_call('cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../local -DWITH_GSS_API=ON ../libssh',
2229
shell=True, env=os.environ)
23-
check_call(['make', '-j%s' % (cpu_count(),)])
30+
check_call(['make', '-j%s' % (cpu_count(),), 'all', 'install'])
2431
os.chdir('..')
2532

26-
for src in glob('src/lib/libssh.so*'):
33+
for src in glob('local/lib/libssh.so*'):
2734
copy2(src, 'ssh/')

ci/appveyor/build_ssh.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ cp %OPENSSL_DIR%\lib\VC\libcrypto%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
1717
cp %OPENSSL_DIR%\lib\VC\libssl%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
1818

1919
cmake --build . --config Release
20+
cmake --install . --prefix ../local
2021

2122
cd ..

ci/docker/manylinux/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM quay.io/pypa/manylinux2010_x86_64
22

33
ENV OPENSSL openssl-1.0.2p
4-
ENV LIBSSH 0.9.4
4+
ENV LIBSSH 0.9.5
55
ENV SYSTEM_LIBSSH 1
66

77
RUN yum install zlib-devel cmake3 -y
-489 KB
Binary file not shown.
491 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-----BEGIN PGP SIGNATURE-----
2+
3+
iQIzBAABCgAdFiEEjf9T4Y8qvI2PPJIjfuD8TcwBTj0FAl9aH9kACgkQfuD8TcwB
4+
Tj35ZA/9G7lNf/byK3cJeXKb8Lp2oZ3iiAral4uT/cylnXnEa7dOoTjwV5MYvQqm
5+
BDYFta7wsGBEWLOLrtyDJr4+krh9TSs53UVwieRTd0Z87MlcTb+a0gtiJa3Y5Gdv
6+
QNge9rnUGr1MdTwvpPcSvQmoa7iH9HGzC2KrOCCyihUWX9kB+DNKWeSGJAZLNIJv
7+
C3DvB8N0di/X5f74loRsAkwA6DAfiRtd8QyuqY7NeP3ZK/cEG5R/4WpCmCHCriBI
8+
oBamKQT2CmNkHGCxMhN5iQFcm3D92lKdTLrMP+v0HlZnIjkzVJVBJeqn7FkWT967
9+
JvGqDGEiNozH4eGGjQn5SyHaVCQIv5S815L2mEKG+p0F8BvW6fQs34/RA5np3J2s
10+
SPSFhzKuORePQzoVzF8/Jsf7cTTuzgaSFKi2dkbgkqe39DnKOWhT0K6QVGfNbajz
11+
C/a9GVRl7t6Q/kNR6dFAqc++7civlfQf2Dav1NfEobJxR+DpO5CPXBCuauTXgP8Y
12+
gbvQjfBqk2Gl4VOfCObtEfLiHPNeLI/QpKq9+KAtQlWFawCOhIZsBH/p2ynDI+XJ
13+
wxfLiXPkfeNuQUUuP126mkG9GxbsHGLY38p4WKEQQ3zVx1Pxilq77ZhKGMmTgnvA
14+
/ArOwn3wNwgoP6OQdsy1hxTk16TZ+pRttJyhrdebEX7DnxAgPyw=
15+
=eqzl
16+
-----END PGP SIGNATURE-----

libssh/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
1010
include(DefineCMakeDefaults)
1111
include(DefineCompilerFlags)
1212

13-
project(libssh VERSION 0.9.4 LANGUAGES C)
13+
project(libssh VERSION 0.9.5 LANGUAGES C)
1414

1515
# global needed variable
1616
set(APPLICATION_NAME ${PROJECT_NAME})
@@ -22,7 +22,7 @@ set(APPLICATION_NAME ${PROJECT_NAME})
2222
# Increment AGE. Set REVISION to 0
2323
# If the source code was changed, but there were no interface changes:
2424
# Increment REVISION.
25-
set(LIBRARY_VERSION "4.8.5")
25+
set(LIBRARY_VERSION "4.8.6")
2626
set(LIBRARY_SOVERSION "4")
2727

2828
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked

libssh/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
ChangeLog
22
==========
33

4+
version 0.9.5 (released 2020-XX-XX)
5+
* CVE-2020-16135: Avoid null pointer dereference in sftpserver (T232)
6+
* Improve handling of library initialization (T222)
7+
* Fix parsing of subsecond times in SFTP (T219)
8+
* Make the documentation reproducible
9+
* Remove deprecated API usage in OpenSSL
10+
* Fix regression of ssh_channel_poll_timeout() returning SSH_AGAIN
11+
* Define version in one place (T226)
12+
* Prevent invalid free when using different C runtimes than OpenSSL (T229)
13+
* Compatibility improvements to testsuite
14+
415
version 0.9.4 (released 2020-04-09)
516
* Fixed CVE-2020-1730 - Possible DoS in client and server when handling
617
AES-CTR keys with OpenSSL

libssh/doc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if (DOXYGEN_FOUND)
1313
set(DOXYGEN_TAB_SIZE 4)
1414
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
1515
set(DOXYGEN_MARKDOWN_SUPPORT YES)
16+
set(DOXYGEN_FULL_PATH_NAMES NO)
1617

1718
set(DOXYGEN_PREDEFINED DOXYGEN
1819
WITH_SERVER

libssh/examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(examples_SRCS
66
connect_ssh.c
77
)
88

9-
include_directories(${libssh_BINARY_DIR})
9+
include_directories(${libssh_BINARY_DIR}/include ${libssh_BINARY_DIR})
1010

1111
if (ARGP_INCLUDE_DIR)
1212
include_directories(${ARGP_INCLUDE_DIR})

libssh/examples/exec.c

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main(void) {
88
ssh_session session;
99
ssh_channel channel;
1010
char buffer[256];
11-
int nbytes;
11+
int rbytes, wbytes, total = 0;
1212
int rc;
1313

1414
session = connect_ssh("localhost", NULL, 0);
@@ -35,15 +35,30 @@ int main(void) {
3535
goto failed;
3636
}
3737

38-
nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
39-
while (nbytes > 0) {
40-
if (fwrite(buffer, 1, nbytes, stdout) != (unsigned int) nbytes) {
38+
rbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
39+
if (rbytes <= 0) {
40+
goto failed;
41+
}
42+
43+
do {
44+
wbytes = fwrite(buffer + total, 1, rbytes, stdout);
45+
if (wbytes <= 0) {
4146
goto failed;
4247
}
43-
nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
44-
}
4548

46-
if (nbytes < 0) {
49+
total += wbytes;
50+
51+
/* When it was not possible to write the whole buffer to stdout */
52+
if (wbytes < rbytes) {
53+
rbytes -= wbytes;
54+
continue;
55+
}
56+
57+
rbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
58+
total = 0;
59+
} while (rbytes > 0);
60+
61+
if (rbytes < 0) {
4762
goto failed;
4863
}
4964

0 commit comments

Comments
 (0)