Skip to content

libssh 0.9.5 #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log
=============

0.7.0
+++++

Changes
-------

* Updated embedded libssh to ``0.9.5``.

0.6.0
+++++
Expand Down
13 changes: 10 additions & 3 deletions _setup_libssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ def build_ssh():

if not os.path.exists('src'):
os.mkdir('src')
if not os.path.exists('local'):
os.mkdir('local')
if not os.path.exists('local/lib'):
os.mkdir('local/lib')
# Depending on architecture cmake installs libraries into lib64,
# but we don't care about that.
os.symlink('lib', 'local/lib64')

os.chdir('src')
check_call('cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GSS_API=ON ../libssh',
check_call('cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../local -DWITH_GSS_API=ON ../libssh',
shell=True, env=os.environ)
check_call(['make', '-j%s' % (cpu_count(),)])
check_call(['make', '-j%s' % (cpu_count(),), 'all', 'install'])
os.chdir('..')

for src in glob('src/lib/libssh.so*'):
for src in glob('local/lib/libssh.so*'):
copy2(src, 'ssh/')
1 change: 1 addition & 0 deletions ci/appveyor/build_ssh.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ cp %OPENSSL_DIR%\lib\VC\libcrypto%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%
cp %OPENSSL_DIR%\lib\VC\libssl%PYTHON_ARCH%MD.lib %APPVEYOR_BUILD_FOLDER%

cmake --build . --config Release
cmake --install . --prefix ../local

cd ..
2 changes: 1 addition & 1 deletion ci/docker/manylinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM quay.io/pypa/manylinux2010_x86_64

ENV OPENSSL openssl-1.0.2p
ENV LIBSSH 0.9.4
ENV LIBSSH 0.9.5
ENV SYSTEM_LIBSSH 1

RUN yum install zlib-devel cmake3 -y
Expand Down
Binary file removed ci/docker/manylinux/libssh-0.9.4.tar.xz
Binary file not shown.
Binary file added ci/docker/manylinux/libssh-0.9.5.tar.xz
Binary file not shown.
16 changes: 16 additions & 0 deletions ci/docker/manylinux/libssh-0.9.5.tar.xz.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEjf9T4Y8qvI2PPJIjfuD8TcwBTj0FAl9aH9kACgkQfuD8TcwB
Tj35ZA/9G7lNf/byK3cJeXKb8Lp2oZ3iiAral4uT/cylnXnEa7dOoTjwV5MYvQqm
BDYFta7wsGBEWLOLrtyDJr4+krh9TSs53UVwieRTd0Z87MlcTb+a0gtiJa3Y5Gdv
QNge9rnUGr1MdTwvpPcSvQmoa7iH9HGzC2KrOCCyihUWX9kB+DNKWeSGJAZLNIJv
C3DvB8N0di/X5f74loRsAkwA6DAfiRtd8QyuqY7NeP3ZK/cEG5R/4WpCmCHCriBI
oBamKQT2CmNkHGCxMhN5iQFcm3D92lKdTLrMP+v0HlZnIjkzVJVBJeqn7FkWT967
JvGqDGEiNozH4eGGjQn5SyHaVCQIv5S815L2mEKG+p0F8BvW6fQs34/RA5np3J2s
SPSFhzKuORePQzoVzF8/Jsf7cTTuzgaSFKi2dkbgkqe39DnKOWhT0K6QVGfNbajz
C/a9GVRl7t6Q/kNR6dFAqc++7civlfQf2Dav1NfEobJxR+DpO5CPXBCuauTXgP8Y
gbvQjfBqk2Gl4VOfCObtEfLiHPNeLI/QpKq9+KAtQlWFawCOhIZsBH/p2ynDI+XJ
wxfLiXPkfeNuQUUuP126mkG9GxbsHGLY38p4WKEQQ3zVx1Pxilq77ZhKGMmTgnvA
/ArOwn3wNwgoP6OQdsy1hxTk16TZ+pRttJyhrdebEX7DnxAgPyw=
=eqzl
-----END PGP SIGNATURE-----
4 changes: 2 additions & 2 deletions libssh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
include(DefineCMakeDefaults)
include(DefineCompilerFlags)

project(libssh VERSION 0.9.4 LANGUAGES C)
project(libssh VERSION 0.9.5 LANGUAGES C)

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

# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
Expand Down
11 changes: 11 additions & 0 deletions libssh/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
ChangeLog
==========

version 0.9.5 (released 2020-XX-XX)
* CVE-2020-16135: Avoid null pointer dereference in sftpserver (T232)
* Improve handling of library initialization (T222)
* Fix parsing of subsecond times in SFTP (T219)
* Make the documentation reproducible
* Remove deprecated API usage in OpenSSL
* Fix regression of ssh_channel_poll_timeout() returning SSH_AGAIN
* Define version in one place (T226)
* Prevent invalid free when using different C runtimes than OpenSSL (T229)
* Compatibility improvements to testsuite

version 0.9.4 (released 2020-04-09)
* Fixed CVE-2020-1730 - Possible DoS in client and server when handling
AES-CTR keys with OpenSSL
Expand Down
1 change: 1 addition & 0 deletions libssh/doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if (DOXYGEN_FOUND)
set(DOXYGEN_TAB_SIZE 4)
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
set(DOXYGEN_MARKDOWN_SUPPORT YES)
set(DOXYGEN_FULL_PATH_NAMES NO)

set(DOXYGEN_PREDEFINED DOXYGEN
WITH_SERVER
Expand Down
2 changes: 1 addition & 1 deletion libssh/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(examples_SRCS
connect_ssh.c
)

include_directories(${libssh_BINARY_DIR})
include_directories(${libssh_BINARY_DIR}/include ${libssh_BINARY_DIR})

if (ARGP_INCLUDE_DIR)
include_directories(${ARGP_INCLUDE_DIR})
Expand Down
29 changes: 22 additions & 7 deletions libssh/examples/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ int main(void) {
ssh_session session;
ssh_channel channel;
char buffer[256];
int nbytes;
int rbytes, wbytes, total = 0;
int rc;

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

nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
while (nbytes > 0) {
if (fwrite(buffer, 1, nbytes, stdout) != (unsigned int) nbytes) {
rbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
if (rbytes <= 0) {
goto failed;
}

do {
wbytes = fwrite(buffer + total, 1, rbytes, stdout);
if (wbytes <= 0) {
goto failed;
}
nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
}

if (nbytes < 0) {
total += wbytes;

/* When it was not possible to write the whole buffer to stdout */
if (wbytes < rbytes) {
rbytes -= wbytes;
continue;
}

rbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
total = 0;
} while (rbytes > 0);

if (rbytes < 0) {
goto failed;
}

Expand Down
Loading