Skip to content

Commit 1660827

Browse files
committed
libssh 0.9.5
1 parent e2d4bca commit 1660827

Some content is hidden

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

44 files changed

+870
-341
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
+++++

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)