Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 750b739

Browse files
committed
Merge commit '273fb4cfc62e307ce7930552d545963dc902b0c0'
2 parents 5697164 + 273fb4c commit 750b739

45 files changed

Lines changed: 1108 additions & 266 deletions

Some content is hidden

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

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.8.4 LANGUAGES C)
13+
project(libssh VERSION 0.8.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.7.1")
25+
set(LIBRARY_VERSION "4.7.2")
2626
set(LIBRARY_SOVERSION "4")
2727

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

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.8.5 (released 2018-10-29)
5+
* Added support to get known_hosts locations with ssh_options_get()
6+
* Fixed preferred algorithm for known hosts negotiations
7+
* Fixed KEX with some server implementations (e.g. Cisco)
8+
* Fixed issues with MSVC
9+
* Fixed keyboard-interactive auth in server mode
10+
(regression from CVE-2018-10933)
11+
* Fixed gssapi auth in server mode (regression from CVE-2018-10933)
12+
* Fixed socket fd handling with proxy command
13+
* Fixed a memory leak with OpenSSL
14+
415
version 0.8.4 (released 2018-10-16)
516
* Fixed CVE-2018-10933
617
* Fixed building without globbing support

doc/authentication.dox

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ The keyboard-interactive method is, as its name tells, interactive. The
127127
server will issue one or more challenges that the user has to answer,
128128
until the server takes an authentication decision.
129129

130-
ssh_userauth_kbdint() is the the main keyboard-interactive function.
130+
ssh_userauth_kbdint() is the the main keyboard-interactive function.
131131
It will return SSH_AUTH_SUCCESS,SSH_AUTH_DENIED, SSH_AUTH_PARTIAL,
132132
SSH_AUTH_ERROR, or SSH_AUTH_INFO, depending on the result of the request.
133133

@@ -154,9 +154,9 @@ Here are a few remarks:
154154
- Even the first call can return SSH_AUTH_DENIED or SSH_AUTH_SUCCESS.
155155
- The server can send an empty question set (this is the default behavior
156156
on my system) after you have sent the answers to the first questions.
157-
You must still parse the answer, it might contain some
157+
You must still parse the answer, it might contain some
158158
message from the server saying hello or such things. Just call
159-
ssh_userauth_kbdint() until needed.
159+
ssh_userauth_kbdint() until needed.
160160
- The meaning of "name", "prompt", "instruction" may be a little
161161
confusing. An explanation is given in the RFC section that follows.
162162

@@ -187,7 +187,7 @@ keyboard-interactive authentication, coming from the RFC itself (rfc4256):
187187
the name and prompts. If the server presents names or prompts longer than 30
188188
characters, the client MAY truncate these fields to the length it can
189189
display. If the client does truncate any fields, there MUST be an obvious
190-
indication that such truncation has occured.
190+
indication that such truncation has occurred.
191191

192192
The instruction field SHOULD NOT be truncated. Clients SHOULD use control
193193
character filtering as discussed in [SSH-ARCH] to avoid attacks by

doc/forwarding.dox

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Port forwarding comes in SSH protocol in two different flavours:
66
direct or reverse port forwarding. Direct port forwarding is also
7-
named local port forwardind, and reverse port forwarding is also called
7+
named local port forwarding, and reverse port forwarding is also called
88
remote port forwarding. SSH also allows X11 tunnels.
99

1010

@@ -23,15 +23,15 @@ Mail client application Google Mail
2323
5555 (arbitrary) |
2424
| 143 (IMAP2)
2525
V |
26-
SSH client =====> SSH server
26+
SSH client =====> SSH server
2727

2828
Legend:
29-
--P-->: port connexion through port P
29+
--P-->: port connections through port P
3030
=====>: SSH tunnel
3131
@endverbatim
3232
A mail client connects to port 5555 of a client. An encrypted tunnel is
3333
established to the server. The server connects to port 143 of Google Mail (the
34-
end point). Now the local mail client can retreive mail.
34+
end point). Now the local mail client can retrieve mail.
3535

3636

3737
@subsection forwarding_reverse Reverse port forwarding
@@ -51,7 +51,7 @@ Example of use of reverse port forwarding:
5151
SSH client <===== SSH server
5252

5353
Legend:
54-
--P-->: port connexion through port P
54+
--P-->: port connections through port P
5555
=====>: SSH tunnel
5656
@endverbatim
5757
In this example, the SSH client establishes the tunnel,
@@ -148,9 +148,9 @@ To do reverse port forwarding, call ssh_channel_listen_forward(),
148148
then ssh_channel_accept_forward().
149149

150150
When you call ssh_channel_listen_forward(), you can let the remote server
151-
chose the non-priviledged port it should listen to. Otherwise, you can chose
152-
your own priviledged or non-priviledged port. Beware that you should have
153-
administrative priviledges on the remote server to open a priviledged port
151+
chose the non-privileged port it should listen to. Otherwise, you can chose
152+
your own privileged or non-privileged port. Beware that you should have
153+
administrative privileges on the remote server to open a privileged port
154154
(port number < 1024).
155155

156156
Below is an example of a very rough web server waiting for connections on port

doc/guided_tour.dox

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ A SSH session goes through the following steps:
3131
- Invoke your own subsystem. This is outside the scope of this document,
3232
but can be done.
3333

34-
- When everything is finished, just close the channels, and then the connection.
34+
- When everything is finished, just close the channels, and then the connection.
3535

3636
The sftp and scp subsystems use channels, but libssh hides them to
3737
the programmer. If you want to use those subsystems, instead of a channel,
3838
you'll usually open a "sftp session" or a "scp session".
39-
39+
4040

4141
@subsection setup Creating the session and setting options
4242

4343
The most important object in a SSH connection is the SSH session. In order
4444
to allocate a new SSH session, you use ssh_new(). Don't forget to
45-
always verify that the allocation successed.
45+
always verify that the allocation succeeded.
4646
@code
47-
#include <libssh/libssh.h>
47+
#include <libssh/libssh.h>
4848
#include <stdlib.h>
4949

5050
int main()
@@ -69,12 +69,12 @@ The ssh_options_set() function sets the options of the session. The most importa
6969

7070
The complete list of options can be found in the documentation of ssh_options_set().
7171
The only mandatory option is SSH_OPTIONS_HOST. If you don't use SSH_OPTIONS_USER,
72-
the local username of your account will be used.
72+
the local username of your account will be used.
7373

7474
Here is a small example of how to use it:
7575

7676
@code
77-
#include <libssh/libssh.h>
77+
#include <libssh/libssh.h>
7878
#include <stdlib.h>
7979

8080
int main()
@@ -122,7 +122,7 @@ Here's an example:
122122
@code
123123
#include <libssh/libssh.h>
124124
#include <stdlib.h>
125-
#include <stdio.h>
125+
#include <stdio.h>
126126

127127
int main()
128128
{
@@ -285,9 +285,9 @@ int verify_knownhost(ssh_session session)
285285

286286
The authentication process is the way a service provider can identify a
287287
user and verify his/her identity. The authorization process is about enabling
288-
the authenticated user the access to ressources. In SSH, the two concepts
288+
the authenticated user the access to resources. In SSH, the two concepts
289289
are linked. After authentication, the server can grant the user access to
290-
several ressources such as port forwarding, shell, sftp subsystem, and so on.
290+
several resources such as port forwarding, shell, sftp subsystem, and so on.
291291

292292
libssh supports several methods of authentication:
293293
- "none" method. This method allows to get the available authentications
@@ -313,7 +313,7 @@ The example below shows an authentication with password:
313313
@code
314314
#include <libssh/libssh.h>
315315
#include <stdlib.h>
316-
#include <stdio.h>
316+
#include <stdio.h>
317317

318318
int main()
319319
{
@@ -338,7 +338,7 @@ int main()
338338
}
339339

340340
// Verify the server's identity
341-
// For the source code of verify_knowhost(), check previous example
341+
// For the source code of verify_knownhost(), check previous example
342342
if (verify_knownhost(my_ssh_session) < 0)
343343
{
344344
ssh_disconnect(my_ssh_session);
@@ -415,7 +415,7 @@ int show_remote_processes(ssh_session session)
415415
}
416416
nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
417417
}
418-
418+
419419
if (nbytes < 0)
420420
{
421421
ssh_channel_close(channel);
@@ -456,7 +456,7 @@ might be recoverable. SSH_FATAL means the connection has an important
456456
problem and isn't probably recoverable.
457457

458458
Most of time, the error returned are SSH_FATAL, but some functions
459-
(generaly the ssh_request_xxx ones) may fail because of server denying request.
459+
(generally the ssh_request_xxx ones) may fail because of server denying request.
460460
In these cases, SSH_REQUEST_DENIED is returned.
461461

462462
For thread safety, errors are bound to ssh_session objects.

doc/introduction.dox

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ mean that you should not try to know about and understand these details.
1212

1313
libssh is a Free Software / Open Source project. The libssh library
1414
is distributed under LGPL license. The libssh project has nothing to do with
15-
"libssh2", which is a completly different and independant project.
15+
"libssh2", which is a completely different and independent project.
1616

1717
libssh can run on top of either libgcrypt or libcrypto,
1818
two general-purpose cryptographic libraries.
1919

2020
This tutorial concentrates for its main part on the "client" side of libssh.
21-
To learn how to accept incoming SSH connexions (how to write a SSH server),
21+
To learn how to accept incoming SSH connections (how to write a SSH server),
2222
you'll have to jump to the end of this document.
2323

2424
This tutorial describes libssh version 0.5.0. This version is a little different

doc/scp.dox

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@page libssh_tutor_scp Chapter 6: The SCP subsystem
33
@section scp_subsystem The SCP subsystem
44

5-
The SCP subsystem has far less functionnality than the SFTP subsystem.
5+
The SCP subsystem has far less functionality than the SFTP subsystem.
66
However, if you only need to copy files from and to the remote system,
77
it does its job.
88

@@ -158,7 +158,7 @@ Let's say you want to copy the following tree of files to the remote site:
158158
+-- file1
159159
+-- B --+
160160
| +-- file2
161-
-- A --+
161+
-- A --+
162162
| +-- file3
163163
+-- C --+
164164
+-- file4
@@ -210,7 +210,7 @@ int scp_receive(ssh_session session, ssh_scp scp)
210210
size = ssh_scp_request_get_size(scp);
211211
filename = strdup(ssh_scp_request_get_filename(scp));
212212
mode = ssh_scp_request_get_permissions(scp);
213-
printf("Receiving file %s, size %d, permisssions 0%o\n",
213+
printf("Receiving file %s, size %d, permissions 0%o\n",
214214
filename, size, mode);
215215
free(filename);
216216

doc/sftp.dox

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Possible errors are:
100100

101101
@subsection sftp_mkdir Creating a directory
102102

103-
The function sftp_mkdir() tahes the "SFTP session" we juste created as
103+
The function sftp_mkdir() takes the "SFTP session" we just created as
104104
its first argument. It also needs the name of the file to create, and the
105105
desired permissions. The permissions are the same as for the usual mkdir()
106106
function. To get a comprehensive list of the available permissions, use the
@@ -358,19 +358,19 @@ int sftp_read_async(ssh_session session, sftp_session sftp)
358358
@subsection sftp_ls Listing the contents of a directory
359359

360360
The functions sftp_opendir(), sftp_readdir(), sftp_dir_eof(),
361-
and sftp_closedir() enable to list the contents of a directory.
361+
and sftp_closedir() enable to list the contents of a directory.
362362
They use a new handle_type, "sftp_dir", which gives access to the
363363
directory being read.
364364

365365
In addition, sftp_readdir() returns a "sftp_attributes" which is a pointer
366-
to a structure with informations about a directory entry:
366+
to a structure with information about a directory entry:
367367
- name: the name of the file or directory
368368
- size: its size in bytes
369369
- etc.
370370

371371
sftp_readdir() might return NULL under two conditions:
372372
- when the end of the directory has been met
373-
- when an error occured
373+
- when an error occurred
374374

375375
To tell the difference, call sftp_dir_eof().
376376

doc/shell.dox

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ int interactive_shell_session(ssh_channel channel)
209209

210210
Of course, this is a poor terminal emulator, since the echo from the keys
211211
pressed should not be done locally, but should be done by the remote side.
212-
Also, user's input should not be sent once "Enter" key is pressed, but
212+
Also, user's input should not be sent once "Enter" key is pressed, but
213213
immediately after each key is pressed. This can be accomplished
214214
by setting the local terminal to "raw" mode with the cfmakeraw(3) function.
215215
cfmakeraw() is a standard function under Linux, on other systems you can
@@ -245,13 +245,13 @@ provide a more elegant way to wait for data coming from many sources.
245245

246246
The functions ssh_select() and ssh_channel_select() remind of the standard
247247
UNIX select(2) function. The idea is to wait for "something" to happen:
248-
incoming data to be read, outcoming data to block, or an exception to
248+
incoming data to be read, outgoing data to block, or an exception to
249249
occur. Both these functions do a "passive wait", i.e. you can safely use
250250
them repeatedly in a loop, it will not consume exaggerate processor time
251251
and make your computer unresponsive. It is quite common to use these
252252
functions in your application's main loop.
253253

254-
The difference between ssh_select() and ssh_channel_select() is that
254+
The difference between ssh_select() and ssh_channel_select() is that
255255
ssh_channel_select() is simpler, but allows you only to watch SSH channels.
256256
ssh_select() is more complete and enables watching regular file descriptors
257257
as well, in the same function call.

doc/threading.dox

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ libssh may be used in multithreaded applications, but under several conditions :
1111
- If libssh is statically linked, threading must be initialized by calling
1212
ssh_init() before using any of libssh provided functions. This initialization
1313
must be done outside of any threading context. Don't forget to call
14-
ssh_finalize() to avoid memory leak
14+
ssh_finalize() to avoid memory leak
1515
- At all times, you may use different sessions inside threads, make parallel
1616
connections, read/write on different sessions and so on. You *cannot* use a
17-
single session (or channels for a single session) in several threads at the same
17+
single session (or channels for a single session) in several threads at the same
1818
time. This will most likely lead to internal state corruption. This limitation is
1919
being worked out and will maybe disappear later.
2020

0 commit comments

Comments
 (0)